Hello All,
I’m trying to get active (heating) time for my water-boiler. I defined a binary_sensor which is ON when water-boiler power consumption is above 10W, which works perfectly fine: today I get 110mn 3sec looking at historical data of this sensor.
Now I try to calculate the total duration with a template sensor, and I get 1.48 hours which is about 88,8 minutes. I should have 1.83 hours for 110 minutes.
I’ve read the doc and lot’s of related topics but can’t find what I’m doing wrong.
Thanks for your help.
Here is my code and informations.
Binary sensor definition
binary_sensor:
- platform: template
sensors:
ecs_en_chauffe:
unique_id: ecs_en_chauffe
value_template: >
{{ states('sensor.powr3_ecs_energy_power')|float(0) >= 10 }}
Template sensor definition
sensor:
- platform: history_stats
name: "ECS Temps de chauffe Quotidien"
entity_id: binary_sensor.ecs_en_chauffe
state: "on"
type: time
start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
end: '{{ now() }}'
Binary sensor activation time screenshot
Developper tool view