zwave-js / certification-backlog

Issues and discussions related to Z-Wave certification of HA + Z-Wave JS
1 stars 0 forks source link

After hard resetting a controller, the integration page lists "no devices or entities" #3

Open marcelveldt opened 1 year ago

marcelveldt commented 1 year ago

After hard resetting the Z-Wave controller, e.g. by sending

{ "command": "driver.hard_reset" }

to zwave-js-server, the integration page shows "no devices or entities" for that instance, although the controller should be listed as a device.

The information does not come back when reloading the integration. It does however come back when:

https://github.com/home-assistant/frontend/assets/17641229/c1f7c189-7c23-4d50-b544-4b9fc4d0d078

Describe the behavior you expected

The device information should be up to date after reconnecting to zwave-js-server.

Steps to reproduce the issue

  1. Have an instance of zwave-js-server running in a way that you can send it custom commands, ideally from the repository on a dev machine.
  2. Set up a Z-Wave integration, do not use the supervisor addon, enter the path to your dev machine in the following dialog
  3. Make sure it shows the devices in the integration overview
  4. Send { "command": "driver.hard_reset" } to the server, e.g. by putting this file in the zwave-js-server repo as src/bin/hard_reset.ts, then execute it using ts-node src/bin/hard_reset.ts.
raman325 commented 11 months ago

We call this when we get the hard reset request before we initiate the hard reset: https://github.com/zwave-js/zwave-js-server/blob/master/src/lib/server.ts#L595C1-L625. I am unclear why this issue is happening, when we close the websocket server in zwave-js-server, the HA client should disconnect and the config entry should reload until the server is up again.

Either that destroy logic isn't working correctly, or when the server starts up again, the Z-Wave network is in a weird state that we don't know how to handle downstream. I will try to test this behavior but if you have any other ideas I am all ears

AlCalzone commented 2 months ago

Related to https://github.com/zwave-js/zwave-js-server/issues/1216

MartinHjelmare commented 1 week ago

What's the status? We've changed things around this in the server during August I believe. What's left to do?

AlCalzone commented 1 week ago

After the recent server change, HA no longer notices when the controller is hard reset. Also prior to that change, the flow was very awkward. Considering it gets executed about 200-300 times during certification by hand, we should make sure it is smooth.

MartinHjelmare commented 1 week ago

I think we should find out what to do, ie how to react to the hard reset, before the Hackaton. What messages are sent from the server to the client after the hard reset?

AlCalzone commented 1 week ago

@raman325 Can you answer that?