Hi awesome community
I’ve been trying to find a suitable solution to gather the time a device tracker have been online for a day.
I’ve made a sensor that displays how long time the device have been online efter the state went online/home. But when it turns off, the timer resets.
Is there a way that i can see how long time in minutes or hours that the device have been online from 00:00 - 23.59 and then resets when a new day starts?
It’s for tracking how long time a teenager is on his Playstaion 4. We have rules about the time limit, and this solution would make it a lot easier for me to regulate it.
I hope some of you have som great ideas. I’m open for any pointers in any direction.
A happy new year to all of you
@robertwebbe Hi Robert. Did you find out anything around the above mentioned challenge? I have used the script and created a virtual entity with it, but so far not really worked out how to use it best.
I am not sure I can use this same method for my purpose. I have a door sensor where I want to measure how much “closed” time there is, and the present as hours/minutes per day. Maybe open/closed isn’t a format we can use for this measurement?
It’s funny, I don’t think this works on a binary_sensor that is defined in ESPHome. I posted here showing what I put together.
I copied the example right out of the History_Stats example and changed the sensor name to my binary_sensor in the ESPHome device. The sensor shows up fine, but the history stats does not work on it. I’m hoping someone can confirm it doesn’t work or tell me what is wrong.