Closed bartkummel closed 4 months ago
Thanks for the long investigation!
It would be a good idea to document the format the script option expects.
It would furthermore be great to make the parsing work for all languages. The idea behind the script
option is to parse the automatically generated delay step names so that the timer duration stays in sync with the script.
Is the format generally ..... 0:00:30
?
In Dutch it says Vertraging voor 10:00
. Note, though, that hours are stripped if they are zero and if it is below a minute, only the seconds will be shown:
Vertraging voor 1:10:00
;Vertraging voor 10:00
;Vertraging voor 10 seconds
. (Note that "seconds" is in English here, I don't know if that holds for all languages, or that it is an error in the Dutch translation.)All in all, parsing the title of the delay doesn't seem like the most reliable solution to me...
All in all, parsing the title of the delay doesn't seem like the most reliable solution to me...
Unfortunately, it's the best I can do without writing a lot of code to query the Home Assistant API for this information. I'll stick a note in the README about the action name and change the parsing to only look for the time at the end.
Describe the bug As you properly describe in the documentation, the
duration: script
option relies on the name of the delay step in the script. This does not work if the language of the Home Assistant UI is set to something other than English. By searching through the code and some trial and error, I found out that it works if the delay step is nameddelay 0:00:30
for a delay of 30 seconds.I think the least you should do is describe the format you expect, so we can manually rename our delay steps, even if we have a different language set.
Your card configuration
Debug information
Note that it works correctly now, since I've figured out the right format and manually renamed the delay step of the script.