Color temp set from variable not being persistent


#1

Hello all,

Appreciate your help, hope the title makes sense.

1) Give a description of the problem
When color/ level is set via a variable (such as one based on time of day) when I then change the level (ie dimming up/ “adjust level”) it will revert to a previous color temperature setting, not respecting the current color temp setting that was set by my variable. I see this behavior in the switch piston as well as a motion detection piston.

2) What is the expected behavior?
Pushing a switch button will set a pair of Hue lights to a predefined color temperature and level setting that is defined in a set of variables. These variables run all day in a separate piston (ie at 3pm set color VAR to 4200 and level VAR to 80%). Once light is set to these settings, I should be able to use other buttons to increase/ decrease level or color temperature as desired.

3) What is happening/not happening?
My button press to set light level/ color temp from variables is working fine. But, if I then use a different button to increase or decrease the level, it will not respect the current state of the bulbs but revert to a previous setting that was not set via the variable.

**4) Post a Green Snapshot of the piston![image|45x37]

  • This is the main piston for my light switches.
  • And this is my motion detection piston that also has a similar issue

5) Attach any logs (From ST IDE and by turning logging level to Full)
The logging is pretty intense as there are a lot of different scenarios and I haven’t been able to see anything in the logs that gave me even a clue. Please let me know if there is a specific thing you would like me to test and log.

Thank you all for the help. I hope this all makes sense but please let me know if I can explain anything further.

Best,
Kevin


#2

dont you else if. make all the else if blocks their own if blocks.

there is also an else if block with no condition at line 64 of the first piston so that will always get executed if the flow reaches there.


#3

Hi,

Thank you for the reply. I will make those changes. For my own understanding, even if I do have else if rather than just if statements, why does that ‘knock out’ the color temperature settings set by my variable but not when the color temp is set specifically (ie set color temperature 3200k works as expected vs set color temperature to {@Variable}k does not)?

Thank you, sorry if it is a dumb question!