I am running Home Assistant version 0.110.5 on a RP4.
I am trying to set a timer based on a sensor crated from my alexa integration. I was able to sort out how to get it in the right format (hh:mm:ss) but it will not let me set the timer with the variable.
"{{(as_timestamp(states('sensor.office_echo_dot_next_timer')) - as_timestamp(now())) | timestamp_custom('%H:%M:%S', 0)}}"
evaluates to
“00:04:07”
But when I try to use it to set duration I get an error that it is not in the right format. I set up a sensor to store the variable thinking maybe that was causing the problem but I still get the same error.
time_left_alexa_timer2:
value_template: >-
{% if is_state("sensor.office_echo_dot_next_timer", "unavailable") %}
None
{% else %}
{{ (as_timestamp(states('sensor.office_echo_dot_next_timer')) - as_timestamp(now())) | timestamp_custom("%H:%M:%S", 0) }}
{% endif %}
When I use the below it still does not work.
- data:
duration: '{{ states("sensor.time_left_alexa_timer2") }}'
entity_id: timer.alexatimer
service: timer.start
Any thoughts?