Device <sometimes> not returning to saved variable

Not sure if I found a bug or not. I have emailed my full LogicSummary.txt in just in case it is needed.

The goal:
When my AC turns on, read the status of my ceiling fan for what load level it is currently at. Then when the AC turns off, set the fan back to the previous load level it was at before the AC turned on.

The issue:
I am using a test switch to simulate my AC and a dimmable lamp on my desk to simulate my ceiling fan. If my fan is NOT on, the load level is 0, when my AC turns off, my fan turns off. If my fan is anything BUT zero load level, when the AC turns off, the fan jumps to 100% instead of returning to the previous value. In the two tests I grabbed screenshots in, I was expecting my fan to return to either 18% or 22%. But it went to 100%. And to confirm this wasn’t an issue with my Hue bulb, I swapped out the lamp for my actual fan and it did the same exact thing. Jumping to 100% IF the current value was anything but 0 when the AC turned on.

As a last test, I added an additional FALSE activity. First turn the fan (lamp) off and then set the load level to the oFanStateOff. The lamp did turn off for a split second, but them right up to 100%.

Is this a bug or something with me?


image

You’re using and saving LoadLevelStatus, which is a dimming value, but trying to send it to a “Turn on/off” action, which is a binary value. So anything other than 0 is going to be interpreted as “on” and likely ultimately set the dimming value to 100 as you are seeing. Don’t you mean to use “Set dimming level” there (in “AC is On IS FALSE”)?

1 Like

I did see the Set dimming level option, but it only displayed a 0, for Off, in the drop down. I just tried manually entering in the {oFanStatusOff} variable in that field. It accepted it and worked!

As much as possible, I try not to let Reactor lock you in on action input. The metadata available for actions in Luup is terrible, so I can’t rely on it enough to use it to constrain input very much. That’s why in actions, you actually have two highlights on fields… have you ever noticed? Red highlight is used to draw attention to clear problems that must be addressed (like a missing device). Yellow highlight is used when the data entered (or not entered) may not be correct for the field. The yellow is a warning only, and will not prevent you from saving your activities or running them. But if things don’t work as expected, giving anything highlighted in yellow a squiz could be illuminating.

AH! I have seen the red, yes. The yellow, only when it is an On or Off setting, as noted in a screenshot above.

Thank you for all the help so far, and for the help to come. :wink: I know I will have more questions as I transition things over from PLEG. Reactor is AWESOME and well deserving of a donation. Stand by for that to come in.