shelly-tools / shelly-script-examples

Shelly mJS Scripting examples
GNU Affero General Public License v3.0
72 stars 21 forks source link

Example of a script to emulate switch, but turning on twice resets brightness #6

Closed Peter200lx closed 2 years ago

Peter200lx commented 2 years ago

I'm using a Shelly plus 1 to allow my light switch to behave like a switch, but controlling the hue programmatically. However I also liked the behavior of power cycling the hue lights to restore full brightness occasionally. This script gives the best of both worlds. It keeps power to the hue lights all the time, and behaves like a normal switch, unless toggled on twice within 15 seconds, in which case it turns the hue lights up to full brightness.