Loki81
April 5, 2022, 7:18pm
1
Hello,
I would like to calculate the daily runtime of my underfloor heating.
The state of the heating changes from the attribute
hvac_action: idle
to
hvac_action: heating
How can I count the time the heating is on and how can I visualize this?
Thanks for your help
1 Like
platform template
- platform: template
sensors:
heating_on_off:
value_template: "{{ state_attr('climate.underfloor_heating','hvac_action')}}"
value template âidleâ or âheatingâ
platform history stats
- platform: history_stats
name: Heating Time
entity_id: heating_on_off
state: "heating"
type: time
start: "{{ now().replace(hour=0, minute=0) }}"
end: "{{ now() }}"
1 Like
Loki81
April 6, 2022, 5:21pm
4
Thank you for the detailed answer!
I have implemented it this way, unfortunately it does not work yet.
- platform: template
sensors:
heating_on_off:
value_template: "{{ state_attr('climate.smart_thermostat','hvac_action')}}"
- platform: history_stats
name: Heating Time
entity_id: template.heating_on_off
state: "heating"
type: time
start: "{{ now().replace(hour=0, minute=0) }}"
end: "{{ now() }}"
I just changed the following:
entity_id: heating_on_off
against
entity_id: template.heating_on_off
because I got an error during validation. (Invalid config for [sensor.history_stats]: Entity ID heating_on_off is an invalid entity ID for dictionary value @ data[âentity_idâ]. Got âheating_on_offâ. (See ?, line ?). )
Was that correct?
The sensor heating_on_off works great.
Only the sensor heating_time still returns an âunknownâ.
Where is my error?
Loki81
April 6, 2022, 5:31pm
5
Got it
correct is
entity_id: sensor.heating_on_off
This is how it works. Thank youâŚ
Loki81
April 6, 2022, 5:42pm
6
Can I also do a monthly evaluation for this sensor? So that I see a bar chart or similar of the last 30 days?
nickrout
(Nick Rout)
April 6, 2022, 9:12pm
7
Last 30 days is in the docs.
Loki81
April 7, 2022, 7:40am
8
Yes, but that is not what I want.
In the docs it says how I calculate a value of the last 30 days. But I want to compare the daily values for 30 days.