Skip to content

battery percent does not persist when battery device goes to sleep #5077

Closed

Description

@magiva

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

battery percent doesnt persist when the device sleeps and goes unavailable

Describe the issue

battery percent doesnt persist when the device sleeps and goes unavailable.

i have a number of smoke alarms, i cant use battery+ for automation when the level drops as they only report every 3 hours, the battery+ goes unavailable, it should retain the last value.

i end up having to create secondary sensors to account for this, the battery+ should really handle this i feel

Reproduction steps

  1. use a battery device that sleeps
  2. observe battery+ percent
  3. observe value disapears as the device goes unavilable
    ...

System Health details

i dont have this

Debug logs


Diagnostics dump

No response

Activity

  1. andrew-codechimp commented on Aug 29, 2026

    @andrew-codechimp
    Owner

    Hi, couple of questions as I don't have any sleepy devices.
    Does the original battery also go unavailable for the duration of the sleep?
    Does Battery+ update its value when the device wakes?

  2. magiva commented on Aug 29, 2026

    @magiva
    Author

    this is what i see in battery+

    Image

    it wakes up to post its battery every 3 hours or so. other battery devices do the same but with different intervals.
    a motion sensor for example sends its battery with a trigger or just periodically wakes
    but then all go to sleep as battery devices should.
    the picture does show the percent value but thats because the device hasnt gone unavailable yet but you can see in the chart that that is what happens

  3. magiva commented on Aug 29, 2026

    @magiva
    Author
    Image

    here is the smoke alarm (2) that has gone to sleep so the sensor shows no value

  4. andrew-codechimp commented on Aug 29, 2026

    @andrew-codechimp
    Owner

    Thanks, so just to confirm the original battery sensor is doing the same, going unavailable then back to a percentage?

  5. magiva commented on Aug 29, 2026

    @magiva
    Author
  6. andrew-codechimp commented on Aug 29, 2026

    @andrew-codechimp
    Owner

    Thanks, I'll give this some thought but I'm currently leaning towards an option per device to retain value that you can switch on for sleepy ones.
    That way those that rely on unavailable states can still use it for general devices.

  7. added
    enhancement
    on Aug 29, 2026
  8. magiva commented on Aug 29, 2026

    @magiva
    Author
  9. linked a pull request that will close this issueRetain state #5104on Sep 25, 2026
  10. andrew-codechimp commented on Oct 1, 2026

    @andrew-codechimp
    Owner

    This has now been implemented in version 3.7.0
    An additional option within a device's battery note.

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

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions