Hi folks, few months I did a similar setup for my Hive thermostat. To track how long the heating downstairs/upstairs is running is easy, although, the lecture is tricky depending how I show the sensors:
‘/homeassistant/template.yaml’
## HVAC sensors
- sensor:
- name: HVAC Downstairs
state: "{{ state_attr('climate.downstairs', 'hvac_action') }}"
- sensor:
- name: HVAC Upstairs
state: "{{ state_attr('climate.upstairs', 'hvac_action') }}"
- sensor:
- name: HVAC Water
state: "{{ state_attr('water_heater.downstairs', 'hvac_action') }}"
‘/homeassistant/sensor.yaml’
## HVAC sensors
- platform: history_stats
name: Thermostat Heating Today Downstairs
entity_id: sensor.hvac_downstairs
state: 'heating'
type: time
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now() }}"
- platform: history_stats
name: Thermostat Heating Today Upstairs
entity_id: sensor.hvac_upstairs
state: 'heating'
type: time
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now() }}"
- platform: history_stats
name: Heating Today Water
entity_id: sensor.hvac_water
state: 'heating'
type: time
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now() }}"
Duration of the heating is correct and accurate, now if i want to keep a record of the last week, I use “custom:mini-graph-card”
type: custom:mini-graph-card
name: Downstairs + Attic
icon: mdi:radiator
entities:
- entity: sensor.thermostat_heating_today_downstairs
show_state: true
color: purple
hours_to_show: 168
lower_bound: 0
group_by: date
hour24: true
aggregate_func: max
show:
labels: true
graph: bar
average: true
extrema: true
Here, when the sensor is read in ‘custom:mini-graph-card’ the time is not represented correctly . For instance, in the first picture attached, Thermostat Heating Today Downstairs 1:56:24 the same sensor read by ‘custom:mini-graph-card’ shows 1.94h. It corresponds to the same amount of time, just different format.
Am I doing something wrong in my code?
If I represent the data with a different card, the representation is wrong as well. Surely, I’m missing something on my code.
header:
title: Heating en marcha
show: true
show_states: true
type: custom:apexcharts-card
chart_type: donut
experimental:
color_threshold: true
series:
- entity: sensor.thermostat_heating_today_downstairs
name: Abajo
color: rgb(154,205,50)
color_threshold:
- value: 0
color: yellowgreen
float_precision: 3
- entity: sensor.thermostat_heating_today_upstairs
name: Arriba
color: rgb(250,0,0)
color_threshold:
- value: 0
color: red
float_precision: 3
apex_config:
tooltip:
x:
show: true
format: HH:mm
Related to this Thermostat, I am unable to track the duration for the hot water. I start to think is a limitation from Hive, as they don’t show this information on the native app. As you can see in the code, I use similar approach for getting this data, but its always shows 0.
Does anybody try to read the duration of the heating water on Hive?