helper template… go to settings → devices & services → helpers.
hit the button in the bottom right (create helper)
choose template. (screenshot 1)
choose binary sensor (screenshot 2)
helper template… go to settings → devices & services → helpers.
hit the button in the bottom right (create helper)
choose template. (screenshot 1)
choose binary sensor (screenshot 2)
This is the one for my master bedroom. I created a timer of 20 minutes and I use a physical button press for this one. I have another one for my kitchen that also uses an input_boolean as a switch from the HA dashboard/Alexa voice routine. Those are just additional triggers in the automation. But this one is only 3 triggers and the best part there is no “remembering” to toggle the input_boolean back. It runs itself easily.
The flow is basically:
switch_on
)switch_off
)timer_off
)alias: "Lighting: Master Bedroom Lights Override"
description: ""
trigger:
- platform: state
entity_id:
- timer.master_bedroom_switch_timer
from: active
to: idle
id: timer_off
- platform: state
entity_id:
- switch.master_bedroom_light_switch_bottom
from: "off"
to: "on"
id: switch_on
- platform: state
entity_id:
- switch.master_bedroom_light_switch_bottom
from: "on"
to: "off"
id: switch_off
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- switch_on
sequence:
- service: scene.turn_on
metadata: {}
target:
entity_id: scene.master_bedroom_full_brightness
- alias: Start the timer
service: timer.start
metadata: {}
data: {}
target:
entity_id:
- timer.master_bedroom_switch_timer
- alias: Turn off automations
service: automation.turn_off
metadata: {}
data:
stop_actions: true
target:
entity_id: automation.lighting_master_bedroom_lights_on
- alias: Speak the thing...
service: script.generate_message_to_speaker
metadata: {}
data:
title: Master Bedroom Lights Override Active
prompt: >-
Create a short announcement about that the master bedroom lights
are remaining on for 20 minutes. It should be in the style of
Star Wars. The announcement should be about 20 to 30 words long.
devices:
- media_player.master_bedroom_show
- conditions:
- condition: trigger
id:
- switch_off
sequence:
- alias: Cancel the timer
service: timer.cancel
metadata: {}
data: {}
target:
entity_id:
- timer.master_bedroom_switch_timer
- conditions:
- condition: trigger
id:
- timer_off
sequence:
- alias: Turn on automations
service: automation.turn_on
data: {}
target:
entity_id: automation.lighting_master_bedroom_lights_on
- alias: Tune off the lights unless there is motion
if:
- condition: state
entity_id: binary_sensor.master_bedroom_motion_sensor_occupancy
state: "on"
for:
hours: 0
minutes: 0
seconds: 0
then:
- service: script.turn_on_lights_by_mode
metadata: {}
data:
area: master_bedroom
else:
- service: scene.turn_on
metadata: {}
target:
entity_id: scene.master_bedroom_off
- alias: Speak the thing...
service: script.generate_message_to_speaker
metadata: {}
data:
title: Master Bedroom Lights Override Deactivated
prompt: >-
Create a short announcement about that the master bedroom lights
have returned to their normal operations. It should be in the
style of Star Wars. The announcement should be about 30 words
long.
devices:
- media_player.master_bedroom_show
- service: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.master_bedroom_light_switch_bottom
alias: Turn off the switch
mode: restart
awesome!I will look into this as well. thank you!
I was able to get it working. Thank you very much for the help. Again, all answers are valid here.