Random & every other hour rule

(J.R.) #1

Hi there,

I am looking for a way to turn one of my devices ON for an hour and OFF for an hour without having to write 12 rules to work only during the 12 hours of the day. Is there a way I can just make one rule to turn the device ON/OFF every other hour? A Random rule could also work for me. Like randomly the device comes on for 15/30 min at a time. Thanks!


Check out Tim’s Occupancy light Simulator, it might do what you need.

(J.R.) #3

Thank you very much for your prompt response Dave. However, I am super new to this product. Where would I start learning where and how to add all this code you sent me? I can play around with it editing to my like, however, I need a head start. Where do I learn more about advanced programming on the hub?

(Bruce) #4

You basically have to dive in and learn by trying it. Login in to the IDE, https://graph.api.smartthings.com, go to My SmartApps. Click on New SmartApp, then click on Code tab. Paste the source code there, and click on Create. Yes, you can edit it to customize it or modify it. After editing (if any), click on Save, and then Publish – For Me. The SmartApp will then be available in the mobile app under the + to add new things, slide all the way to the right to My Apps.

Also, there are many sample apps available by clicking Browse SmartApps in the upper right corner when the edit SmartApp window is open.


(J.R.) #6

Dave, I started adding the Nest using your link. And there’s a great set of instructions there, I did it all, up to the 5th step. I cannot, for the love of God, find the Preferences next to Edit on My Devices to add the nest serial number. Any ideas where I might be mistaken? Thanks!