Hi, I’m hoping to get some help adding a condition to an automation to run if a binary sensor was “on” at any point in the last 8 hours.
Example automation: If the washing machine was on today ( < 8 hours ago), and the rain gauge senses rain (or is > 0mm), send a notification to get the washing off the line.
I’m fine with the notification and the rain part, but I’m struggling to workout how to check if the binary sensor was “on” at any point on the same day.
One solution: assuming you have a boolean running/idle sensor for your washing machine, create a 1 day History stats count sensor for your washing machine:
The numeric condition for your automation would be that the count sensor is above zero.
I see the time returned is not in true time/hours. e.g. if the washing machine was in the “on” state for 30 minutes, it will return 0.5 hrs. Or if it was 1hr 15 minutes, it will return 1.25 hrs. Is there a way to return this as HH:MM format?