My first example piston to share - suggestions for improvement welcome!
Nanoleaf Aurora LED Panels come with their own app to control them. I wanted a piston to rotate through a set of scenes or colors based on conditions such as whether or not someone is home to enjoy them, if it’s day or night, and what activity is going on in the room.
This depends on a few things. One is using this custom device handler. The thread talks about IFTTT integration at the top but uses local API on the Nanoleaf. Follow instructions in that thread or the developers guide to enable the local API and get the DTH going.
Second dependency (but could be replaced with virtual switches or other conditions) is Logitech Harmony Hub integration so when watching a movie, the panel isn’t going crazy in party mode. Discovered issues with update lag from Harmony but this thread provided a sufficient workaround. Switch 4 & 11 are Harmony controls for watching movie/tv, Switch3,12,13 are essentially party/music modes.
A virtual switch (“Switch 2”) is monitored to make it easy to disable the automation (“Nanoleaf Automation Paused”)
Populate the variables with the names of scenes or colors as preferred. Brightness levels and refresh interval customized in the main body.