Hello,
hope i´m right and the topic is ok:
I´m using this template for my remaining time from my washer sensor as a TTS message:
{% set ct = states('sensor.waschmaschine_washer_completion_time') |
as_datetime %}
{{ 'Gerät ist ausgeschaltet' if now() > ct
else
(ct - now()).total_seconds() | timestamp_custom('Die Waschmaschine ist in %-H
Stunden und %-M Minuten fertig.', false) }}
It works, but i need something like that:
if (ct - now()).total_seconds() < 2-H| timestamp_custom('Die Waschmaschine ist in %-H Stunde und %-M Minuten fertig.', false) }}
if (ct - now()).total_seconds() < 1-H| timestamp_custom('Die Waschmaschine ist in %-M Minuten fertig.', false) }}
If its under 2 hours the template will show “Stunde” instead “Stunden” and if its unter 1 hour only the minutes should shown.
Can somebody help me with it?