I have two Hue LightStrips (attached to a Hue hub)–“Door Left” and “Door Right”. I’m having a very strange problem.
I’ve devolved to the code shown here for testing purposes. As you can see, it should set the left door to red and the right door to green. They turn on automatically when you do this.
Here’s the first level of weirdness: If the lights are turned off via the Hue App, then I run this piston, the right door turns green as expected. This door always works. The left door, however, turns red, as expected, then immediately turns purple. If I run the piston again, it works as expected (i.e., turns red). It only does this purple thing when it comes from a turned off state. For giggles, I unplugged/plugged the left light, turned it off and tried again. It worked as it should. I turned it off via the app and ran it…it turned purple.
Here’s the weirder part, though:
If I delete the With command for the right door so that only the left door is set, it always works fine. It comes on red and stays red regardless of its previous state.
The logs don’t tell me anything useful.
|+0ms|╔Received event [Home].test = 1512782917608 with a delay of 87ms| |---|---| |+47ms|║RunTime Analysis CS > 11ms > PS > 28ms > PE > 9ms > CE| |+56ms|║Runtime (35592 bytes) successfully initialized in 28ms (v0.2.0ff.20171129) (55ms)| |+57ms|║╔Execution stage started| |+62ms|║║Cancelling statement #1's schedules...| |+72ms|║║Executed physical command [Door Left].setColor([[hex: #FF0000, hue:0, saturation:100, level:50]]) (6ms)| |+73ms|║║Executed [Door Left].setColor (7ms)| |+75ms|║║Cancelling statement #3's schedules...| |+84ms|║║Executed physical command [Door Right].setColor([[hex: #008000, hue:33, saturation:100, level:25]]) (5ms)| |+84ms|║║Executed [Door Right].setColor (6ms)| |+86ms|║╚Execution stage complete. (29ms)| |+93ms|╚Event processed successfully (93ms)|
I can see this is a Hue problem somehow but am stumped. Two questions: (1) What’s the best way to accomplish this (for the record I also went to set the level to 20%; I just took that out of here) and (2) regardless of the “right” way to do this, can someone explain what’s going on?