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

Flume Values are Too Large after 2022.11.3 Core Update #82336

Closed
zSprawl opened this issue Nov 18, 2022 · 18 comments · Fixed by #86354
Closed

Flume Values are Too Large after 2022.11.3 Core Update #82336

zSprawl opened this issue Nov 18, 2022 · 18 comments · Fixed by #86354
Assignees

Comments

@zSprawl
Copy link

zSprawl commented Nov 18, 2022

The problem

In the update released yesterday, the following change was implemented for the Flume water monitoring integration:

#81968

It has caused the "current flume value" showing water to be 5 times larger. The change above increased the polling interval by 5 times, so it lines up perfectly with the issue.

The Flume website and API show 2 gallons, the value in Home Assistant is displayed as 10 gallons, which of course set off all kinds of alarms at my house as we searched for the leak.

What version of Home Assistant Core has the issue?

core-2022.11.3

What was the last working version of Home Assistant Core?

core-2022.11.2

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Flume

Link to integration documentation on our website

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

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

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

Code owner commands

Code owners of flume 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 flume Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


flume documentation
flume source
(message by IssueLinks)

@jeeftor
Copy link
Contributor

jeeftor commented Nov 18, 2022

Most interesting....

I increased the time for polling to 5 mins because multiple devices were timing out due to api limits.

Did it as a temporary patch with the eventual goal to scale based on device count - but I'm not sure why that's causing this issue.

I'll have to take a look but I'm currently traveling for thanksgiving.....

@zSprawl
Copy link
Author

zSprawl commented Nov 19, 2022

No problem.

It only appears to affect the "real time" value, aka sensor.flume_sensor_home_current, so the new water charts and such aren't affected.

@jordahlm
Copy link

I'm seeing the same thing. I had set up an automation to turn on my bathroom fan if the flow rate I've found to indicate a shower was sustained for 4 minutes. After the 2022.11.3 update this was getting constantly triggered just by small water usage. I thought it was just the 5 minute polling period but looks like this issue is at play as well. Hopefully we can get the adaptable polling rate based on device count that was mentioned in place soon!

@mermelmadness
Copy link

Following as I've noticed the same, but only with the current usage reading. My daily total seems to be in line with my normal usage.

@tcallaw
Copy link

tcallaw commented Dec 13, 2022

I am seeing the same thing. Current usage is reading much higher than actual. Daily and monthly totals line up with the totals in the Flume app.

@rmcginty
Copy link

Same as others report. Current high but all other values match app.

@jeeftor
Copy link
Contributor

jeeftor commented Dec 20, 2022

I'm hoping to take a look at this in the near future... been very busy with work.

@matthewhadley
Copy link

I am experiencing this issue (Flume current value was 5x what the Flume app showed) and found that overriding the change made in https://github.com/home-assistant/core/pull/81968/files resolves it.

To revert the change I created a custom component following these steps:

  1. Copy the current Flume component code into custom_components/flume per https://skylar.tech/overriding-default-home-assistant-components/
  2. add a version number (1.0.0 was fine) per https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes/#versions
  3. change homeassistant/components/flume/const.py to DEVICE_SCAN_INTERVAL = timedelta(minutes=1)

@zSprawl
Copy link
Author

zSprawl commented Jan 15, 2023

It would be nice if the dev reverted the change from before Thanksgiving until they have time to work on this.

@bdraco
Copy link
Member

bdraco commented Jan 15, 2023

If was that simple I would have already reverted it. Unfortunately reverting the change will trigger the rate limit so we would need to revert quite a few changes.

@bdraco
Copy link
Member

bdraco commented Jan 15, 2023

I think the easiest fix would be to remove the binary sensor platform and change the interval back to 1 minute.

@bdraco
Copy link
Member

bdraco commented Jan 15, 2023

This would probably work as well but it makes the leak notifications pretty useless

# Flume API limits individual endpoints to 120 queries per hour
NOTIFICATION_SCAN_INTERVAL = timedelta(minutes=60)
DEVICE_SCAN_INTERVAL = timedelta(minutes=1)
DEVICE_CONNECTION_SCAN_INTERVAL = timedelta(minutes=60)

@bdraco
Copy link
Member

bdraco commented Jan 15, 2023

There aren't really any good solutions here since the flume rate limit is so low https://flumetech.readme.io/docs/rate-limiting

They really need a local api, a web socket api, or an increase in rate limit. Its not so great to have to poll for something time critical as a leak notifications.

With flume's current api design there are just a lot of bad options to fix this. Whatever change gets made is going to make one of the sensors worse.

@kdill00
Copy link

kdill00 commented Jan 16, 2023

I think the current one should take up 60 of those updates and reduce calls to the others? Because in the current way if im mistaken, I still have to use the flume app to clear a leak notification? Their is no need to have the other sensors update but once every so often. Maybe make it customizeable? Have all sensors disabled and allow people to choose in some manner? Prior to the update all my leak notifications were based off of the current use. If i am wrong that there is a way to reset the leak notification without opening the flume app let me know, but homeassistant to me is what i use to ditch a 1000 apps.

@matthewhadley
Copy link

If it's possible, it might be good to allow the user to set how to spend their "api budget". My preference is to have the usage levels updated frequently, with sensor.flume_current updating as frequently as possible. I do not use the native flume notifications as I replicate these directly in homeassistant automations using the current flow rate data.

@bdraco
Copy link
Member

bdraco commented Jan 17, 2023

# Flume API limits individual endpoints to 120 queries per hour
NOTIFICATION_SCAN_INTERVAL = timedelta(minutes=5)
DEVICE_SCAN_INTERVAL = timedelta(minutes=1)
DEVICE_CONNECTION_SCAN_INTERVAL = timedelta(minutes=60)

I'd probably pick something like this. It seems to work well for me and avoid the rate limit

bdraco added a commit to bdraco/home-assistant that referenced this issue Jan 21, 2023
To stay under the API limit the device connection is now
only checked hourly and notifications are only checked every
5 minutes

fixes home-assistant#82336
thecode pushed a commit that referenced this issue Jan 21, 2023
To stay under the API limit the device connection is now
only checked hourly and notifications are only checked every
5 minutes

fixes #82336
@zSprawl
Copy link
Author

zSprawl commented Jan 23, 2023

@bdraco - Thank you!

@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2023
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.

9 participants