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 Still Bogus #109826

Closed
def1149 opened this issue Feb 6, 2024 · 15 comments · Fixed by #113172
Closed

Battery Still Bogus #109826

def1149 opened this issue Feb 6, 2024 · 15 comments · Fixed by #113172

Comments

@def1149
Copy link

def1149 commented Feb 6, 2024

The problem

As of HA 2024.2.0b8 the battery % level reported by the integration for my Wave+ is still wrong. The Airthings App reports 22% and the intgegration reports 4%.

Is this transfer function so complicated that we're going to need to get rocket scientists involved?

What version of Home Assistant Core has the issue?

2024.2.0b8

What was the last working version of Home Assistant Core?

??

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Airthings BLE

Link to integration documentation on our website

No response

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
Copy link

home-assistant bot commented Feb 6, 2024

Hey there @vincegio, @LaStrada, mind taking a look at this issue as it has been labeled with an integration (airthings_ble) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of airthings_ble 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 airthings_ble 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)


airthings_ble documentation
airthings_ble source
(message by IssueLinks)

@def1149
Copy link
Author

def1149 commented Feb 7, 2024

Installed HA 2024.2.0 and the Battery level IS STILL BOGUS. Sigh ...

@def1149
Copy link
Author

def1149 commented Feb 11, 2024

HA 2024.2.1 and Battery level for Wave+ is still bogus
image

@def1149
Copy link
Author

def1149 commented Feb 16, 2024

Updated HA core to 2024.2.2 and battery percentage is STILL bogus. Will this ever be fixed?

@def1149
Copy link
Author

def1149 commented Feb 19, 2024

My Wave Plus is still running on its miracle battery with 0% life left

@ismarslomic
Copy link

I have also experienced difference in battery level reporting in HA (through the airthings_ble integration) compared with the Airthings Wave mobile app.

App is reporting 100% battery (its just three weeks since I changed batteries) and HA reports 80%. This has been an issue for more than 6 months (or more). I got Wave Plus device.

@def1149
Copy link
Author

def1149 commented Feb 24, 2024

It looks like the % available is running about 18-20% low. Be interesting if others are seeing the same offset. May need to create a template sensor to fix if the integration can't be fixed. If we had the raw voltage we could create our own voltage to % algorithm. It's not that complicated. We could also model the discharge curves for primary lithium cells, rechargeable lithium cells, and alkaline cells to be accurate assuming the voltage measurements are accurate. but that could be verified with raw voltage values. But the battery gauge doesn't need to be highly accurate, just better than being low 20% off to prevent replacing batteries that are fine

@andrewlow
Copy link

andrewlow commented Feb 26, 2024

I too have an AirThings+ using BLE integration into HomeAssistant and see incorrect battery information.

I seem to have zero as the answer for the last 2 weeks of data.. The AirThings app tells me 72%

@def1149
Copy link
Author

def1149 commented Feb 26, 2024

Updated HA core to 2024.2.4 and battery percentage is STILL bogus.

@ismarslomic
Copy link

@def1149 any reason you expected it to be fixed in 2024.2.4? Release note did not mention any changes in the airthings_ble integration.

@def1149
Copy link
Author

def1149 commented Feb 27, 2024

@def1149 any reason you expected it to be fixed in 2024.2.4? Release note did not mention any changes in the airthings_ble integration.

This battery issue, one of several defects that I have reported in this integration, has been ongoing since at least September 2023 when I reported it on #100521, That's 5 months to fix a simple calculation. Is there a scheduled date to release the fix which was referenced in #110866 as fixed "a while ago"

@joostlek
Copy link
Member

Feel free to help out fixing this "simple calculation". If you can't, please have patience and help out where needed.

@def1149
Copy link
Author

def1149 commented Feb 27, 2024

Feel free to help out fixing this "simple calculation". If you can't, please have patience and help out where needed.

I'm happy to be of assistance '

It's not known what Vmin and Vmax are for the Wave Plus but for Alkaline batteries the following simple formula won't be 20% off like the current "algorithm". Given that the batteries are supposed to last up to 18 months, the average discharge rate is very low. Also given these are indoor devices so batteries aren't typically exposed to low temperatures

Battery percentage = ((Current voltage - Vmin)/(Vmax - Vmin)) x 100

This can be further refined and made a little more accurate by breaking the discharge curve into a series of 6 or 8 segments and applying the same formula for each segment. Ultimately the accuracy of this depends on the accuracy of the A/D converter being used and that is also unknown without a device teardown and examination. My guess is that the A/D converter is not off by 20%

I could disassemble the device and measure the voltage and deduce Vmin and Vmax. But since the raw voltage isn't supplied by the integration I can't create my own template sensor to calculate the correct battery capacity remaining, or I would have already done that.

@LaStrada
Copy link
Member

As I’ve said many times now, this is fixed here:
Airthings/airthings-ble#27

We haven’t made a release with this yet, but will very soon. We need to fix the light sensor (currently broken/missing) + test everything.

I will make a PR to fix the light sensor before the weekend, and I’m hoping for a release very soon after that so we can bump the framework in Home Assistant. I can promise this will be done in March, but cannot promise it will be part of 2024.3.0.

@ismarslomic
Copy link

@LaStrada thanks for clarifying. Is the fix for battery state dependent on the light sensor? If not, would it be possible to fix these two in different releases?

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants