I just faced an issue with "change state" node
I wanted to used initialState to re-set my alarm state after a node red restart.
So I just add a switch node between a "state changed" and "change state" block to filter on initialState = true.
The issue is that the initialState property pass through the switch and is saved by "change state" node....so once re-started, the "state changed" node will keep sending initialState=true....
I added a "change" node to delete initialState after my switch filter, but that behavior is a bit dangerous (as it trigger the infinite loop mentionned in readme).
By the way, I added a delay block in the loop, configured as rate limiter. this helps a lot in case of infinite loop: the machine will not be frozen with 100% CPU load.
it may be nice to integrate the initialState delete in "change state" ?
Also, I would suggest either (if possible), add a little rate limiter inside the "state changed" node, or maybe this could be recommended to add a delay configured as rate limiter in the readme file.
I'm not sure if there are any issue with those proposal, just some though and (little) experience I wanted to share
Hi !
I just faced an issue with "change state" node I wanted to used initialState to re-set my alarm state after a node red restart.
So I just add a switch node between a "state changed" and "change state" block to filter on initialState = true.
The issue is that the initialState property pass through the switch and is saved by "change state" node....so once re-started, the "state changed" node will keep sending initialState=true....
I added a "change" node to delete initialState after my switch filter, but that behavior is a bit dangerous (as it trigger the infinite loop mentionned in readme).
By the way, I added a delay block in the loop, configured as rate limiter. this helps a lot in case of infinite loop: the machine will not be frozen with 100% CPU load.
it may be nice to integrate the initialState delete in "change state" ?
Also, I would suggest either (if possible), add a little rate limiter inside the "state changed" node, or maybe this could be recommended to add a delay configured as rate limiter in the readme file.
I'm not sure if there are any issue with those proposal, just some though and (little) experience I wanted to share