Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with when-state-changes? #16

Closed
michaelblight opened this issue Jun 6, 2018 · 1 comment

Comments

@michaelblight
Copy link

commented Jun 6, 2018

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?

@niklaswall

This comment has been minimized.

Copy link
Owner

commented Apr 9, 2019

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.

Yes, you are right that should be the case.

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?

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.

/Niklas

@niklaswall niklaswall closed this Apr 9, 2019

niklaswall added a commit that referenced this issue Apr 9, 2019

Fixed #16 (Problem with when-state-changes?). Now obeying the "when s…
…tate changes" setting on node-red restart and for newly placed nodes.

niklaswall added a commit that referenced this issue Apr 9, 2019

Fixed #16 (Problem with when-state-changes?). Now obeying the "when s…
…tate changes" setting on node-red restart and for newly placed nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.