Hi!
I have an input_datetime helper for my wake up alarm. Currently I have a hard coded value for the number of seconds to add to the datetime to serve as a grace period for some of my automations. This works well, but I would like the number of added seconds to be dynamic based on the value of an helper instead of being static. I would also like it to be in minutes instead of seconds.
This is the working code I have today (static value 7200):
service: input_datetime.set_datetime
data:
time: >-
{{(((state_attr('input_datetime.alarm' , 'timestamp')) + 7200) |
timestamp_custom('%H:%M', false))}}
target:
entity_id: input_datetime.alarmtillegg
I’ve replaced the static number with an new input_number.alarmtilleggstid helper in the template like so:
{{(((state_attr('input_datetime.alarm' , 'timestamp')) + (states('input_number.alarmtilleggstid')) |
timestamp_custom('%H:%M', false )))}}
But the template fails:
ValueError: Template error: timestamp_custom got invalid input '6000.0' when rendering template '{{(((state_attr('input_datetime.alarm' , 'timestamp')) + (states('input_number.alarmtilleggstid')) | timestamp_custom('%H:%M', false )))}}' but no default was specified
Would greatly appreciate any help to get futher with this!