1) Give a description of the problem
So, as most found out, when you have a Hue light, which in my case is a Lightstrip Plus, and you power it on (aka plug it in), it comes on to a preset color and level and you (apparently) can’t change that default. Hue would tell you to just use a Hue switch such that the light controller is always on and when toggled it will turn the light on to the last setpoint. So, I’m trying to achieve the same by forcing the light to a desired color when it turns on from the power off state.
Through webCoRE, I can easily check to see if the light switch is on and then check to see if the Hue light is online and then check to see if the Hue light is actually on and finally issue a command but it seems that the command is not received always. Basically, I think I have a race condition and the Hue light isn’t quite ready to receive commands from the Hue base or possibly some sort of cloud-induced latency.
What can I use to detect if the light is actually responsive? I wasn’t able to find a do…while loop or similar.
Also, what does “DeviceWatch-DeviceStatus” really do? Somehow I was not able to figure out where the docs were on that despite a few minutes of searching the Wiki.
Here is the simple piston as it stands now. I first check to see if the wall switch is on, then I (assume) check to see that the Hue bulb is online, and finally I check to see if the Hue bulb is switched on.
About 25-50% of the time when the wall switch is turned on, the light never changes to the “white” color but in ALL cases, a trace reveals that all three of the IF statements evaluate as true. I of course started out with a much simpler piston but the results are the same if I simplify it to “if wall switch is on, set hue color to white”.
Ideas?