Z-Wave devices resetting config after restart

I have received a few Aeotec recessed door sensors (z-wave) and have been trying to get them to play nice with home assistant but having some real difficulty.

When I first got them paired up they seemed to show up on the dashboard but no amount of triggering would update the sensor (it would always show as ‘on’). Going through the logs I realised it was set up to trigger a basic report which was obviously not updating the sensor state. After going through the node config I updated the config parameter to 1 which switched it to a binary sensor and that fixed the status in the dashboard as it was now switching between ‘on’ and ‘off’ which was perfect!

However, after I restarted home assistant the door sensors had reverted back to triggering a basic report - so while I could go round and remove the devices, update the config parameter etc. it seems like its only going to stick until Home Assistant gets a reboot.

How do I get Home Assistant to automatically update this (or save its config) on restarts so I don’t have to set them all up again manually?

Is this normal behaviour for a z-wave device to forget its settings after a home assistant restart?

The device settings are stored in the device itself, not in Home Assistant, so I’m not sure why you’re seeing this.

You did wake the devices before changing the settings?

Yeah the device accepts the config parameter update and works great after that. The issues come once a restart of home assistant occurs as the devices go back to sending the basic report.

I did wonder whether the config parameter could be set when home assistant starts but the devices would need to be taken out of sleep mode (battery powered z-wave) to accept the update so it wouldn’t really work that way either.

Is there a way to create an automation rule so if a basic report is triggered and received, it will respond with a config parameter update? Would that still be within the window of the device being awake?

Alternatively, if I understand correctly, the z-wave device will remain asleep and only wake at certain intervals during the day. When a command is sent to the device while it is asleep does this command get queued up and triggered once it is awake?

Just trying to find another way to change the config parameter without having to pull each device from the door and do it manually each time I restart

The updates should be queued until the device next wakes - as long as you don’t restart Home Assistant before that happens.

You could write an automation for platform: homeassistant triggered by event: start that uses the zwave.set_config_parameter service to change the settings.

I did actually attempt that - I created an automation rule for that but noticed it wasn’t updating as the device wasn’t awake. I have been doing a lot of restarts over the last few days though so I guess it probably hasn’t given it enough time for the device to wake after home-assistant loads.

If I leave it for a day without a restart the z-wave device should have woken up at least once during that period? Ill see what happens anyway

Think I am getting there! (finally!)

Was checking the logs and noticed that the automation rule I set up was not triggering as it was running before the z-wave components were up and running, saying something like ‘unable to find service zwave/set_config_parameter’
I therefore created a 2 minute delay on the automation to ensure everything was running properly before it triggered. Checked in the logs to make sure it had run properly, and when opening/closing the door to wake the device it looks like it took the parameter update at the same time!

Cheers for the help @Tinkerer - I will keep an eye on it for future restarts but think this may have fixed it

this sounds a bit like my quest: mqtt sensors with power meters going back to unknown after each reboot of HA. Only a new publish on the Zwave hub results in the sensors being populated in the HA Front end. Which only happens when there is a state-change.

Which is a nuisance, since not all sensors publish all the time, and they are supposed to be the triggers for future automation…

Could your automation rule be of any help to me: id love the HA to read the last recorded value out of memory, remembering its last state. the hub cant be triggered to send its value on request just yet, the dev’s havent allowed for that yet. (hope they will soon, I’ve file a feature request :wink:

Cheers,
Marius

So, I should have remembered there’s actually an event for the Z-Wave mesh being ready, I use it here after all.

alias: 'HA ready'
initial_state: 'on'
trigger:
  platform: event
  event_type: zwave.network_ready

As for wakeup, I’ve one wall switch that wakes once a week, but yes, generally every 24 hours or less.