Hello everyone, I have a Nest thermostat connected to my gas boiler, I have integrated the nest under HA but I have a problem, I would like to create a sensor to know how long the boiler is running per day and put after this in the form of a graph.
So I created these sensors in my sensor.yaml but it doesn’t want to work.
I don’t understand because in the models it works, but when I check the configuration it gives me an error…
- platform: template
sensors:
Nest Preset Mode:
unique_id: nest_preset_mode
state: "{{ state_attr('climate.salon','preset_mode') }}"
attribute_templates:
none: "{% if (state_attr('climate.salon','preset_mode') == 'none') %} ✔ {% else %} {% endif %}"
eco: "{% if (state_attr('climate.salon','preset_mode') == 'eco') %} ✔ {% else %} {% endif %}"
- platform: template
sensors:
Nest Heating Runtime:
unit_of_measurement: 'seconds'
state: "{{state_attr('climate.salon','elapsed_seconds')|float(0) }}"
I also tried this to no avail…
- platform: template
sensors:
Nest Preset Mode:
unique_id: nest_preset_mode
state: "{{ state_attr('climate.salon','preset_mode') }}"
value_template:
none: "{% if (state_attr('climate.salon','preset_mode') == 'none') %} ✔ {% else %} {% endif %}"
eco: "{% if (state_attr('climate.salon','preset_mode') == 'eco') %} ✔ {% else %} {% endif %}"
- platform: template
sensors:
Nest Heating Runtime:
unit_of_measurement: 'seconds'
value_template: "{{state_attr('climate.salon','elapsed_seconds')|float(0) }}"
Configuration non valide !
Invalid config for [sensor.template]: invalid slug Nest Heating Runtime (try nest_heating_runtime) for dictionary value @ data[‹ sensors ›]. Got OrderedDict([(‹ Nest Heating Runtime ›, OrderedDict([(‹ unit_of_measurement ›, ‹ seconds ›), (‹ value_template ›, « {{state_attr(‹ climate.salon ›,‹ elapsed_seconds ›)|float(0) }} »)]))]). (See ?, line ?).