plbartie
(Plbartie)
1
I have 2 lights switched on 24hrs a day.
I would like to switch off 2 lights for a brief period of time, x amount of minutes, and then a slider to set X amount of minutes. Please help.
I have searched and tried so adjusting so many similar timer guides but they all different in some way or form and can not get anything to work.
Something similar to this maybe?
I see you basically already made the helpers. Now just make two automations.
Goto sleep
alias: Goto sleep
description: ''
mode: single
trigger:
- platform: state
entity_id: input_boolean.sleep
to: 'on'
condition: []
action:
- service: light.turn_off
target:
entity_id:
- light.light1
- light.light2
- service: timer.start
target:
entity_id: timer.sleep
data:
duration: "{{ states('input_number.sleep')|int * 60}}"
And to restore
alias: Wake up
description: ''
mode: single
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.sleep
- platform: state
entity_id: input_boolean.sleep
to: 'off'
condition: []
action:
- service: light.turn_on
target:
entity_id:
- light.light1
- light.light2
- service: input_boolean.turn_off
target:
entity_id: input_boolean.sleep
- service: timer.cancel
target:
entity_id: timer.sleep
plbartie
(Plbartie)
3
Thank you so much for the reply. I appreciate your help.
This image was just an image I found online. So nothings been set up yet.
How would I go about setting the helpers up?
Just in the UI via Configuration => Helpers.
input_boolean => Toggle
input_number => Number
timer => Timer
The automation expects the number to be whole minutes. Pick the range you like.
plbartie
(Plbartie)
5
Thank you so much @septillion
All is working 100%. Much appreciated