Any way to have it show hourly usage instead of an always increasing counter?
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.
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.
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
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).