Hi, prob a silly one, but I can’t figure out what’s causing it.
I have a sensor type history_stat
- platform: history_stats
name: Boiler Time Elapsed
entity_id: switch.boiler
state: 'on'
type: time
start: '{{ as_timestamp(states.automation.is_the_boiler_on.attributes.last_triggered) }}'
end: '{{ now() }}'
Which will generate a sensor.boiler_time_elapsed. But by some reason it add to the DB with the “m” at the value… See screenshot.
I then have a template to make it “pretty” but I wanted to make it as minutes, so unit_of_measurement: “min” but instead its adding min to the m…
The template:
platform: template
sensors:
time_elapsed:
friendly_name: "Boiler Time Running"
value_template: '{{ states.sensor.boiler_time_elapsed.attributes.value }}'
unit_of_measurement: "min"
icon_template: >-
{% if is_state('switch.timed_boiler', 'on') %}
mdi:timer
{% else %}
mdi:timer-off
{% endif %}
Which results in this:
Any ideas, what I’m doing wrong?
Thanks for the help.