Improved handling of bedroom lights when going to bed
This commit is contained in:
43
scripts.yaml
43
scripts.yaml
@ -311,10 +311,30 @@ going_upstairs:
|
|||||||
target:
|
target:
|
||||||
entity_id: input_datetime.tony_night_meds_notify
|
entity_id: input_datetime.tony_night_meds_notify
|
||||||
alias: Schedule the night meds notification
|
alias: Schedule the night meds notification
|
||||||
- wait_template: '{{ is_state(''binary_sensor.upstairs_bathroom_occupied'',''on'')
|
- wait_for_trigger:
|
||||||
or is_state(''input_boolean.goodnight'',''on'') }}'
|
- platform: state
|
||||||
timeout: '{{ wait.remaining }}'
|
entity_id:
|
||||||
alias: Wait until I'm in the bathroom or in bed
|
- binary_sensor.upstairs_bathroom_motion
|
||||||
|
to: 'on'
|
||||||
|
id: bathroom
|
||||||
|
- platform: state
|
||||||
|
entity_id:
|
||||||
|
- input_boolean.goodnight
|
||||||
|
to: 'on'
|
||||||
|
id: goodnight
|
||||||
|
- platform: state
|
||||||
|
entity_id:
|
||||||
|
- light.master_bedroom_lights
|
||||||
|
to: 'on'
|
||||||
|
id: lights
|
||||||
|
continue_on_timeout: false
|
||||||
|
timeout:
|
||||||
|
hours: 0
|
||||||
|
minutes: 20
|
||||||
|
seconds: 0
|
||||||
|
milliseconds: 0
|
||||||
|
alias: Wait until I am in the bathroom, or in bed, or the lights are manually
|
||||||
|
turned on
|
||||||
- if:
|
- if:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.goodnight
|
entity_id: input_boolean.goodnight
|
||||||
@ -326,6 +346,21 @@ going_upstairs:
|
|||||||
target:
|
target:
|
||||||
entity_id: input_select.master_bedroom_scenes
|
entity_id: input_select.master_bedroom_scenes
|
||||||
alias: Turn on dim lighting in master bedroom, unless I am in bed
|
alias: Turn on dim lighting in master bedroom, unless I am in bed
|
||||||
|
- choose:
|
||||||
|
- conditions: '{{ wait.trigger.id == ''bathroom'' }}'
|
||||||
|
sequence:
|
||||||
|
- service: input_select.select_option
|
||||||
|
data:
|
||||||
|
option: Side Nightlight
|
||||||
|
target:
|
||||||
|
entity_id: input_select.master_bedroom_scenes
|
||||||
|
- conditions: '{{ wait.trigger.id in [''lights'',''goodnight''] }}'
|
||||||
|
sequence:
|
||||||
|
- variables:
|
||||||
|
stop_reason: '{{ wait.trigger.id }}'
|
||||||
|
- stop: Bedroom lighting not needed
|
||||||
|
response_variable: stop_reason
|
||||||
|
alias: Turn on lights, or not
|
||||||
mode: single
|
mode: single
|
||||||
icon: hue:room-stairs
|
icon: hue:room-stairs
|
||||||
start_youtube_basement:
|
start_youtube_basement:
|
||||||
|
Reference in New Issue
Block a user