Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Problem with when-state-changes? #16
If I deploy a node that comes ON at 9:00 and goes OFF at 9:15 and I deploy it at 8:50 then it is logically in the OFF state. If I select "when state changes + startup", I would expect an OFF message immediately. However, if I select only "when state changes", I would expect an ON message at 9:00. However, about a minute after I deploy, I am getting an OFF message - presumably because the state is changing from 'null' to OFF. Or am I doing it wrong?
Yes, you are right that should be the case.
The evaluation is done on a minutely basis, so when a minute has passed and there is no previous state (null as you mention) the output will change... however, this does not happen on deploy, it only happens when node-red starts up and when a new light scheduler node is dropped in a flow.
I have solved this and it will be available shortly.