Skip to content

"Missing device" repair is not cleared when the device comes back #5373

Todo

Description

@Glennmen

Checklist

  • I have restarted Home Assistant after the HACS or manual install.
  • I have read the FAQ's.
  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Battery Notes Version

3.9.1

Describe the issue

When a device that has a battery note is temporarily removed from Home Assistant, Battery Notes creates a missing_device repair issue. That part is correct. When the device is restored later with the same device ID, the repair issue stays in Settings → System → Repairs, even after reloading Battery Notes. The battery note itself keeps working, and its entities are attached to the device again. Only the repair issue is out of date.

This is risky because the repair offers "Fix", which removes the battery note. A user who sees a repair for a device that is clearly present may click it and lose the battery type and last-replaced date.

Expected behaviour

When the device exists again at setup or reload, Battery Notes deletes its own missing_device repair issue for that note, for example with ir.async_delete_issue(hass, DOMAIN, f"missing_device_{id}").

Actual behaviour

All 7 repair issues stay after the reload, with their original created timestamp. They are not created again, but they are not removed either. The only ways to get rid of them are "Ignore", or "Fix", which deletes a battery note that is still valid.

Possible improvement

  • Clear missing_device issues during setup/reload for notes whose device is present again, and/or
  • Check again before removing in the repair flow: if the device exists, don't offer removal. Delete the issue or tell the user it's out of date.

Reproduction steps

  1. Have battery notes on devices from an integration (here: 7 Netatmo Smart Valves via the core netatmo integration).
  2. Remove the integration's config entry. In my case I was switching from Home Assistant Cloud account linking to my own application credentials.
  3. Battery Notes creates a repair missing_device_<id> for each note. Expected so far.
  4. Add the integration again. HA restores the devices from the deleted-devices registry with the same device IDs.
  5. Battery Notes entities (battery_type, battery_last_replaced, battery_plus, …) are attached to the restored devices again and show the right values.
  6. Reload the Battery Notes config entry (or restart HA).
CleanShot 2026-11-27 at 20 06 46@2x CleanShot 2026-11-27 at 20 07 35@2x

System Health details

System Information

version core-2026.11.3
installation_type Home Assistant OS
dev false
hassio true
docker true
container_arch aarch64
user root
virtualenv false
python_version 3.14.10
os_name Linux
os_version 6.18.59-haos-raspi
arch aarch64
timezone Europe/Brussels
config_dir /config
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 18.5
update_channel stable
supervisor_version supervisor-2026.11.0
agent_version 1.14.0
docker_version 29.8.2
disk_total 916.9 GB
disk_used 28.9 GB
nameservers 2620:fe::fe, 1.1.1.1, 2606:4700:4700::1111, 9.9.9.9
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization
board yellow
supervisor_api ok
version_api ok
installed_addons Studio Code Server (7.2.0), Advanced SSH & Web Terminal (24.2.1), Matter Server (9.3.0), EMHASS (v0.18.11), Calibre-web (0.6.27.5), Music Assistant (2.10.13), Piper (2.5.4), Whisper (3.6.1), MariaDB (3.0.1), AdGuard Home (6.3.2), InfluxDB v1 (6.0.1), Glances (0.23.2), Cloudflared (7.0.23)
Dashboards
dashboards 4
resources 3
views 9
mode storage
Marktplaats
download_profile default
github_api ok
github_content ok
github_web ok
catalog_data ok
github_connected true
installed_version 2026.11.3
stage running
available_repositories 7309
installed_repositories 13
github_api_calls_remaining 4995
Network Configuration
adapters lo (disabled), end0 (enabled, default, auto), docker0 (disabled), hassio (disabled), veth843e8ea (disabled), veth7423847 (disabled), veth3b5febb (disabled), vetha02e2b6 (disabled), veth6125b62 (disabled), veth78ad3a8 (disabled), veth8673221 (disabled), vetha864cfd (disabled), veth8a4e28e (disabled), veth165e047 (disabled), veth9fa182c (disabled), veth7623521 (disabled), vethefc5d07 (disabled)
ipv4_addresses lo (127.0.0.1/8), end0 (192.168.196.215/24), docker0 (172.30.232.1/23), hassio (172.30.32.1/23), veth843e8ea (), veth7423847 (), veth3b5febb (), vetha02e2b6 (), veth6125b62 (), veth78ad3a8 (), veth8673221 (), vetha864cfd (), veth8a4e28e (), veth165e047 (), veth9fa182c (), veth7623521 (), vethefc5d07 ()
ipv6_addresses lo (::1/128), end0 (2a02:1810:a41b:d0f0:97f2:b4aa:d660:559f/64, fd42:1781:a90d:2:3ce3:91f3:61a3:9464/64, fe80::80ee:1bf1:c092:c995/64), docker0 (fd13:c81b:44f5::1/64, fe80::605e:feff:fe93:b81b/64), hassio (fd0c:ac1e:2100::1/48, fe80::2414:fbff:fec0:353e/64), veth843e8ea (fe80::98a8:adff:fe7d:4f6c/64), veth7423847 (fe80::809c:12ff:feb1:eeb7/64), veth3b5febb (fe80::1c2f:97ff:fe6a:e23d/64), vetha02e2b6 (fe80::2033:7cff:fe53:3c37/64), veth6125b62 (fe80::6079:c7ff:fe91:7290/64), veth78ad3a8 (fe80::3c6a:1eff:fef2:9491/64), veth8673221 (fe80::caa:f0ff:fe7e:3ca8/64), vetha864cfd (fe80::e088:76ff:feee:67b7/64), veth8a4e28e (fe80::4062:15ff:fe42:5606/64), veth165e047 (fe80::e06a:7fff:fe9b:efd1/64), veth9fa182c (fe80::f44a:a7ff:feef:aaa8/64), veth7623521 (fe80::a471:77ff:fe8f:68a8/64), vethefc5d07 (fe80::acc3:17ff:feda:2307/64)
announce_addresses 192.168.196.215, 2a02:1810:a41b:d0f0:97f2:b4aa:d660:559f, fd42:1781:a90d:2:3ce3:91f3:61a3:9464, fe80::80ee:1bf1:c092:c995
Recorder
oldest_recorder_run 15 november 2026 om 10:05
current_recorder_run 27 november 2026 om 15:41
estimated_db_size 666.13 MiB
database_engine sqlite
database_version 3.53.4
Solcast PV Forecast
can_reach_server ok
Spook
version 5.12.0
ghosts_found 0
ghosts_ignored 0
helpers_linked 3 of 3

Debug logs


Diagnostics dump

No response

Activity

  1. added
    bug
    on Nov 28, 2026
  2. andrew-codechimp commented on Nov 28, 2026

    @andrew-codechimp
    Owner

    Thanks for the detailed report, that's something that can definitely be improved and I'll work on it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions