Flume Water Meter

Any way to have it show hourly usage instead of an always increasing counter?

1 Like

Sure, how about the total for the last 60 minutes? That will gradually go up and down over time, but won’t steadily increase and then reset to zero.

I think that would do the trick.

Done: https://github.com/michaeldavie/flume-sensor/raw/master/flume_homeassistant.py

I’ve added another sensor that replicates the “Last 24 Hours” shown in the app, and I’ve also started working on the notifications. The latest version is on Github.

2 Likes

I did install the first version of this integration and it worked great. Right off the batch.
Then I installed the latest version (replacing the content of the Flume folder and rebooting HA) and now it doesn’t work anymore. HA doesn’t see the sensor.

My home-assistant log contains the following with respect to Flume:
File “/config/custom_components/flume/sensor.py”, line 41, in setup_platform
File “/config/custom_components/flume/flume_homeassistant.py”, line 35, in init
File “/config/custom_components/flume/flume_homeassistant.py”, line 62, in get_device_id

Any advice?

Line 41 in sensor.py is

CONF_CLIENT_SECRET: config.get(CONF_CLIENT_SECRET)

so I suspect your configuration.yaml doesn’t have the client secret properly set up.

This is probably because the access token expired; I haven’t built the refresh mechanism yet. I should be able to push a version that handles this tonight.

This is great. Just got mine hooked up. Does anyone have a good code snippet for a lovelace card with a graph? The best I can do is sticking all the entities on on entities card.

Also, I spoke to Flume support yesterday and they indicated an API endpoint for setting ‘away’ status is coming next month. I’m looking forward to having alarm decoder set flume as away and alert on any water usage when no one is home. @michaeldavie I see a method in there for unread notifications but no matching sensor in HA. Does it only appear if you have notifications?

I’ve started working on it in the API connector library, but I haven’t got it mapped into the sensor component yet. It shouldn’t be too hard, but I haven’t had much time to work on it.

No worries. I appreciate all that you have done so far.

I’ve pushed a new update that handles refreshing the access token. Please give it a try and let me know if you have any trouble.

I did try the new version and it works great now.
I did have to delete the token file - not sure why but after I did this and rebooted HA the sensor started reporting water usage.

Where is the token file located? as I just upgraded and I get an error.

Thanks

it’s located in the same folder as configuration.yaml - file is called flume_tokens

Thanks got it working.

Thanks for making this. Just got a flume, yesterday and everything seems to be working well. So far I really like it, was wanting to get my water usage into HA somehow and Flume seems like the easiest way.

Are the “Last 60min” and “Last 24hr” sensors essentially rolling sum measurements?

I think I prefer just a sum of the last minute if the query is running every minute. Then HA can make all the other sensors using its built in stats sensors and such.

I modified your code to additionally give the 1 minute measurement, i like it because it matches the app better, that and the cumulative sum measurements make more sensor to me vs the last 60min/24hr sensors.

Just my 2 cents fwiw

1 Like

Yes, those queries are sums. The Last 24hr one in particular I tweaked to make sure that it matched the figure shown in the app.

I like your idea of supporting the statistics sensor, so I added a current_min sensor to my version as well. You could also use this to drive a template binary sensor, which I think would approximate what the app is doing for Water Status (Running / Not Running).