Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery Level -> state differs from attribute #51

Open
ChristophCaina opened this issue Dec 28, 2023 · 6 comments
Open

Battery Level -> state differs from attribute #51

ChristophCaina opened this issue Dec 28, 2023 · 6 comments

Comments

@ChristophCaina
Copy link
Contributor

The State of the Battery Entity is different to the attribute "battery level"

grafik

Also, the for the state the UnitOfMeasurement is missing.

@MechEng70
Copy link

MechEng70 commented Dec 29, 2023

The "Sure Petcare" HA addon is able to display the battery levels. Can confirm that they are broken in Sure HA

If you want to add them back, you can use template helpers.

Helpers - Template -> sensor.
Use this for the template section: {{ state_attr('sensor._battery_level','battery_level')}}
% and Battery and measurement.

This will get you the bettery percentage for graphs or automations (need to change those though)

@ChristophCaina
Copy link
Contributor Author

The problem here is, that the package you install via HACS has an older code base.
The files which are available here in the repo are newer than what you install through HACS...

So I would recommend to update the files with the ones provided here then, you should see the battery value (without a unit of measurement) ... and it is reporting a different value than the attribute (as you can see in my screenshots)...

BUT: With the files replaced, you will also get some deprication warnings in HomeAssistant with the 2024.1. release...
I've submitted some PRs to address this... they just needs to be changed.

The major problem here is, that it seems, that:

  1. the repo is not really up to date -> manifest.json still pointing to an older surepy version, instead of the 0.9.0
  2. the install package (release) is still older than the source
  3. no updates for two years on the source codes

Right now, I am using this integration + the core integration in parallel, since the core integration does provide LOCK entities...
This integration "just" provides a sensor, showing the current lock state - but has other advantages compared to the core integration, such as the device_tracker for the pets and the extended attributes.

I would consider, to refactor the code - according to the HA documentation some information given in the attributes should be their own sensors...

Yet - I was not able to dive into the code deep enough to provide more changes than the submitted PRs for compatibility with the upcomming 2024.1 Version of HA.

@MechEng70
Copy link

How is that possible when the version on HACS is the 0.4.2 version that is on here?

@ChristophCaina
Copy link
Contributor Author

I can't explain how it is possible, but it is also mentioned here: #31

@ChristophCaina
Copy link
Contributor Author

after observing the battery state for some time, it seems, that there's a gap of around 10% between the sensors state and its attribute.
grafik

@ChristophCaina
Copy link
Contributor Author

unfortunately, still an issue.
could this be related to the settings for the "battery options"?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants