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
72.44k stars 30.32k forks source link

Mopeka integration not reporting tank level #88232

Closed csmracing closed 1 year ago

csmracing commented 1 year ago

The problem

The Mopeka integration is not reporting a tank level when the reading quality is 33%. The data is still present and valid in the BLE report, but the integration is not returning the value. The integration should only report a null value for the tank level once the reading quality is 0%. This is different from the behavior of the Mopeka app as it reports the data when the reading quality is 33%.

What version of Home Assistant Core has the issue?

2023.2.5

What was the last working version of Home Assistant Core?

none

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Mopeka

Link to integration documentation on our website

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

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

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

Code owner commands Code owners of `mopeka` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign mopeka` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


mopeka documentation mopeka source (message by IssueLinks)

csmracing commented 1 year ago

Thank you for looking at this issue, but I do not think the changes in #88680 will resolve this issue. Reviewing the code, it appears Bluetooth signal leveling handling has been improved. The issue I raised concerns the processing of the data received. The reading quality is a value from the data received from the sensor, not related to Bluetooth signal quality.

I don't know the file structure of the repository well enough to locate the file that actually processes the data received by the integration. I assume there is an if statement somewhere that evaluates the value of reading_quality and doesn't update tank_level if the value is below 66%.

edestecd commented 1 year ago

0.4.1 does include my fix for allowing sensor quality of 1 or 33%. You can see it here if interested: https://github.com/Bluetooth-Devices/mopeka-iot-ble/commit/1e034e6c1884c7c8e1eefbe64022aaa11df68648

csmracing commented 1 year ago

Thank you for sharing the link! I am relatively new to the Home Assistant community, and I'm still learning where all the code repositories are. I reviewed all the code for the Mopeka integration in the core component, but I needed help figuring out where the BLE message decoding was done and the actual logic of the integration existed. Thanks for sharing this!

I updated to Core 2023.3.0 today, so I should be able to verify the functionality over the next few days.

You can clearly see my issue in this data graph from today:

Web capture_1-3-2023_235520_ha clownshoemotorsports com

As the temperature increases and the propane density decreases, the sensor quality also decreases. You can see how the level data drops out when the sensor quality drops to 33%. The weather over the next few days should allow me to verify that the updated code works as expected.

Thanks again!

csmracing commented 1 year ago

I've already been able to confirm that the integration is no longer dropping the level data when the sensor quality reports as 33%. Thank you for your support of Home Assistant and the Mopeka integration!

Web capture_2-3-2023_8407_ha clownshoemotorsports com