My water company now provides me with a daily dump of the previous day’s water usage, broken down by hour. I would like to import this data. I am able to parse it out of their website into a CSV, with a datetime and a CCF measurement for each hour. Is there any way I can import this hourly data on a daily basis as water usage?
The issue is the import of historic data.
You can not import data for a specific date or hour as it is now.
I made a feature request a few days ago that you can vote for.
Historical you are right this is a challenge…
Without the idea to confuse things … but it depends a bit what you want to achieve. I managed to import (not !!! via this one) data in a specific sequence and partial-seconds difference, so these indeed did not show the values per date but… that did work for me.
If a csv-file-read can be executed properly then (not history) that might work.
I had the thought of updating the sensor with each line of the CSV, updating the last_reset parameter each time.
Although it also looks like the energy dashboard doesn’t support water yet anyway?
Indeed no water and in fact…not really energy but more costs
I however have my own gauges on elec/gaz on a separate view in a dashboard too, it is not rocket science to create this and yes…it does look different from the energy board, but in the view you have full control
On water, over summer when I have more time I will try to install an additional meter in the pipes to get the data in, at the moment my meter is too far from the home to allow any connection through the walls
Hi! I have the same situation with my water company. Did you solved it? I’m very interested in sensing the water consumption from HA
I’m thinking of creating a custom component to do this. I’d need some help with samples of input files and understanding the specific use cases.
It would be amazing : I’ve seen a lot of different people that are struggling with this situation (including me )
input file can be a basic CSV or JSON file with two columns :
- Timestamp
- Value
Be careful that the input (CSV File or variable coming out of an API) can be updated every day, and contains data from the past 10 days. Therefore value for already known days just need to be updated, not created.
Tell me if it’s not clear enough, I can provide you with my input, coming from my water provider website (scraping).
Thanks!
Hello. I would really need more help on this as I get the energy CSV from provider in the same way, but I’m struggling with making the configuration.yaml read the data.
Any help would be appreciated.
Thanks!
I know its a work around, but here is what I’m planning to do:
I will have my Ignition Maker Edition (Free home SCADA software) gateway scanning a shared folder every hour. I will be dropping the files manually here since my utility companies don’t have any API integrations. If Ignition sees a csv file, it will analyze the name of the file (so it knows if its water, gas or electric), open it, parse it and insert it to my MySQL server. Then close the file and move it to a “processed” folder or a “quarantine” folder it it fails. Then I will have home assistant display the values via SQL query integration. I will upload screenshots during development and the final product. Wish me luck!
The Spook integration have added a service call to import historical data.
I am encountering the same challenge.
Every day my water company dumps the hourly usage data from the past 36 to 12 hours (or so) – so that the newest data is many hours old.
There should be a way to enter data in a “batch” fashion.
I can do that with manual entries to the ‘state’ database for the corresponding sensor but this is klugey and potentially fragile.
Also, presumably, this would mess up the tracking of statistics unless there were a way to trigger a recalculation of statistics for that one sensor over the given time period.
As more data is broadcast and stored to the cloud, I think we have to allow for the paradigm where changes are not updated real time.
I posted some reasonably robust Python code to insert backdated state data into the states table. The code also adds the corresponding statistics to the statistics
and short_term_statistics
tables.
The source can be either a CSV file or a SQLite db – with 2 columns (one for timestamp in UTC, other for data to be entered) See the following link: