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
71.6k stars 29.92k forks source link

Litter robot waste drawer level and full indicator out of sync with app #74435

Closed bagobones closed 2 years ago

bagobones commented 2 years ago

The problem

It seems that after a recent update to the whisker app the % full / full indications for the integration are off?

Over the last two weeks I have been finding that while the % updates in the HA integration it doesn't match the app.

The app has reached 80% or simply Full several times while the integration only shows about 60% full.

The App also seems to have a separate clear FULL status regardless of the estimated bin % as the full ness of the bin on the LR3 seems to be estimated on cycles.

What version of Home Assistant Core has the issue?

core-2022.6.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Litter-Robot

Link to integration documentation on our website

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

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

probot-home-assistant[bot] commented 2 years ago

litterrobot documentation litterrobot source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

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

bagobones commented 2 years ago

Looking at the log book from today the waste Drawer sensor was at 68% but the log book shows a status code of "Status Code changed to Drawer Almost Full - 2 Cycles Left"

bagobones commented 2 years ago

Looking at the status codes it might be better for me to monitor those than the % full but it is still odd that it differed so much from the app.

bagobones commented 2 years ago

Not sure what's up but it seems to be back in sync after the last empty and reset.

bagobones commented 2 years ago

OK I think I have figured out what is happening the behavior of the whisker app differs from the plugin.

It looks like the whisker app uses cycles to estimate the % full initially but will flip to hard coded % based on the full sensor warnings DF1 80% (I think), DF2 95% and DFS 100%

bagobones commented 2 years ago

This behavior may be specific to the LR3 as the NEW LR has a better full sensor.

natekspencer commented 2 years ago

The fix I implemented still won't guarantee it matches the whisker app 100%. What I suspect from my own observations is that the app now caps the drawer level at 95% regardless of cycle count / capacity unless it is in drawer full (DFS/SDF), in which case it shows as 100%. For the LR3, the waste level has always been an estimate. There is only a single laser sensor in the waste bin that triggers the DF1 status, then each successive clean cycle increments by 1 (DF2 followed by DFS).

The logic I've implemented in the library is such that any status outside of one of the drawer full statuses means there are at least 3 more cycles left and uses the max of cycle count + 3 or cycle capacity when estimating the drawer level. Once a drawer full status is encountered, it uses that in place of the cycle capacity (DF1 = cycle count + 2, DF2 = cycle count + 1, DFS/SDF = cycle count + 0) to calculate the waste drawer level. Hopefully that makes sense.

Also, they've recently added a bunch of new fields (newCycleCapacity, savedCycleCapacity, savedCycleCount, etc), so I'll still need to see how those potentially play in to the reporting via the app. If you notice any major discrepancies, please file a bug but at https://github.com/natekspencer/pylitterbot/issues