node-red-contrib-zigbee2mqtt
node-red-contrib-zigbee2mqtt copied to clipboard
"in" nodes cause warning about not using retain even for devices that support getting their state
When we connect to mqtt and get the devices from the bridge, we send a get message for every device that supports it:
https://github.com/andreypopov/node-red-contrib-zigbee2mqtt/blob/59d31200d8234ae4893aa66ba57e8c6913d26fdc/nodes/server.js#L725-L753
"in" nodes trigger a warning about not using retain right after deploy because they start up before this initial querying finishes. This warning was originally intended for devices that don't support get (most likely battery powered ones) because their state otherwise can't be queried after a Node-RED deploy.
https://github.com/andreypopov/node-red-contrib-zigbee2mqtt/blob/59d31200d8234ae4893aa66ba57e8c6913d26fdc/nodes/server.js#L454-L456
Do you want to remove this warning?
No, I think the warning is useful but the "in" node behaviour could use improvement.
I have 2 different types of "in" nodes:
- in node with send value on start and send only if value changes -> this shows warning but still sends correct value around start
- in node without send value on start and without send only if value changes (for decoupled switch single/double click handling) -> this shows warning too and sends value 3 times
I would expect the second one to not send any value. (It currently doesn't break anything for me because it sends null all 3 times and I filter out anything that is not "single" or "double")
This issue is mostly just for reference in case the current behaviour breaks other people's flows or if someone is looking for issues at open source projects that they can get experience with while also helping others.
I think, I have my setup crashing due to this "in" issue. :-|