Z-Wave State loss after restart

Whenever I restart Home-Assistant, it loses the state of all my zwave devices (the dimmers are all reset/ locks revert to unknown).

Is there a way to get HomeAssistant to query the devices for their state after reboot, or at the very least, have it remember what the last state was?

I was thinking of duplicating everything with an MQTT that has retain set. This is less than ideal because it just adds extra complexity, and doesn’t account for the state changing while the system was off (like in a power loss / interference)

Unless you have problems with your controller, or kill the running ha process, the state of the network is saved to zwcfg_[home_id].xml on shutdown, and will be read at ha startup.

Ah, I had no idea it was constantly updating/rereading that file. I have it set as readonly so that probably explains why nothing is being saved.

Does it also have a mechanism to update the state during a prolonged outage? Say if the last state was “off” and while HA was not running, i turned the light on. Will it be reflected after startup, or do i need to toggle the light off/on again to update the state?

1 Like

I was about to ask this same question - “Say if the last state was “off” and while HA was not running, i turned the light on. Will it be reflected after startup, or do i need to toggle the light off/on again to update the state?”

I’m guessing you are referring to non-battery powered devices which can be queried at any time? I’d hope HA would indeed update the status for these devices as it starts. I only have battery-powered devices so can’t try this myself.

But what about battery-powered devices which can’t be queried before they are triggered or wake up? I don’t want HA to show me that the door is closed when it is actually open - which is what happens now if the door is opened when HA was off. I’d like HA to show the status of these devices as “presumed” until they are actually updated. Is my only option to create placeholder entities/automations/scripts or is there a better option?

I have both battery powered and non-battery powered devices.

The wired devices I figure could be queried. But the devices I care about the most are battery powered (my door lock and front door open/closed sensor). It would be nice if I could force those to report, but I guess that’s not part of the standard

Yeah those can’t be forced to report because they are not listening (ie they are sleeping with their radios off). However I’d imagine - haven’t tried this yet - that by setting their wakeup period to low value you can minimize the time that they show as “unknown”. This will of course deplete their batteries faster.

Can you confirm whether the main powered devices are updated correctly after HA reboots?

Still, I’d argue that unknown is still better than displaying non confirmed values without showing they are actually presumed states.

Their state, both battery and mains powered, will be saved at shutdown. Those states will be read at startup as a presumed state, until the devices report to the network, then the latest state will be presented.

How can I read and utilize the assumed state? For example, this doesn’t come up with anything when I try it after restarting HA:

{{ states.sensor.sensative_strips_access_control_16_9.attributes.assumed_state }}

Use the state, there is no assumed state attribute.

Oh ok, I got the impression that HA would indicate that the values are presumed (until the devices report for the first time) when the saved states are read at startup. So this still leaves us in a situation where assumed states and actual states can’t be differentiated.