This does not work as Failed to call service timer/start. offset {{ states('input_number.roaster_time_second_crack')|int|timestamp_custom('00:%M:%S') }} should be format 'HH:MM' or 'HH:MM:SS' for dictionary value @ data['duration'].
I checked in the template debugger that {{ states('input_number.roaster_time_second_crack')|int|timestamp_custom('00:%M:%S') }} produces 00:02:20, and in fact I use this approach for automation’s “for” trigger, it is only this button which does not like templates, why is that? I could probably avoid timers, trying to get my head around it… Thanks,
Just tried, the same error. And how can it work at all as states('input_number.roaster_time_second_crack')|int produces 120 which is not “HH:MM” nor “HH:MM:SS”?
It should work because duration take a timestamped input or seconds as value. But there is something else going on here.
Are you always formatting your template data as follows?
I entered it manually in the YAML editor as a single line, saved, then opened again in the YAML editor - and it appeared then multiline. So I’d say it does not matter. I am pretty sure that piece just does not handle templates as this control supports very different actions and probably some special syntax is needed.
The docs don’t state that tap_action is templateable. If it were, you’d need to use service_template (ref), and there’s no mention of service_template in the frontend source.
Perhaps make the button run a script, and have the template in the script?
Never wrote a script, a new can of worms. Opened https://www.home-assistant.io/integrations/script , wrote my script, got error on mode: single, juuuust lovely It is single by default so no big deal but the doc is out of sync.