node-red-contrib-home-assistant-websocket icon indicating copy to clipboard operation
node-red-contrib-home-assistant-websocket copied to clipboard

"Output on change" missing from documentation for poll state node

Open jeffreychausse opened this issue 10 months ago • 2 comments

Describe the bug

I'm monitoring a simple input_boolean using the poll state node and although the state of the entity does not change, the node outputs even if the "Output on change" is checked.

Also the "Output on change" is not documented.

To Reproduce

No response

Expected behavior

When "Output on change" is checked, the node should not output if the device's state does not change.

Screenshots

Image

Example Flow


Environment Information

Version: 0.75.0

Home Assistant version: 2025.1.4 Companion version: 4.1.2

Node-RED version: 4.0.8 Docker: yes Add-on: 19.0.0

Node.js version: v22.11.0 x64 linux OS: Linux 6.6.66-haos x64

Additional context

No response

jeffreychausse avatar Jan 25 '25 20:01 jeffreychausse

After some more testing, I realize the "Output on change" is for when the state changes between two polls.

This is useful, but a bit counter intuitive because the name of the node is POLL so we do not expect the node to output between polls. With that in mind, one would think "Output on change" means the node will output only if the state changes after a poll is made. For instance, I set the polling interval to 5sec and was expecting the node to output only upon deploy and then only if the state changed, but it outputs continuously, at the polling interval rate, regardless.

I think adding a description for "Output on change" to the manual would help reduce the confusion.

jeffreychausse avatar Jan 25 '25 20:01 jeffreychausse

The "Output on change" behavior makes sense within the context of the poll-state node. This node is designed to poll at regular intervals, and the "Output on change" option ensures it also outputs when the state changes between those polls. If you want a node that outputs only when the state of the entity changes, regardless of polling, you would use the "events: state" or "trigger: state" node instead. That said, updating the documentation to clarify exactly what "Output on change" does would certainly be helpful.

zachowj avatar Jan 26 '25 01:01 zachowj