I have a Nest thermostat I have hooked up to SmartThings. What I’d like to create is an app to send me a notification if the thermostat turns on (either heat or cool) and any window with a contact sensor is open. It doesn’t look like I’m able to subscribe to an event:
If you’re using Dianoga’s Smart Nest (http://build.smartthings.com/projects/smartnest/) device type, then you should be able to poll the device to get all the info. I’m still a noob myself so I don’t want to give you broken code, but take a look at the device type code.
Yeah, it just seems rather crude to set up an interval to query a value instead of having ST abstract it to fire the event when it sees a change. Perhaps wishful thinking.
That’s the best we have for now until Nest gives us some documentation on their ZigBee protocol. For now we’re stuck using their web API which obviously doesn’t communicate directly with ST API. You’ll need to setup a schedule using a cron expression to poll the Nest via the web API then act on the data.
You could set the Nest to away mode when a window is opened and change it back when the window closes. This way you subscribe to the contact sensor.
Thanks, @ethanferrell - I’d hoped (and I guess expected) since my Nest was polling to update the tiles, it’d trigger events (even if they were delayed a fair bit). I can set up a cron for this, probably every half hour to check sensors.