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
Closed

Problem with when-state-changes? #16

michaelblight opened this issue Jun 6, 2018 · 1 comment

Comments

@michaelblight
Copy link

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
Copy link
Owner

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 added a commit that referenced this issue Apr 9, 2019
…tate changes" setting on node-red restart and for newly placed nodes.
niklaswall added a commit that referenced this issue Apr 9, 2019
…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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants