I have a template sensor, that tells me how long my washing machine is running. Or rather I had until 0.115 changed templates. I read the breaking changes and the new part in the template sensor docs about the dummy with states.time. The template renders fine in the developer tools but the sensor stays at zero. What am I missing?
platform: template
sensors:
laufzeit_waschmaschine:
# entity_id: sensor.waschmaschine_leistung_average
value_template: >-
{% set dummy = states("sensor.time") %}
Die Waschmaschine {% if is_state("binary_sensor.waschmaschine", "on") -%}
läuft {% set zeit = (as_timestamp(now())-as_timestamp(states.binary_sensor.waschmaschine.last_updated)) / 60 %}
{% if zeit < 60 -%}
seit {{zeit | int}} Minuten.
{%- else -%}
seit {{ ( zeit / 60 ) | int }} Stunden, {{ ( zeit - ( ( zeit / 60 ) | int ) * 60 ) | int }} Minuten.
{%- endif %}
{%- else -%}
ist aus.
{%- endif %}
Edit:
to clearify: in the developer tools it renders as
Die Waschmaschine läuft
seit 19 Minuten.
but the sensor value stays at
Die Waschmaschine läuft
seit 0 Minuten.