Using iRule to control SmartThings

I have my ecobee’s added via the My Ecobee device by @yvesracine and I use his endpoints + the native ST thermostat device. I was originally using the community version but it kept losing connection every X many days so I switched to the My Ecobee and it works great. I’ve never had any issues with disconnecting.

In iRule my devices are as simple as:

name: Upstairs myEcobee - Away
data: thermostats/DEVICEID/away


name: Upstairs myEcobee - Heat level up
data: thermostats/DEVICEID/heatLevelUp

For my gateway endpoints I’m relaying everything through a web server so that I could quickly change my authorization header when I was playing with the setup. iRule has variables for the device code now so I would just add the auth header like this now:

name: Kitchen Dimmer 1 - Off
data: levels/DEVICEID/off?access_token=$VARIABLEWITHAUTHTOKEN

You should have 2 HTTP gateways (assuming you’re using a REST API like mine.) 1 setup as a GET and the other setup as a PUT. I use the GET to query state and the PUT to make some kind of a change. Both should point to https://graph.api.smartthings.com/api/smartapps/installations/INSTALLID on port 443.
In my case both of these point to my web server and I just forward them out to that same endpoint, I’m pretty sure I tested going direct to ST though and it worked fine.

Smartapp:

Hope this helps!