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
73.78k stars 30.88k forks source link

Firmware Version Info not showing update after firmware update #127187

Open jvmahon opened 1 month ago

jvmahon commented 1 month ago

The problem

Following a firmware update, the firmware information shown on the device web page will still display the "old" firmware version.

Note that the update firmware progress dialog that is displayed during the update will correctly show that the update succeeded, so this is just a minor interface issue. Following a reboot or restart of the Matter integration, the device's web page will update.

image

What version of Home Assistant Core has the issue?

2024.9.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Matter

Link to integration documentation on our website

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

Diagnostics information

No response

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 month ago

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

Code owner commands Code owners of `matter` 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 matter` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


matter documentation matter source (message by IssueLinks)

agners commented 1 month ago

Yeah I've noticed this, this is a known bug. The server should trigger a reinterview, but the changes currently don't get pushed to Home Assistant Core just yet. I think a Core restart (or simply a reload of the Matter integration) should be enough to get things refreshed.

BadakalaYashwanth commented 1 month ago

@jvmahon As a way to address this concern, I propose the reinterview of the device be performed after a firmware update. This is in order to push the updated firmware version information to Home Assistant Core.

Here is one possible way of looking at it:

Add a callback function: The Matter integration needs to include a callback that is used when a firmware update is successfully done. The purpose of this function will be to initiate a reinterview process of the device.

Reinterview the device: In the callback, make use of the Home Assistant Core API to do a reinterview of the device. This process will update all the details related to the device, including the firmware version.

Refresh the Matter integration: As a mercy, In the event that the reinterview does not change the firmware applied, the Matter integration will be reloaded so that the new parameters will be visible on the device’s web page.

The above code is a simplified example and may need to be adapted to the actual implementation of the Matter integration in Home Assistant Core.

import asyncio from homeassistant.components.matter import MatterIntegration

async def firmware_update_callback(device):

Trigger a reinterview of the device

await device.reinterview()

# Reload the Matter integration as a fallback
await MatterIntegration.reload()

Register the callback function

MatterIntegration.register_firmware_update_callback(firmware_update_callback)