Things that are realy hard now:
- Trigger an automation X minutes before a timer ends.
- Have a condition that checks whether there are atleast/atmost X minutes to go for a timer.
- Ensure there are atleast/atmost X minutes remaining on the timer.
- Add/remove X minutes to a timer.
Trigger an automation X minutes before a timer ends.
Turn 3 lights off after an hour, but not all at the same time, so we’re not in the dark suddenly.
Now I have to start a timer which runs for 60 minutes, and another that runs for 65 and another that runs for 70 minutes; or have a timer for 60 minutes and two for 5 minutes, either way; you need 3 timers for a single timed event.
Have a condition that checks whether there are atleast/atmost X minutes to go for a timer.
User presses a button: thing happens, unless the timer is almost up, then we want another thing to happen.
Ensure there are atleast/atmost X minutes remaining on the timer.
Open a door: light turns on for 1 minute, press a button light turns on for 5 minutes. Open a door while the 5 minute timer is running: light shouldn’t go out after just 1 minute.
Add/remove X minutes to a timer.
Press a button: light goes on for 5 minutes, wait a minute (4 minutes to go), press the button again, light stays on for 9 minutes.
Edit:
Proposal
Add new services for timers:
timer.add
/ timer.subtract
action:
- service: timer.add
entity_id: timer.my_timer
data:
duration: "00:05:00"
Would add or subtract 5 minutes to/from the timer. Alternatively only add the timer.add
service and have it support negative values.
timer.atleast
/ timer.atmost
action:
- service: timer.atleast / timer.atmost
entity_id: timer.my_timer
data:
duration: "00:05:00"
Would set the timer to atleast or at most the specified duration.
Add a timer condition, like the numeric_state conditions.
Condition passes if there is atleast 5 minutes remaining:
condition:
- condition: timer
entity_id: timer.my_timer
atleast: "00:05:00"
Condition passes if there is atmost 5 minutes remaining:
condition:
- condition: timer
entity_id: timer.my_timer
atmost: "00:05:00"
atleast
and atmost
would support the same values as for
in the state platform, so a time-string, a number of seconds or a hours/minutes/seconds object.
For consistency we may want to shadow the state condition to the timer condition too:
condition:
- condition: timer
entity_id: timer.my_timer
state: idle | active | paused
Make the timer into a proper trigger platform in stead of having to use the event platform:
trigger:
platform: timer
entity_id: timer.my_timer
state: started | paused | finished | cancelled | restarted
Would be analogous to
trigger:
platform: event
event_type: timer.started
event_data:
entity_id: timer.my_timer
And this would add the new functionality:
This would trigger when the timer has 10 minutes remaining:
trigger:
platform: timer
entity_id: timer.my_timer
remaining: "00:10:00"
This would trigger when the timer has been running for 10 minutes.
trigger:
platform: timer
entity_id: timer.my_timer
elapsed: "00:10:00"
remaining
and elapsed
would support the same values as for
in the state platform, so a time-string, a number of seconds or a hours/minutes/seconds object.