I have a script that runs my lawn irrigation. I received my water bill that shows my gallons used over a 30 day period. Is there a way that I can find out how many minutes my irrigation script ran during that same time? I’d like to calculate my average gallons per minute then use that to create an entity that estimates my total monthly usage and cost as I’m using my irrigation in the future.
You could use the history stats sensor to record the time your water valve was on… if you keep a months worth of data in your recorder database (the default is 10 days).
I have a similar application (recording daily/weekly/monthly/yearly heating hours).
I’m using a History Stats sensor, just like tom_l suggested, but it’s configured to compute just the daily heating hours (i.e. it resets at midnight so that’s well within the recorder’s default retention period).
This value is used by the Utility Meter integration to compute daily/weekly/monthly/yearly statistics (i.e. separate sensors record each period). The Utility Meter’s values are held in the database’s long-term storage and aren’t purged at the end of the retention period.
Thanks for the replies. I think I have enough info now to get this figured out. I suppose I can’t go back to the last month of watering so I’ll have to start with the next month, or maybe next year now that the season is almost over.
Good afternoon.
I took the advice of @123 and set up the sensor in the Configuration.yaml code and then set up the Utility Meters.
However, my problem is that I need to calculate the runtime of a state’s attribute, not the actual state itself. I’m trying to calculate the runtime of my Ecobee thermostat’s cooling mode, which is an attribute (hvac_action of “cooling”) within the state (cool).
Can someone help me how to add the additional code for the sensor to calculate runtime of the attribute and not the state?
Follow the instructions here:
Thanks, @123 ! It looks like everything is working now. I’ve been struggling to learn how to capture data from an attribute. Hopefully I’m good-to-go now