Hi,
I am new to Home Assistant but so far think it is a brilliant tool with great community support.
I have an Evohome heating system that I have managed to integrate without too much problems.
However, I now want to get a sensor that shows the total time that the heating has been on.
So far I am attempting to do this through grouping all the individual room heating controls in to one group.
I have then tried to use a history stats template to see how long the overall has been on.
template:
- binary_sensor:
- name: LivingRoom
state: >
{% if state_attr('climate.living_room','current_temperature')<state_attr('climate.living_room','temperature') %}
On
{% else %}
Off
{% endif %}
- name: Bathroom
state: >
{% if state_attr('climate.Bathroom','current_temperature')<state_attr('climate.Bathroom','temperature') %}
On
{% else %}
Off
{% endif %}
- name: Kitchen
state: >
{% if state_attr('climate.Kitchen','current_temperature')<state_attr('climate.Kitchen','temperature') %}
On
{% else %}
Off
{% endif %}
- name: MainBedroom
state: >
{% if state_attr('climate.lorcan','current_temperature')<state_attr('climate.lorcan','temperature') %}
On
{% else %}
Off
{% endif %}
- name: Oisin
state: >
{% if state_attr('climate.oisin','current_temperature')<state_attr('climate.oisin','temperature') %}
On
{% else %}
Off
{% endif %}
- name: Fiadh
state: >
{% if state_attr('climate.fiadh','current_temperature')<state_attr('climate.fiadh','temperature') %}
On
{% else %}
Off
{% endif %}
- name: Office
state: >
{% if state_attr('climate.guest_bedroo','current_temperature')<state_attr('climate.guest_bedroo','temperature') %}
On
{% else %}
Off
{% endif %}
sensor:
- platform: history_stats
name: Heating Time
entity_id: binary_sensor.heatingonoff
state: "On"
type: time
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now() }}"
I know it is probably something very stupid that I am doing but spent the last few days trying to figure out how to get this working.