I’m trying to integrate my water meter into home assistant for displaying usage and detecting leaks. My water company has given me access to a REST webservice which returns historical (but not current) usage information. For example, I can query the webservice today and receive yesterday’s usage (e.g., 24 hourly readings of total gallons used) but I cannot get the current usage (i.e., gallons per hour).
I have succeeded in using a command line sensor to run a bash script which downloads yesterday’s data and reform it into an array of date/time, usage pairs. I have also used a json_attributes parameter to extract one array element into an attribute (and I can probably make this work for the other 23 elements) but I want the data to be shown at the correct date/time, not the date/time of script execution. Any ideas?