#Add timer to aircon to turn off. Script trigger, but automation?

1 messages · Page 1 of 1 (latest)

uncut anchor
#

I'm trying to add in a timer field that can count down if enabled, but only if enabled, and when it's done, the action is to turn off the air con. Sounds simple in theory, but I can't get it to play nice. My theory is I have a toggle button to "enable" timer, and a text field below that you say how long. If the aircon is turned on, and the enabled toggle is ...enabled, then that is a trigger that calls a counter based on the variable of that field (issue #1, can't get the counter to read and use that field). Once that's done, it's a trigger in itself that calls an action that turns the aircon off. (issue #2, where do i have that trigger set, a separate automation, but how do i tell it when counter runs to zero, and not just IS zero?)

I'm sure it's going to be a mix of script and automation for some reason but i also feel like i'm over complicating it. Please help?

median yacht
#

You can consider 2 options:

  • A timer entity where you can set the duration, start and stop it with buttons on a dashboard, and trigger an automation upon the timer finishing its countdown
  • An input_datetime where you just set the end time from the dashboard, and trigger an automation when the time is equal to the state of the input_datetime
uncut anchor