First, the feature request, which I believe is pretty trivial: can we add the initial duration loaded from yaml to the timer attributes? E.g., intiial_duration from yaml would be 00:30:00 and would be unaffected by changes to timer start time, etc.
Then, a little context: I wrote a quick AppDaemon app to make timers persist across HA restarts. One of the consequences, however, of changing the timer duration after boot (to continue the timer) is that the initial duration specified in yaml gets lost. Most of my timers–e.g., “bathroom light off after 30 minutes,” rely on that initial duration for future runs. Historically, that was easy; the duration goes in configuration.yaml and I just start the timer with no duration specified. But if I use my persistence script, that duration gets lost if a timer was running at restart, meaning I need to code the desired duration into ever place that starts a persistent timer or build some code to automatically do that. It seems simpler to just make that information permanently available.
I can think of a few ways to solve this, including:
- a per-timer option to not store the new duration on timer.start
- an option to start the timer with the original duration without exposing it as an attribute
I honestly think all of these would be helpful, and none are breaking changes. I’m also aware there is an open PR for internal timer persistence in HA; that would be great! But the attribute still seems useful and seemed like the easiest way to implement it.
Many thanks!
-puk
p.s. Any good links for getting a local build of HA going? I’m currently running Hassio on RPi4, and I’m happy to implement this myself and make a PR, but I’m relatively new to docker and haven’t gotten over the the hump of getting a dev environment up and replacing my production environment.