Closed cgarwood closed 4 years ago
We should only get NODE_ADDED
instead of NODE_UPDATED
if there also was a NODE_REMOVED
event ?
Node Added is fired when OZW is starting up. Node New is fired when OZW pairs a new device.
It would be nice if you could handle the Inclusion Button on the zsticks as well so people can do a “offline” inclusion.
And yes, if OZWDaemon restarts - during the shutdown it should remove the node/value topics etc.
If I understand correctly:
Since this is then normal behavior for the OZWDaemon, we need to handle this in home assistant, as I assume we don't want to remove nodes as they are represented in Home Assistant just because the OZWDaemon restarts.
In Home Assistant we want to add a node representation both when a NODE_ADDED event and a Node New event is fired, if that node is not yet seen.
Side note: How is the Node New event represented in https://github.com/cgarwood/python-openzwave-mqtt? I don't find it.
Is that correct?
Events are fired as EVENT_INSTANCE_EVENT
. Payload is {type: "event_name_from_topic", data: {"event": "data}}
. See https://github.com/cgarwood/python-openzwave-mqtt/pull/47
Closed by #93 which will mark entities unavailable when OZW is not in a valid state (e.g. restarting). This can be even improved bt watching the LWT message of the OZW daemon on MQTT so we can also track the MQTT connection or OZW broker to be completely offline (non clean shutdown). A normal/clean shutdown of OZW is catched by the status.,
If Home Assistant is currently running and the OZWDaemon restarts, we'll get a bunch of
NODE_ADDED
andVALUE_ADDED
etc events fired, and the component will try to recreate all of the entities instead of simply updating them.Need to add checks for if the entity already exists and fire an update instead of trying to recreate.