home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.81k stars 30.51k forks source link

Firmware entity reports incorrect update when device renamed #96726

Closed EnochPrime closed 1 year ago

EnochPrime commented 1 year ago

The problem

I replaced a Inovelli LZW30 switch (firmware 1.22) and replaced it with an Inovelli VZW31-SN switch (firmware 1.0.0). After replacing the firmware entity for the device reported I should update from 1.0.0 to 1.22.

I expected the firmware entity to know that 1.0.0 is the latest firmware for this device and not report an update. I did not attempt to press update for fear of loading incorrect firmware on to device.

Steps:

  1. Remove z-wave node with device name "Device A"
  2. Add new z-wave node (device name "Node X")
  3. Rename "Node X" to "Device A"
  4. Firmware reports update incorrectly

What version of Home Assistant Core has the issue?

core-2023.7.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

zwave_js

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zwave_js/

Diagnostics information

zwave_js-45a7b9a2c861bb370dbe004ad2bc1017-2-1 Dimmer-a5da297ad1824680db33573a18bfbda8.json.txt

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @home-assistant/z-wave, mind taking a look at this issue as it has been labeled with an integration (zwave_js) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zwave_js` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zwave_js` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


zwave_js documentation zwave_js source (message by IssueLinks)

asayler commented 1 year ago

I ran into this same issue as well, except the rename isn't even necessary. In my case:

  1. Removed a GE/Jasco Z-wave Dimmer named "Dimmer A"
  2. Add a new Inoveli Z-wave Dimmer and name it "Dimmer A" as well
  3. Wait a few minutes, after which HA prompts me to update the "Dimmer A" firmware from 1.0.0 to 5.29, despite 5.29 being the Jasco firmware for the old dimmer, and 1.0.0 being the most recent Inoveli firmware for the new dimmer.

I haven't tested whether clicking "Install" in the update prompt will actually attempt to install the firmware. Hopefully there are other protections in place to prevent folks bricking devices by installing the wrong firmware image.

codahq commented 1 year ago

It may be worse than that? I didn't change any devices. I removed dead entities from the integration because sometimes the integration creates air temperature entities on devices that don't support air temperature or voltage reports on devices that don't support voltage reports.

After I removed the dead entities I noticed that my Hank HKZW-SO01 had a firmware update available. This is pretty much impossible because this company cares very little about their devices once they are in consumers' hands.

image image image

I was super curious and I sort of hate the device anyway so I tried to update it. It failed of course. I didn't expect it to succeed but I considered that it might point somebody in the correct direction to fix the issue.

image

Logs: Logger: homeassistant.components.websocket_api.http.connection Source: components/zwave_js/update.py:257 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 2:32:33 AM (3 occurrences) Last logged: 2:41:42 AM

[140161181586000] Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1965, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2005, in _execute_service return await cast( ^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service return await service.entity_service_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 848, in entity_service_call response_data = task.result() # pop exception if have ^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1192, in async_request_call return await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/update/init.py", line 156, in async_install await entity.async_install_with_progress(version, backup) File "/usr/src/homeassistant/homeassistant/components/update/init.py", line 414, in async_install_with_progress await self.async_install(version, backup) File "/usr/src/homeassistant/homeassistant/components/zwave_js/update.py", line 257, in async_install assert firmware AssertionError

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.