-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Events: State node not updating when state changes quickly #1655
Comments
Is the state change being detected by Home Assistant from the media player? You can confirm this by listening for the
You can also verify this in Node-RED by using an events: all node to see if the event is being picked up there as well. |
I can see the event is detected by Home Assistant in the developer tools, the The only way to reproduce seems to be by adding a timed condition on the |
When the 'for' condition is set in the events: state node, the entity's state must remain unchanged for the specified duration. Since you're mentioning the state changes rapidly and within the 4-second window, it won't capture the intermediate states. |
As I understand it, the node's output is triggered if the state matches the required state during the given period, so it doesn't matter if the state changes from an unmatched state to a matched state within this period, does it? For example, if I set the node to wait for the entity to be in
Am I understanding it wrong? |
Describe the bug
I set up a
events: state
node to track a media player entity and detect when it is off for 30s. This entity has several states and often go very quickly throughplaying -> idle -> off
(when I turn it off without pausing first, which happens all the time).When this happens, the node gets stuck on detecting the
idle
state.To Reproduce
This flow triggers the behavior every time (when the
events: state
node is freshly created).When triggering the
on/off
rapid change, the node gets stuck onon
as in the picture. If I modify the node (eg. adding one second to the condition timer) the problem seems to disappear.Expected behavior
The
events: state
node should update with every new entity state, it should not get stuck on a previous spurious state.Screenshots
See "To Reproduce"
Example Flow
Environment Information
Version: 0.73.0
Home Assistant version: 2024.10.2
Companion version: 4.1.1
Node-RED version: 4.0.5
Docker: yes
Add-on: no
Node.js version: v18.20.4 x64 linux
OS: Linux 6.1.0-23-amd64 x64
Additional context
No response
The text was updated successfully, but these errors were encountered: