Hi,
I need to make a sensor that gives me the history stats for how long my aircondition is on for the current year. I made some attempts (the last is the below) but can not figure it out.
Can someone help?
- platform: history_stats
name: AirCon Living Room time on
entity_id: binary_sensor.conditioner_on
state: 'on'
type: time
#end: '{{ now() }}'
#end: '{{ now().replace(hour=0, minute=0, second=0) }}'
end: '{{ now().year }}'
duration:
days: 365
I haven’t looked at your start and end templates yet because I suspect there is a bigger problem. Do you actually keep a year’s worth of data in your recorder?
Thanks a lot. I had already tried what petro suggested, and I am not sure that this is what I want. for example next November I would like to see the time the aircondition was on for the 2021. If I understand correct this sensor will show me the time from October 2020 until November 2021.
However Tom is correct because either I have to keep records for a year in recorder which I am not.
It will show you time from 11/30/2019 to 11/30/2020, not sure where you’re getting October from or the year 2021 because this integration only looks in the past. You have a miss understanding on how this integration works.