3605 lines
104 KiB
YAML
3605 lines
104 KiB
YAML
give_me_darkness:
|
|
alias: Give Me Darkness
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.give_me_darkness
|
|
alias: Turn on input boolean
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 1
|
|
milliseconds: 0
|
|
- service: script.volume_reset
|
|
data: {}
|
|
- service: script.evening_on_first_floor
|
|
data:
|
|
give_me_darkness: 1
|
|
- service: script.evening_on_second_floor
|
|
data: {}
|
|
- service: mqtt.publish
|
|
data:
|
|
qos: '2'
|
|
retain: true
|
|
topic: house/time/give_me_darkness
|
|
payload: 'on'
|
|
- alias: Security decision
|
|
if:
|
|
- condition: and
|
|
conditions:
|
|
- condition: state
|
|
entity_id: person.tony_stork
|
|
state: home
|
|
- condition: state
|
|
entity_id: person.christina_stork
|
|
state: home
|
|
- condition: state
|
|
entity_id: input_boolean.guest_mode
|
|
state: 'off'
|
|
- condition: state
|
|
entity_id: alarm_control_panel.nerdhome_alarm_panel
|
|
state: disarmed
|
|
alias: Both adults are home, guest mode off, security disarmed
|
|
then:
|
|
- alias: Auto or manual trigger?
|
|
if:
|
|
- condition: template
|
|
value_template: '{{ auto == 1 }}'
|
|
alias: Triggered by automation
|
|
then:
|
|
- service: alarm_control_panel.alarm_arm_home
|
|
data: {}
|
|
target:
|
|
entity_id: alarm_control_panel.nerdhome_alarm_panel
|
|
alias: Arm security
|
|
else:
|
|
- service: script.activate_alexa_actionable_notification
|
|
data:
|
|
text: <voice name='Joanna'><prosody rate='150%'>Would you like me to arm
|
|
the security system?</prosody></voice>
|
|
event_id: actionable_notification_night_security_arm
|
|
alexa_device: media_player.living_room_echo_dot
|
|
alias: Ask to arm security
|
|
mode: single
|
|
icon: mdi:weather-night
|
|
alexa_tts_test:
|
|
alias: Alexa TTS Test
|
|
sequence:
|
|
- service: notify.alexa_media
|
|
data:
|
|
data:
|
|
method: all
|
|
type: announce
|
|
target: Living Room Echo Dot
|
|
message: I farted
|
|
mode: single
|
|
icon: mdi:test-tube
|
|
kallen_timer_cancel:
|
|
sequence:
|
|
- service: timer.cancel
|
|
target:
|
|
entity_id: timer.kallen_timer
|
|
mode: single
|
|
alias: Kallen Timer - Cancel
|
|
icon: mdi:cancel
|
|
global_off:
|
|
alias: Global Off
|
|
sequence:
|
|
- data: {}
|
|
target:
|
|
entity_id: all
|
|
action: light.turn_off
|
|
- data: {}
|
|
target:
|
|
entity_id: all
|
|
action: fan.turn_off
|
|
mode: single
|
|
icon: mdi:earth-off
|
|
global_on:
|
|
alias: Global On
|
|
sequence:
|
|
- service: light.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id: all
|
|
mode: single
|
|
icon: mdi:earth
|
|
max_brightness:
|
|
sequence:
|
|
- alias: Turn off Adaptive Lighting and Motion Lighting
|
|
data: {}
|
|
target:
|
|
label_id:
|
|
- adaptive_lighting
|
|
- motion_lighting
|
|
action: switch.turn_off
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 1
|
|
milliseconds: 0
|
|
- alias: Cancel motion timers
|
|
data: {}
|
|
target:
|
|
label_id: motion_lighting
|
|
action: timer.cancel
|
|
- data: {}
|
|
target:
|
|
entity_id: input_boolean.front_porch_light_on
|
|
alias: Turn off Front Porch automation
|
|
action: input_boolean.turn_off
|
|
- data:
|
|
kelvin: 5000
|
|
brightness_pct: 100
|
|
target:
|
|
entity_id: all
|
|
alias: Turn on ALL LIGHTS to maximum brightness
|
|
action: light.turn_on
|
|
mode: single
|
|
alias: Max Brightness
|
|
icon: mdi:brightness-7
|
|
going_upstairs:
|
|
alias: Going Upstairs
|
|
sequence:
|
|
- data:
|
|
qos: '2'
|
|
retain: true
|
|
topic: house/time/night_mode
|
|
payload: 'on'
|
|
alias: Tell MQTT that it is night mode now
|
|
action: mqtt.publish
|
|
- data:
|
|
option: Adaptive
|
|
target:
|
|
entity_id:
|
|
- input_select.basement_studio_scenes
|
|
- input_select.tina_lamp_scenes
|
|
- input_select.mud_room_scenes
|
|
- input_select.living_room_scenes
|
|
alias: Set scenes
|
|
action: input_select.select_option
|
|
- entity_id: input_boolean.night_mode
|
|
alias: Turn on Night Mode
|
|
action: input_boolean.turn_on
|
|
- alias: Turn off Studio Quiet and Gaming Mode
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- input_boolean.studio_quiet
|
|
- input_boolean.gaming_mode
|
|
action: input_boolean.turn_off
|
|
- alias: Thermostat reminder
|
|
if:
|
|
- alias: If triggered from basement
|
|
condition: state
|
|
entity_id: sensor.last_alexa_name
|
|
state: Basement Echo Dot
|
|
then:
|
|
- alias: Remind in basement
|
|
data:
|
|
who: basement
|
|
message: Remember to set the thermostat for the night
|
|
type: alert
|
|
action: script.speech_engine
|
|
else:
|
|
- alias: Remind in living room
|
|
data:
|
|
who: living_room
|
|
message: Remember to set the thermostat for the night
|
|
type: alert
|
|
action: script.speech_engine
|
|
enabled: false
|
|
- alias: Basement Studio Climate
|
|
if:
|
|
- condition: state
|
|
entity_id: input_boolean.basement_studio_heat_allowed
|
|
state: 'on'
|
|
alias: Heat Allowed
|
|
then:
|
|
- alias: Decide basement studio heater action
|
|
if:
|
|
- alias: If temp below freezing and heat is on
|
|
condition: and
|
|
conditions:
|
|
- condition: numeric_state
|
|
entity_id: weather.iron_nerd_weather_station
|
|
attribute: temperature
|
|
below: 32
|
|
alias: Temperature below freezing
|
|
- condition: state
|
|
entity_id: climate.basement_studio_vtherm
|
|
state: heat
|
|
alias: Heat on
|
|
then:
|
|
- action: climate.set_preset_mode
|
|
metadata: {}
|
|
data:
|
|
preset_mode: frost
|
|
target:
|
|
entity_id: climate.basement_studio_vtherm
|
|
alias: Set temp to lowest preset
|
|
else:
|
|
- alias: Turn basement studio heater off
|
|
action: climate.set_hvac_mode
|
|
metadata: {}
|
|
data:
|
|
hvac_mode: 'off'
|
|
target:
|
|
entity_id: climate.basement_studio_vtherm
|
|
- if:
|
|
- condition: not
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.basement_tv
|
|
state: playing
|
|
then:
|
|
- target:
|
|
entity_id: media_player.basement_tv
|
|
data: {}
|
|
action: media_player.turn_off
|
|
alias: Turn basement TV off, unless something is playing
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.kallen_computer_updates
|
|
state: 'off'
|
|
then:
|
|
- data: {}
|
|
alias: Shut down Kallen desktop
|
|
action: script.kallen_desktop_shutdown
|
|
alias: Shutdown Kallen Desktop, unless it is updating
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.last_alexa_name
|
|
state: Living Room Echo Dot
|
|
alias: If triggered from living room
|
|
sequence:
|
|
- data:
|
|
text: <voice name='Joanna'><prosody rate='150%'>Would you like me to shut
|
|
down your computer?</prosody></voice>
|
|
event_id: actionable_notification_shutdown_computer
|
|
alexa_device: media_player.living_room_echo_dot
|
|
response_variable: shutdown
|
|
alias: Ask in living room
|
|
action: script.activate_alexa_actionable_notification
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: sensor.last_alexa_name
|
|
state: Master Bedroom Echo Dot
|
|
alias: If triggered from master bedroom
|
|
sequence:
|
|
- data:
|
|
text: <voice name='Joanna'><prosody rate='150%'>Would you like me to shut
|
|
down your computer?</prosody></voice>
|
|
event_id: actionable_notification_shutdown_computer
|
|
alexa_device: media_player.master_bedroom_echo_dot
|
|
response_variable: shutdown
|
|
alias: Ask in master bedroom
|
|
action: script.activate_alexa_actionable_notification
|
|
default:
|
|
- data:
|
|
text: <voice name='Joanna'><prosody rate='150%'>Would you like me to shut
|
|
down your computer?</prosody></voice>
|
|
event_id: actionable_notification_shutdown_computer
|
|
alexa_device: media_player.basement_echo_dot
|
|
response_variable: shutdown
|
|
alias: Ask in basement
|
|
action: script.activate_alexa_actionable_notification
|
|
alias: Ask about shutting down main computer
|
|
- wait_for_trigger:
|
|
- entity_id:
|
|
- binary_sensor.basement_studio_door
|
|
from: 'off'
|
|
to: 'on'
|
|
id: door
|
|
trigger: state
|
|
- entity_id:
|
|
- input_boolean.goodnight
|
|
from: 'off'
|
|
to: 'on'
|
|
id: goodnight
|
|
trigger: state
|
|
- entity_id: light.master_bedroom_lights
|
|
to: 'on'
|
|
id: lights
|
|
trigger: state
|
|
timeout:
|
|
hours: 0
|
|
minutes: 30
|
|
seconds: 0
|
|
milliseconds: 0
|
|
alias: Figure out where I am
|
|
- data: {}
|
|
target:
|
|
entity_id: light.basement_studio_lights
|
|
alias: Turn off the lights
|
|
action: light.turn_off
|
|
- data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,2)
|
|
}}
|
|
|
|
'
|
|
target:
|
|
entity_id: input_datetime.tony_night_meds_notify
|
|
alias: Schedule the night meds notification
|
|
action: input_datetime.set_datetime
|
|
- if:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id in [''goodnight'',''lights''] }}'
|
|
then:
|
|
- data:
|
|
type: alert
|
|
who: tony
|
|
title: Basement Shutdown
|
|
message: Would you like me to shut down your computer?
|
|
tag: going-upstairs-pc-shutdown
|
|
actions:
|
|
- action: GU_PC_SHUTDOWN_YES
|
|
title: Shutdown
|
|
- action: GU_PC_SHUTDOWN_LOCK
|
|
title: Lock
|
|
- action: GU_PC_SHUTDOWN_NOTHING
|
|
title: Do Nothing
|
|
alias: Send an actionable notification
|
|
action: script.text_notify
|
|
- wait_for_trigger:
|
|
- event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: GU_PC_SHUTDOWN_YES
|
|
id: shutdown-yes
|
|
alias: Shutdown Yes
|
|
trigger: event
|
|
- event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: GU_PC_SHUTDOWN_LOCK
|
|
id: shutdown-lock
|
|
alias: Shutdown Lock
|
|
trigger: event
|
|
- event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: GU_PC_SHUTDOWN_NOTHING
|
|
alias: Shutdown Nothing
|
|
id: shutdown-nothing
|
|
trigger: event
|
|
timeout:
|
|
hours: 0
|
|
minutes: 20
|
|
seconds: 0
|
|
milliseconds: 0
|
|
alias: Wait for response to notification
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''shutdown-yes'' }}'
|
|
sequence:
|
|
- data: {}
|
|
action: script.tony_desktop_shutdown
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''shutdown-lock'' }}'
|
|
sequence:
|
|
- data: {}
|
|
action: script.tony_desktop_lock
|
|
alias: Run the desired action
|
|
- data:
|
|
type: alert
|
|
who: tony
|
|
message: clear_notification
|
|
tag: going-upstairs-pc-shutdown
|
|
alias: Clear the notification
|
|
action: script.text_notify
|
|
- stop: Automation steps skipped
|
|
alias: If I was not in the basement, ask about shutdown via text and then skip
|
|
the rest
|
|
- wait_for_trigger:
|
|
- entity_id:
|
|
- binary_sensor.upstairs_bathroom_motion
|
|
to: 'on'
|
|
id: bathroom
|
|
trigger: state
|
|
- entity_id:
|
|
- input_boolean.goodnight
|
|
to: 'on'
|
|
id: goodnight
|
|
trigger: state
|
|
- entity_id:
|
|
- light.master_bedroom_lights
|
|
to: 'on'
|
|
id: lights
|
|
trigger: state
|
|
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
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''bathroom'' }}'
|
|
sequence:
|
|
- data:
|
|
option: Side Nightlight
|
|
target:
|
|
entity_id: input_select.master_bedroom_scenes
|
|
action: input_select.select_option
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ 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
|
|
icon: hue:room-stairs
|
|
max_brightness_cleanup:
|
|
alias: Max Brightness Cleanup
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.front_porch_light_on
|
|
alias: Turn on Front Porch automation
|
|
- alias: Turn on Adaptive Lighting on front porch
|
|
service: switch.turn_on
|
|
target:
|
|
entity_id:
|
|
- switch.adaptive_lighting_front_porch
|
|
data: {}
|
|
- service: script.adaptive_on_first_floor
|
|
data: {}
|
|
alias: Adaptive on first floor
|
|
- service: script.adaptive_on_second_floor
|
|
data: {}
|
|
alias: Adaptive on second floor
|
|
- service: input_select.select_option
|
|
data:
|
|
option: Adaptive
|
|
target:
|
|
entity_id: input_select.basement_studio_scenes
|
|
alias: Set basement lights to adaptive
|
|
- service: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
label_id: motion_lighting
|
|
alias: Turn on motion lighting
|
|
mode: single
|
|
icon: mdi:broom
|
|
cleanup_crash:
|
|
alias: Cleanup Crash
|
|
sequence:
|
|
- service: switch.turn_off
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- switch.presence_simulation
|
|
- switch.basement_echo_dot_do_not_disturb_switch
|
|
- switch.living_room_echo_dot_do_not_disturb_switch
|
|
- switch.master_bedroom_echo_dot_do_not_disturb_switch
|
|
alias: Turn off switches
|
|
- if:
|
|
- condition: time
|
|
after: input_datetime.master_bedroom_wakeup
|
|
before: input_datetime.master_bedroom_cooling
|
|
then:
|
|
- service: input_boolean.turn_off
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.master_bedroom_cooling_on
|
|
- service: button.press
|
|
data: {}
|
|
target:
|
|
entity_id: button.master_bedroom_day_mode
|
|
else:
|
|
- service: input_boolean.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.master_bedroom_cooling_on
|
|
- service: button.press
|
|
data: {}
|
|
target:
|
|
entity_id: button.master_bedroom_night_mode
|
|
alias: Set climate state
|
|
- if:
|
|
- condition: state
|
|
entity_id: sensor.twitch_ironnerd24
|
|
state: online
|
|
then:
|
|
- service: input_boolean.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.studio_quiet
|
|
else:
|
|
- service: input_boolean.turn_off
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.studio_quiet
|
|
alias: Set studio quiet if Twitch stream is live
|
|
- if:
|
|
- condition: state
|
|
entity_id: calendar.family_tinawork
|
|
state: 'on'
|
|
- condition: time
|
|
before: input_datetime.tina_workday_end
|
|
after: input_datetime.tina_workday_start
|
|
then:
|
|
- service: input_boolean.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.work_today
|
|
else:
|
|
- service: input_boolean.turn_off
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.work_today
|
|
alias: Set Tina Work booleans
|
|
- if:
|
|
- condition: state
|
|
entity_id: calendar.kallen_school_days
|
|
state: 'on'
|
|
- condition: time
|
|
before: input_datetime.kallen_school_day_end
|
|
after: input_datetime.kallen_school_day_start
|
|
then:
|
|
- service: input_boolean.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- input_boolean.kallen_school_today
|
|
- input_boolean.kallen_school_today_extended
|
|
- input_boolean.kallen_at_school
|
|
else:
|
|
- service: input_boolean.turn_off
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- input_boolean.kallen_school_today
|
|
- input_boolean.kallen_school_today_extended
|
|
- input_boolean.kallen_at_school
|
|
alias: Set Kallen School booleans
|
|
- if:
|
|
- condition: time
|
|
before: input_datetime.audible_notification_on
|
|
after: input_datetime.audible_notification_off
|
|
then:
|
|
- service: input_boolean.turn_off
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.audible_notifications
|
|
else:
|
|
- service: input_boolean.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.audible_notifications
|
|
alias: Set audible notifications
|
|
- service: switch.turn_on
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- switch.adaptive_lighting_basement_studio
|
|
- switch.adaptive_lighting_downstairs_bathroom
|
|
- switch.adaptive_lighting_front_porch
|
|
- switch.adaptive_lighting_kallen_bedroom
|
|
- switch.adaptive_lighting_living_room
|
|
- switch.adaptive_lighting_master_bedroom
|
|
- switch.adaptive_lighting_mud_room
|
|
- switch.adaptive_lighting_tina_lamp
|
|
- switch.adaptive_lighting_emma_bedroom
|
|
- switch.adaptive_lighting_upstairs_bathroom
|
|
- switch.adaptive_lighting_upstairs_hallway
|
|
alias: Turn on all adaptive lighting
|
|
- service: input_text.set_value
|
|
data:
|
|
value: Adaptive
|
|
target:
|
|
entity_id:
|
|
- input_text.basement_studio_selected_scene
|
|
- input_text.downstairs_bathroom_selected_scene
|
|
- input_text.front_porch_selected_scene
|
|
- input_text.kallen_bedroom_selected_scene
|
|
- input_text.living_room_selected_scene
|
|
- input_text.master_bedroom_selected_scene
|
|
- input_text.mud_room_selected_scene
|
|
- input_text.emma_bedroom_selected_scene
|
|
- input_text.tina_lamp_selected_scene
|
|
- input_text.upstairs_bathroom_selected_scene
|
|
- input_text.upstairs_hallway_selected_scene
|
|
alias: Reset input texts to adaptive
|
|
- service: script.volume_reset
|
|
data: {}
|
|
alias: Reset all speaker volumes
|
|
- service: button.press
|
|
data: {}
|
|
target:
|
|
entity_id: button.cleanup
|
|
alias: Run Node-RED cleanup flow
|
|
mode: single
|
|
icon: mdi:truck-snowflake
|
|
basement_shutdown:
|
|
alias: Basement Shutdown
|
|
sequence:
|
|
- alias: Turn off any active modes
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- input_boolean.studio_quiet
|
|
- input_boolean.recliner_mode
|
|
- input_boolean.gaming_mode
|
|
action: input_boolean.turn_off
|
|
- if:
|
|
- condition: not
|
|
conditions:
|
|
- condition: state
|
|
entity_id: media_player.basement_tv
|
|
state:
|
|
- playing
|
|
then:
|
|
- data: {}
|
|
target:
|
|
entity_id: media_player.basement_tv
|
|
action: media_player.turn_off
|
|
alias: If TV is not being used, turn it off
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.kallen_computer_updates
|
|
state: 'off'
|
|
then:
|
|
- data: {}
|
|
action: script.kallen_desktop_shutdown
|
|
else:
|
|
- data: {}
|
|
action: script.kallen_desktop_lock
|
|
- data: {}
|
|
target:
|
|
entity_id: input_boolean.kallen_computer_updates
|
|
action: input_boolean.turn_off
|
|
alias: Turn off Kallen Desktop unless updates are scheduled
|
|
- data: {}
|
|
target:
|
|
entity_id: fan.basement_fan
|
|
action: fan.turn_off
|
|
- alias: Basement Studio Climate
|
|
if:
|
|
- condition: state
|
|
entity_id: input_boolean.basement_studio_heat_allowed
|
|
state: 'on'
|
|
alias: Heat Allowed
|
|
then:
|
|
- alias: Decide basement studio heater action
|
|
if:
|
|
- condition: numeric_state
|
|
entity_id: weather.iron_nerd_weather_station
|
|
attribute: temperature
|
|
below: 32
|
|
alias: Temperature below freezing
|
|
then:
|
|
- action: climate.set_preset_mode
|
|
metadata: {}
|
|
data:
|
|
preset_mode: frost
|
|
target:
|
|
entity_id: climate.basement_studio_vtherm
|
|
alias: Set temp to lowest preset
|
|
else:
|
|
- alias: Turn basement studio heater off
|
|
action: climate.set_hvac_mode
|
|
metadata: {}
|
|
data:
|
|
hvac_mode: 'off'
|
|
target:
|
|
entity_id: climate.basement_studio_vtherm
|
|
- data:
|
|
type: alert
|
|
who: tony
|
|
title: Basement Shutting Down
|
|
message: Would you like to shut down your computer?
|
|
tag: tony-pc-shutdown
|
|
actions:
|
|
- action: TONY_COMPUTER_SHUTDOWN
|
|
title: Shutdown
|
|
- action: TONY_COMPUTER_LOCK
|
|
title: Lock
|
|
- action: TONY_COMPUTER_IGNORE
|
|
title: Do Nothing
|
|
alias: Ask about shutting down main computer
|
|
response_variable: tony_computer
|
|
action: script.text_notify
|
|
- wait_for_trigger:
|
|
- entity_id:
|
|
- binary_sensor.basement_studio_door
|
|
to: 'on'
|
|
trigger: state
|
|
timeout:
|
|
hours: 0
|
|
minutes: 5
|
|
seconds: 0
|
|
milliseconds: 0
|
|
alias: Wait for the door to open
|
|
- data: {}
|
|
target:
|
|
entity_id: light.basement_lights
|
|
alias: Turn off the lights
|
|
action: light.turn_off
|
|
- wait_for_trigger:
|
|
- entity_id:
|
|
- binary_sensor.basement_studio_door
|
|
to: 'off'
|
|
for:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 10
|
|
trigger: state
|
|
timeout:
|
|
hours: 0
|
|
minutes: 1
|
|
seconds: 0
|
|
milliseconds: 0
|
|
alias: Wait for the door to close
|
|
- data: {}
|
|
target:
|
|
entity_id: timer.basement_studio_door_timer
|
|
alias: Cancel the door timer since the lights are already off
|
|
action: timer.cancel
|
|
mode: restart
|
|
icon: mdi:power
|
|
adaptive_on_first_floor:
|
|
alias: Adaptive on First Floor
|
|
sequence:
|
|
- if:
|
|
- condition: state
|
|
entity_id: light.living_room_lights
|
|
state: 'on'
|
|
then:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.living_room_scenes
|
|
data:
|
|
option: Adaptive
|
|
alias: Set adaptive
|
|
else:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.adaptive_lighting_living_room
|
|
data: {}
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_living_room
|
|
data: {}
|
|
- service: input_text.set_value
|
|
target:
|
|
entity_id: input_text.living_room_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
alias: If living room lights are on
|
|
- if:
|
|
- condition: state
|
|
entity_id: light.tina_lamp
|
|
state: 'on'
|
|
then:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.tina_desk_scenes
|
|
data:
|
|
option: Reset
|
|
alias: Set Adaptive
|
|
else:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
data: {}
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_tina_lamp
|
|
data: {}
|
|
alias: If Tina's desk lights are on
|
|
- if:
|
|
- condition: state
|
|
entity_id: light.downstairs_bathroom_lights
|
|
state: 'on'
|
|
then:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.downstairs_bathroom_scenes
|
|
data:
|
|
option: Adaptive
|
|
alias: Set adaptive
|
|
else:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.adaptive_lighting_downstairs_bathroom
|
|
data: {}
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_downstairs_bathroom
|
|
data: {}
|
|
- service: input_text.set_value
|
|
target:
|
|
entity_id: input_text.downstairs_bathroom_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
alias: If downstairs bathroom lights are on
|
|
- if:
|
|
- condition: state
|
|
entity_id: light.mud_room_overhead
|
|
state: 'on'
|
|
then:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.mud_room_scenes
|
|
data:
|
|
option: Adaptive
|
|
alias: Set adaptive
|
|
else:
|
|
- service: switch.turn_on
|
|
target:
|
|
entity_id: switch.adaptive_lighting_mud_room
|
|
data: {}
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_mud_room
|
|
data: {}
|
|
- service: input_text.set_value
|
|
target:
|
|
entity_id: input_text.mud_room_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
alias: If mud room light is on
|
|
mode: single
|
|
adaptive_on_second_floor:
|
|
alias: Adaptive on Second Floor
|
|
sequence:
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.adaptive_lighting_stairwell
|
|
alias: Turn on adaptive lighting in stairwell
|
|
- if:
|
|
- condition: state
|
|
entity_id: light.hallway_overhead
|
|
state: 'on'
|
|
then:
|
|
- target:
|
|
entity_id: input_select.upstairs_hallway_scenes
|
|
data:
|
|
option: Adaptive
|
|
alias: Set adaptive
|
|
action: input_select.select_option
|
|
else:
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_upstairs_hallway
|
|
data: {}
|
|
action: switch.turn_on
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_upstairs_hallway
|
|
data: {}
|
|
action: switch.turn_off
|
|
- target:
|
|
entity_id: input_text.upstairs_hallway_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
action: input_text.set_value
|
|
alias: If hallway light is on
|
|
- if:
|
|
- condition: state
|
|
entity_id: light.master_bedroom_lights
|
|
state: 'on'
|
|
then:
|
|
- target:
|
|
entity_id: input_select.master_bedroom_scenes
|
|
data:
|
|
option: Adaptive
|
|
alias: Set adaptive
|
|
action: input_select.select_option
|
|
else:
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_master_bedroom
|
|
data: {}
|
|
action: switch.turn_on
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_master_bedroom
|
|
data: {}
|
|
action: switch.turn_off
|
|
- target:
|
|
entity_id: input_text.master_bedroom_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
action: input_text.set_value
|
|
alias: If master bedroom lights are on
|
|
- if:
|
|
- condition: state
|
|
entity_id: light.kallen_bedroom_lights
|
|
state: 'on'
|
|
then:
|
|
- target:
|
|
entity_id: input_select.kallen_bedroom_scenes
|
|
data:
|
|
option: Adaptive
|
|
alias: Set adaptive
|
|
action: input_select.select_option
|
|
else:
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_kallen_bedroom
|
|
data: {}
|
|
action: switch.turn_on
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_kallen_bedroom
|
|
data: {}
|
|
action: switch.turn_off
|
|
- target:
|
|
entity_id: input_text.kallen_bedroom_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
action: input_text.set_value
|
|
alias: If Kallen's bedroom lights are on
|
|
- if:
|
|
- condition: state
|
|
entity_id: light.emma_bedroom_light
|
|
state: 'on'
|
|
then:
|
|
- target:
|
|
entity_id: input_select.emma_bedroom_scenes
|
|
data:
|
|
option: Adaptive
|
|
alias: Set adaptive
|
|
action: input_select.select_option
|
|
else:
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_emma_bedroom
|
|
data: {}
|
|
action: switch.turn_on
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_emma_bedroom
|
|
data: {}
|
|
action: switch.turn_off
|
|
- target:
|
|
entity_id: input_text.emma_bedroom_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
action: input_text.set_value
|
|
alias: If Emma's bedroom light is on
|
|
- alias: Upstairs bathroom handling
|
|
if:
|
|
- condition: state
|
|
entity_id: input_boolean.shower_mode
|
|
state: 'off'
|
|
then:
|
|
- if:
|
|
- condition: state
|
|
entity_id: binary_sensor.upstairs_bathroom_occupied
|
|
state: 'on'
|
|
then:
|
|
- target:
|
|
entity_id: input_select.upstairs_bathroom_scenes
|
|
data:
|
|
option: Adaptive
|
|
action: input_select.select_option
|
|
else:
|
|
- if:
|
|
- condition: state
|
|
entity_id: binary_sensor.early_night_mode
|
|
state: 'on'
|
|
then:
|
|
- target:
|
|
entity_id: input_select.upstairs_bathroom_scenes
|
|
data:
|
|
option: Single Nightlight
|
|
action: input_select.select_option
|
|
else:
|
|
- target:
|
|
entity_id: light.upstairs_bathroom_lights
|
|
data: {}
|
|
action: light.turn_off
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_upstairs_bathroom
|
|
data: {}
|
|
action: switch.turn_on
|
|
- target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_upstairs_bathroom
|
|
data: {}
|
|
action: switch.turn_off
|
|
- target:
|
|
entity_id: input_text.upstairs_bathroom_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
action: input_text.set_value
|
|
bright_on_first_floor:
|
|
alias: Bright on First Floor
|
|
sequence:
|
|
- target:
|
|
entity_id:
|
|
- light.living_room_lights
|
|
- light.downstairs_bathroom_lights
|
|
- light.mud_room_overhead
|
|
data: {}
|
|
action: light.turn_on
|
|
- delay:
|
|
seconds: 1
|
|
- target:
|
|
entity_id:
|
|
- input_select.living_room_scenes
|
|
- input_select.downstairs_bathroom_scenes
|
|
- input_select.mud_room_scenes
|
|
data:
|
|
option: Bright
|
|
action: input_select.select_option
|
|
- target:
|
|
entity_id:
|
|
- light.tina_lamp
|
|
data:
|
|
color_temp_kelvin: 2700
|
|
action: light.turn_on
|
|
- target:
|
|
entity_id:
|
|
- light.tina_lamp
|
|
data:
|
|
brightness: 255
|
|
action: light.turn_on
|
|
bright_on_second_floor:
|
|
alias: Bright on Second Floor
|
|
sequence:
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id:
|
|
- light.hallway_overhead
|
|
- light.master_bedroom_lights
|
|
data: {}
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.shower_mode
|
|
state: 'off'
|
|
then:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.upstairs_bathroom_scenes
|
|
data:
|
|
option: Bright
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.kallen_sleeping
|
|
state: 'off'
|
|
then:
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id: light.kallen_bedroom_lights
|
|
data: {}
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.emma_sleeping
|
|
state: 'off'
|
|
then:
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id: light.emma_bedroom_light
|
|
data: {}
|
|
- delay:
|
|
seconds: 1
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id:
|
|
- input_select.upstairs_hallway_scenes
|
|
- input_select.master_bedroom_scenes
|
|
data:
|
|
option: Bright
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.shower_mode
|
|
state: 'off'
|
|
then:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.upstairs_bathroom_scenes
|
|
data:
|
|
option: Bright
|
|
- if:
|
|
- condition: template
|
|
value_template: '{{ is_state(''input_boolean.kallen_sleeping'',''off'') or (is_state(''input_boolean.kallen_sleeping'',''on'')
|
|
and is_state(''light.kallen_bedroom_lights'',''on'')) }}'
|
|
then:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.kallen_bedroom_scenes
|
|
data:
|
|
option: Bright
|
|
- if:
|
|
- condition: template
|
|
value_template: '{{ is_state(''input_boolean.emma_sleeping'',''off'') or (is_state(''input_boolean.emma_sleeping'',''on'')
|
|
and is_state(''light.emma_bedroom_light'',''on'')) }}'
|
|
then:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.emma_bedroom_scenes
|
|
data:
|
|
option: Bright
|
|
evening_on_first_floor:
|
|
alias: Evening on First Floor
|
|
sequence:
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: binary_sensor.early_night_mode
|
|
state: 'off'
|
|
sequence:
|
|
- stop: This scene does nothing during daytime
|
|
alias: Early Night Mode off
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.give_me_darkness
|
|
state: 'on'
|
|
sequence:
|
|
- if:
|
|
- condition: state
|
|
entity_id: person.christina_stork
|
|
state: home
|
|
then:
|
|
- target:
|
|
entity_id: input_select.tina_desk_scenes
|
|
data:
|
|
option: Night Mode
|
|
action: input_select.select_option
|
|
alias: If Tina is home, turn on desk lights
|
|
- alias: Check if script is being called by Give Me Darkness automation
|
|
if:
|
|
- condition: template
|
|
value_template: '{{ give_me_darkness == 1 }}'
|
|
alias: If give_me_darkness = 1
|
|
then:
|
|
- alias: Set mud room light to nightlight
|
|
if:
|
|
- condition: state
|
|
entity_id: timer.mud_room_motion_timer
|
|
state: idle
|
|
then:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: light.mud_room_overhead
|
|
action: light.turn_on
|
|
- target:
|
|
entity_id:
|
|
- input_select.mud_room_scenes
|
|
data:
|
|
option: Nightlight
|
|
action: input_select.select_option
|
|
else:
|
|
- target:
|
|
entity_id:
|
|
- light.living_room_lights
|
|
data: {}
|
|
action: light.turn_off
|
|
- alias: Set mud room light to nightlight
|
|
if:
|
|
- condition: state
|
|
entity_id: timer.mud_room_motion_timer
|
|
state: idle
|
|
then:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: light.mud_room_overhead
|
|
action: light.turn_on
|
|
- target:
|
|
entity_id:
|
|
- input_select.mud_room_scenes
|
|
data:
|
|
option: Nightlight
|
|
action: input_select.select_option
|
|
alias: Give Me Darkness on
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.give_me_darkness
|
|
state: 'off'
|
|
sequence:
|
|
- alias: Check if script is being run by Sunset Lights flow
|
|
if:
|
|
- condition: template
|
|
value_template: '{{ sunset_lights == 1 }}'
|
|
alias: If sunset_lights = 1
|
|
then:
|
|
- target:
|
|
entity_id:
|
|
- light.living_room_lights
|
|
- light.mud_room_overhead
|
|
data: {}
|
|
action: light.turn_on
|
|
- target:
|
|
entity_id:
|
|
- input_select.living_room_scenes
|
|
data:
|
|
option: Adaptive
|
|
action: input_select.select_option
|
|
- alias: Set mud room light to nightlight
|
|
if:
|
|
- condition: state
|
|
entity_id: timer.mud_room_motion_timer
|
|
state: idle
|
|
then:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: light.mud_room_overhead
|
|
action: light.turn_on
|
|
- target:
|
|
entity_id:
|
|
- input_select.mud_room_scenes
|
|
data:
|
|
option: Nightlight
|
|
action: input_select.select_option
|
|
else:
|
|
- target:
|
|
entity_id:
|
|
- light.living_room_lights
|
|
- light.mud_room_overhead
|
|
data: {}
|
|
action: light.turn_on
|
|
- target:
|
|
entity_id:
|
|
- input_select.living_room_scenes
|
|
data:
|
|
option: Adaptive
|
|
action: input_select.select_option
|
|
- alias: Set mud room light to nightlight
|
|
if:
|
|
- condition: state
|
|
entity_id: timer.mud_room_motion_timer
|
|
state: idle
|
|
then:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: light.mud_room_overhead
|
|
action: light.turn_on
|
|
- target:
|
|
entity_id:
|
|
- input_select.mud_room_scenes
|
|
data:
|
|
option: Nightlight
|
|
action: input_select.select_option
|
|
alias: Give Me Darkness off
|
|
evening_on_second_floor:
|
|
alias: Evening on Second Floor
|
|
sequence:
|
|
- condition: state
|
|
entity_id: binary_sensor.early_night_mode
|
|
state: 'on'
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.give_me_darkness
|
|
state: 'on'
|
|
sequence:
|
|
- alias: Turn off hallway light
|
|
if:
|
|
- condition: and
|
|
conditions:
|
|
- condition: state
|
|
entity_id: timer.upstairs_hallway_motion_timer
|
|
state: idle
|
|
- condition: state
|
|
entity_id: timer.stairwell_motion_timer
|
|
state: idle
|
|
alias: If hallway and stairwell motion timers are both idle
|
|
then:
|
|
- action: light.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: light.hallway_overhead
|
|
alias: Turn off hallway light
|
|
- alias: Set upstairs bathroom scene
|
|
if:
|
|
- condition: state
|
|
entity_id: input_boolean.shower_mode
|
|
state: 'off'
|
|
then:
|
|
- target:
|
|
entity_id: input_select.upstairs_bathroom_scenes
|
|
data:
|
|
option: "{% if is_state('binary_sensor.upstairs_bathroom_occupied','on')
|
|
%}\n Adaptive\n{% else %}\n Single Nightlight\n{% endif %}\n"
|
|
action: input_select.select_option
|
|
- target:
|
|
area_id:
|
|
- kallen_bedroom
|
|
- emma_bedroom
|
|
data: {}
|
|
alias: Turn off kids' bedroom lights
|
|
action: light.turn_off
|
|
- alias: Turn off Master Bedroom Lights
|
|
if:
|
|
- condition: state
|
|
entity_id: timer.master_bedroom_motion_timer
|
|
state: idle
|
|
then:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
area_id:
|
|
- master_bedroom
|
|
- master_bedroom_closet
|
|
action: light.turn_off
|
|
- delay:
|
|
seconds: 1
|
|
- target:
|
|
entity_id:
|
|
- switch.adaptive_lighting_kallen_bedroom
|
|
- switch.adaptive_lighting_master_bedroom
|
|
- switch.adaptive_lighting_emma_bedroom
|
|
data: {}
|
|
alias: Re-enable adaptive lighting in bedrooms
|
|
action: switch.turn_on
|
|
- target:
|
|
entity_id:
|
|
- switch.adaptive_lighting_sleep_mode_kallen_bedroom
|
|
- switch.adaptive_lighting_sleep_mode_master_bedroom
|
|
- switch.adaptive_lighting_sleep_mode_emma_bedroom
|
|
data: {}
|
|
alias: Turn off adaptive lighting sleep mode in bedrooms
|
|
action: switch.turn_off
|
|
- target:
|
|
entity_id:
|
|
- input_text.kallen_bedroom_selected_scene
|
|
- input_text.master_bedroom_selected_scene
|
|
- input_text.emma_bedroom_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
alias: Set input texts for bedroom scenes back to Adaptive
|
|
action: input_text.set_value
|
|
alias: Give Me Darkness on
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.give_me_darkness
|
|
state: 'off'
|
|
sequence:
|
|
- alias: Set hallway light to nightlight
|
|
if:
|
|
- condition: and
|
|
conditions:
|
|
- condition: state
|
|
entity_id: timer.upstairs_hallway_motion_timer
|
|
state: idle
|
|
- condition: state
|
|
entity_id: timer.stairwell_motion_timer
|
|
state: idle
|
|
alias: If hallway and stairwell motion timers are both idle
|
|
then:
|
|
- target:
|
|
entity_id:
|
|
- input_select.upstairs_hallway_scenes
|
|
data:
|
|
option: Nightlight
|
|
alias: Set hallway light to nightlight
|
|
action: input_select.select_option
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.shower_mode
|
|
state: 'off'
|
|
then:
|
|
- target:
|
|
entity_id: input_select.upstairs_bathroom_scenes
|
|
data:
|
|
option: "{% if is_state('binary_sensor.upstairs_bathroom_occupied','on')
|
|
%}\n Adaptive\n{% else %}\n Nightlight\n{% endif %}\n"
|
|
action: input_select.select_option
|
|
alias: Set upstairs bathroom scene
|
|
- alias: Check if script is being run by Sunset Lights flow
|
|
if:
|
|
- condition: template
|
|
value_template: '{{ sunset_lights == 1 }}'
|
|
alias: If sunset_lights = 1
|
|
then:
|
|
- stop: Sunset lights don't mess with bedroom light states before bedtime
|
|
else:
|
|
- target:
|
|
area_id:
|
|
- kallen_bedroom
|
|
- emma_bedroom
|
|
data: {}
|
|
alias: Turn off kids' bedroom lights
|
|
action: light.turn_off
|
|
- alias: Turn off Master Bedroom Lights
|
|
if:
|
|
- condition: state
|
|
entity_id: timer.master_bedroom_motion_timer
|
|
state: idle
|
|
then:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
area_id:
|
|
- master_bedroom
|
|
- master_bedroom_closet
|
|
action: light.turn_off
|
|
- delay:
|
|
seconds: 1
|
|
- target:
|
|
entity_id:
|
|
- switch.adaptive_lighting_kallen_bedroom
|
|
- switch.adaptive_lighting_master_bedroom
|
|
- switch.adaptive_lighting_emma_bedroom
|
|
data: {}
|
|
alias: Re-enable adaptive lighting in bedrooms
|
|
action: switch.turn_on
|
|
- target:
|
|
entity_id:
|
|
- switch.adaptive_lighting_sleep_mode_kallen_bedroom
|
|
- switch.adaptive_lighting_sleep_mode_master_bedroom
|
|
- switch.adaptive_lighting_sleep_mode_emma_bedroom
|
|
data: {}
|
|
alias: Turn off adaptive lighting sleep mode in bedrooms
|
|
action: switch.turn_off
|
|
- target:
|
|
entity_id:
|
|
- input_text.kallen_bedroom_selected_scene
|
|
- input_text.master_bedroom_selected_scene
|
|
- input_text.emma_bedroom_selected_scene
|
|
data:
|
|
value: Adaptive
|
|
alias: Set input texts for bedroom scenes back to Adaptive
|
|
action: input_text.set_value
|
|
alias: Give Me Darkness off
|
|
goodnight_in_basement:
|
|
alias: Goodnight in Basement
|
|
sequence:
|
|
- target:
|
|
area_id:
|
|
- basement_studio
|
|
- furnace_room
|
|
data: {}
|
|
action: light.turn_off
|
|
alias: Turn lights off
|
|
- target:
|
|
entity_id: fan.basement_fan
|
|
data: {}
|
|
action: fan.turn_off
|
|
alias: Turn fan off
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 3
|
|
milliseconds: 0
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.adaptive_lighting_sleep_mode_basement_studio
|
|
alias: Turn off sleep mode
|
|
- action: switch.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.adaptive_lighting_basement_studio
|
|
alias: Turn on adaptive lighting
|
|
- action: input_text.set_value
|
|
metadata: {}
|
|
data:
|
|
value: Adaptive
|
|
target:
|
|
entity_id: input_text.basement_studio_selected_scene
|
|
alias: Reset selected scene text
|
|
goodnight_on_first_floor:
|
|
alias: Goodnight on First Floor
|
|
sequence:
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.guest_mode
|
|
state: 'on'
|
|
then:
|
|
- service: light.turn_off
|
|
target:
|
|
area_id:
|
|
- downstairs_bathroom
|
|
- tina_desk
|
|
entity_id: light.living_room_lights
|
|
data: {}
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.mud_room_scenes
|
|
data:
|
|
option: Nightlight
|
|
else:
|
|
- service: light.turn_off
|
|
target:
|
|
area_id:
|
|
- downstairs_bathroom
|
|
- mud_room
|
|
- tina_desk
|
|
entity_id: light.living_room_lights
|
|
data: {}
|
|
goodnight_on_second_floor:
|
|
alias: Goodnight on Second Floor
|
|
sequence:
|
|
- service: light.turn_off
|
|
target:
|
|
area_id:
|
|
- emma_bedroom
|
|
- kallen_bedroom
|
|
- master_bedroom
|
|
- master_bedroom_closet
|
|
- upstairs_hallway
|
|
data: {}
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.kallen_overnight
|
|
state: 'on'
|
|
then:
|
|
- service: light.turn_off
|
|
target:
|
|
area_id: upstairs_bathroom
|
|
data: {}
|
|
else:
|
|
- service: input_select.select_option
|
|
target:
|
|
entity_id: input_select.upstairs_bathroom_scenes
|
|
data:
|
|
option: Single Nightlight
|
|
morning_scene:
|
|
alias: Morning Scene
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.master_bedroom_sleeping
|
|
data: {}
|
|
- if:
|
|
- condition: template
|
|
value_template: '{% set weather = states(''weather.iron_nerd_weather_station'')
|
|
%} {{ weather in [''cloudy'',''partlycloudy'',''rainy'',''snowy'',''hail'',''lightning'',''lightning-rainy'',''pouring'',''snowy-rainy'']
|
|
}}
|
|
|
|
'
|
|
then:
|
|
- if:
|
|
- condition: template
|
|
value_template: '{{ is_state(''input_boolean.kallen_sleeping'',''off'') and
|
|
is_state(''person.kallen_stork'',''home'') }}'
|
|
then:
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id: light.kallen_bedroom_lights
|
|
data: {}
|
|
- if:
|
|
- condition: state
|
|
entity_id: input_boolean.emma_sleeping
|
|
state: 'off'
|
|
then:
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id: light.emma_bedroom_light
|
|
data: {}
|
|
day_mode_in_tina_desk:
|
|
alias: Day Mode in Tina Desk
|
|
sequence:
|
|
- parallel:
|
|
- target:
|
|
entity_id: light.tina_lamp_top
|
|
data: {}
|
|
action: light.turn_on
|
|
- target:
|
|
entity_id: light.tina_lamp_side
|
|
data: {}
|
|
action: light.turn_off
|
|
- wait_template: '{{ is_state(''light.tina_lamp_side'',''off'') }}'
|
|
timeout:
|
|
seconds: 15
|
|
continue_on_timeout: true
|
|
- alias: Apply adaptive lighting to lamp
|
|
if:
|
|
- condition: state
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
state: 'off'
|
|
alias: If adaptive lighting is off
|
|
then:
|
|
- alias: Turn on adaptive lighting
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- switch.adaptive_lighting_tina_lamp
|
|
- switch.adaptive_lighting_adapt_brightness_tina_lamp
|
|
- switch.adaptive_lighting_adapt_color_tina_lamp
|
|
action: switch.turn_on
|
|
else:
|
|
- alias: Apply adaptive lighting
|
|
data:
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
adapt_brightness: true
|
|
adapt_color: true
|
|
action: adaptive_lighting.apply
|
|
mode: restart
|
|
icon: mdi:palette
|
|
evening_mode_in_tina_desk:
|
|
alias: Evening Mode in Tina Desk
|
|
sequence:
|
|
- alias: Turn on lamp
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- light.tina_lamp_top
|
|
- light.tina_lamp_side
|
|
action: light.turn_on
|
|
- alias: Apply adaptive lighting to lamp
|
|
if:
|
|
- condition: state
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
state: 'off'
|
|
alias: If adaptive lighting is off
|
|
then:
|
|
- alias: Turn on adaptive lighting
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- switch.adaptive_lighting_tina_lamp
|
|
- switch.adaptive_lighting_adapt_brightness_tina_lamp
|
|
- switch.adaptive_lighting_adapt_color_tina_lamp
|
|
action: switch.turn_on
|
|
else:
|
|
- alias: Apply adaptive lighting
|
|
data:
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
adapt_brightness: true
|
|
adapt_color: true
|
|
action: adaptive_lighting.apply
|
|
mode: restart
|
|
icon: mdi:palette
|
|
night_mode_in_tina_desk:
|
|
alias: Night Mode in Tina Desk
|
|
sequence:
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
data: {}
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id: light.tina_lamp
|
|
data:
|
|
rgb_color:
|
|
- 127
|
|
- 0
|
|
- 255
|
|
brightness: 128
|
|
mode: restart
|
|
icon: mdi:palette
|
|
bright_mode_in_tina_desk:
|
|
alias: Bright Mode in Tina Desk
|
|
sequence:
|
|
- service: switch.turn_off
|
|
target:
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
data: {}
|
|
- service: light.turn_on
|
|
target:
|
|
entity_id: light.tina_lamp
|
|
data:
|
|
rgb_color:
|
|
- 255
|
|
- 210
|
|
- 175
|
|
brightness: 255
|
|
mode: restart
|
|
icon: mdi:palette
|
|
tony_morning_meds:
|
|
alias: Tony Morning Meds
|
|
icon: mdi:medication
|
|
mode: restart
|
|
sequence:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: counter.tony_morning_meds_reminder_count
|
|
alias: Increment morning reminder counter
|
|
action: counter.increment
|
|
- data:
|
|
type: alert
|
|
who: tony
|
|
message: clear_notification
|
|
tag: tony-morning-meds
|
|
alias: Clear previous morning notification
|
|
action: script.text_notify
|
|
- alias: Send notifications, using AI if internet is connected
|
|
if:
|
|
- condition: state
|
|
entity_id: binary_sensor.internet
|
|
state: 'on'
|
|
then:
|
|
- alias: Generate reminder, be snarky if it's been several times
|
|
if:
|
|
- condition: numeric_state
|
|
entity_id: counter.tony_morning_meds_reminder_count
|
|
above: 2
|
|
then:
|
|
- action: google_generative_ai_conversation.generate_content
|
|
metadata: {}
|
|
data:
|
|
prompt: Remind Tony to take his morning meds. Use a maximum of two lines.
|
|
Be snarky, because at this point he's been reminded multiple times.
|
|
response_variable: response
|
|
alias: Generate snarky reminder
|
|
else:
|
|
- action: google_generative_ai_conversation.generate_content
|
|
metadata: {}
|
|
data:
|
|
prompt: Remind Tony to take his morning meds. Use a maximum of two lines.
|
|
response_variable: response
|
|
alias: Generate reminder
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send morning notifications via text, and TTS if needed
|
|
parallel:
|
|
- alias: Send text notification
|
|
data:
|
|
who: tony
|
|
type: alert
|
|
title: Morning Meds
|
|
message: '{{ response.text }}'
|
|
tag: tony-morning-meds
|
|
actions:
|
|
- action: TONY_MORNING_MEDS_TAKEN
|
|
title: Taken
|
|
- action: TONY_MORNING_MEDS_SKIPPED
|
|
title: Skip
|
|
action: script.text_notify
|
|
- alias: Send TTS if reminders > 2 and Tony is home
|
|
if:
|
|
- alias: When reminders > 2 and Tony is home
|
|
condition: and
|
|
conditions:
|
|
- condition: numeric_state
|
|
entity_id: counter.tony_morning_meds_reminder_count
|
|
above: 2
|
|
alias: When reminder count > 2
|
|
- condition: state
|
|
entity_id: person.tony_stork
|
|
state: home
|
|
alias: If Tony is home
|
|
then:
|
|
- data:
|
|
who: common_areas
|
|
type: alert
|
|
message: '{{ response.text }}'
|
|
alias: Send TTS notification
|
|
action: script.speech_engine
|
|
else:
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send morning notifications via text, and TTS if needed
|
|
parallel:
|
|
- alias: Send text notification
|
|
data:
|
|
who: tony
|
|
type: alert
|
|
title: Morning Meds
|
|
tag: tony-morning-meds
|
|
actions:
|
|
- action: TONY_MORNING_MEDS_TAKEN
|
|
title: Taken
|
|
- action: TONY_MORNING_MEDS_SKIPPED
|
|
title: Skip
|
|
message: You need to take your morning meds
|
|
action: script.text_notify
|
|
- alias: Send TTS if reminders > 2 and Tony is home
|
|
if:
|
|
- alias: When reminders > 2 and Tony is home
|
|
condition: and
|
|
conditions:
|
|
- condition: numeric_state
|
|
entity_id: counter.tony_morning_meds_reminder_count
|
|
above: 2
|
|
alias: When reminder count > 2
|
|
- condition: state
|
|
entity_id: person.tony_stork
|
|
state: home
|
|
alias: If Tony is home
|
|
then:
|
|
- alias: Send TTS notification
|
|
data:
|
|
who: common_areas
|
|
type: alert
|
|
message: Tony, you need to take your morning meds
|
|
action: script.speech_engine
|
|
tony_night_meds:
|
|
alias: Tony Night Meds
|
|
icon: mdi:medication
|
|
mode: restart
|
|
sequence:
|
|
- service: counter.increment
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: counter.tony_night_meds_reminder_count
|
|
alias: Increment night reminder counter
|
|
- service: script.text_notify
|
|
data:
|
|
type: alert
|
|
who: tony
|
|
message: clear_notification
|
|
tag: tony-night-meds
|
|
alias: Clear previous night notification
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send text notification
|
|
service: script.text_notify
|
|
data:
|
|
who: tony
|
|
type: alert
|
|
title: Night Meds
|
|
message: You need to take your night meds
|
|
tag: tony-night-meds
|
|
actions:
|
|
- action: TONY_NIGHT_MEDS_TAKEN
|
|
title: Taken
|
|
- action: TONY_NIGHT_MEDS_SKIPPED
|
|
title: Skip
|
|
tony_stream_today:
|
|
alias: Tony Stream Today
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_streaming_start_time
|
|
data:
|
|
time: '{% from ''time.jinja'' import time_from_calendar %} {{ time_from_calendar(''calendar.tony_s_twitch_schedule'',''start_time'',''set'')
|
|
}}
|
|
|
|
'
|
|
- service: input_boolean.turn_on
|
|
entity_id: input_boolean.tony_streaming_today
|
|
mode: single
|
|
timer_modify:
|
|
alias: Timer Modify
|
|
description: For adding/subtracting time from a running timer
|
|
mode: restart
|
|
sequence:
|
|
- service: timer.pause
|
|
target:
|
|
entity_id: '{{ timer }}'
|
|
- delay:
|
|
seconds: 1
|
|
- variables:
|
|
modify: '{% set x = state_attr(timer, ''remaining'') ~ ''-0000'' %} {% set y
|
|
= strptime(x, ''%H:%M:%S%z'') %} {{ (as_timestamp(y) + change) | timestamp_custom(''%H:%M:%S'',
|
|
false) }}
|
|
|
|
'
|
|
- service: timer.start
|
|
target:
|
|
entity_id: '{{ timer }}'
|
|
data:
|
|
duration: '{{ modify }}'
|
|
tony_custom_meds:
|
|
alias: Tony Custom Meds
|
|
sequence:
|
|
- variables:
|
|
reason: '{{ reason }}'
|
|
num: '{{ num }}'
|
|
active: '{{ ''input_boolean.tony_custom_meds_tracker_'' + num }}'
|
|
taken: '{{ ''input_boolean.tony_custom_meds_taken_'' + num }}'
|
|
taken_at: '{{ ''input_datetime.tony_custom_meds_taken_'' + num }}'
|
|
notify_at: '{{ ''input_datetime.tony_custom_meds_notify_'' + num }}'
|
|
type: '{{ states(''input_select.tony_custom_meds_type_'' + num) }}'
|
|
name: '{{ states(''input_text.tony_custom_med_name_'' + num) }}'
|
|
interval: '{{ states(''input_number.tony_custom_meds_interval_'' + num) }}'
|
|
tag: '{{ ''tony-custom-meds-'' + num }}'
|
|
alias: Set Variables
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''notify'' }}'
|
|
alias: Notify
|
|
sequence:
|
|
- service: script.text_notify
|
|
data:
|
|
who: tony
|
|
type: alert
|
|
title: '{{ name + '' Tracker'' }}'
|
|
message: You need to take your {{ name }}
|
|
tag: '{{ tag }}'
|
|
alias: Send text notification
|
|
- wait_for_trigger:
|
|
- platform: state
|
|
entity_id:
|
|
- person.tony_stork
|
|
id: left
|
|
alias: Left
|
|
from: home
|
|
- platform: template
|
|
value_template: '{{ is_state(taken,''on'') }}'
|
|
alias: Manual
|
|
id: manual
|
|
timeout: 00:30:00
|
|
continue_on_timeout: true
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id in [''manual'',''left''] }}'
|
|
alias: Manual or Left
|
|
sequence:
|
|
- stop: Automation cancelled
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
|
|
}}'
|
|
alias: None or undefined
|
|
sequence:
|
|
- service: script.text_notify
|
|
data:
|
|
who: tony
|
|
type: alert
|
|
message: clear_notification
|
|
tag: '{{ tag }}'
|
|
alias: Clear Notification
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_custom_meds_notify_p1
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,1)
|
|
}}
|
|
|
|
'
|
|
alias: Reset notification time
|
|
alias: Choose depending on the wait trigger
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''taken'' }}'
|
|
alias: Taken
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: '{{ taken_at }}'
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0)
|
|
}}
|
|
|
|
'
|
|
alias: Set time the meds were taken
|
|
- if:
|
|
- condition: template
|
|
value_template: '{{ type == ''Interval'' }}'
|
|
alias: Is it an interval med?
|
|
then:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: '{{ notify_at }}'
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(interval)
|
|
}}
|
|
|
|
'
|
|
alias: Set notification for next dose
|
|
alias: If an interval med, then set time for next dose
|
|
- service: script.text_notify
|
|
data:
|
|
who: tony
|
|
type: alert
|
|
message: clear_notification
|
|
tag: '{{ tag }}'
|
|
alias: Clear Notification
|
|
alias: Routing
|
|
icon: mdi:medication
|
|
mode: parallel
|
|
tony_afternoon_meds:
|
|
alias: Tony Afternoon Meds
|
|
icon: mdi:medication
|
|
mode: restart
|
|
sequence:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: counter.tony_afternoon_meds_reminder_count
|
|
alias: Increment afternoon reminder counter
|
|
action: counter.increment
|
|
- data:
|
|
type: alert
|
|
who: tony
|
|
message: clear_notification
|
|
tag: tony-afternoon-meds
|
|
alias: Clear previous afternoon notification
|
|
action: script.text_notify
|
|
- alias: Send notifications, using AI if internet is connected
|
|
if:
|
|
- condition: state
|
|
entity_id: binary_sensor.internet
|
|
state: 'on'
|
|
then:
|
|
- alias: Generate reminder, be snarky if it's been several times
|
|
if:
|
|
- condition: numeric_state
|
|
entity_id: counter.tony_afternoon_meds_reminder_count
|
|
above: 2
|
|
then:
|
|
- action: google_generative_ai_conversation.generate_content
|
|
metadata: {}
|
|
data:
|
|
prompt: Remind Tony to take his afternoon meds. Use a maximum of two lines.
|
|
Be snarky, because at this point he's been reminded multiple times.
|
|
response_variable: response
|
|
alias: Generate snarky reminder
|
|
else:
|
|
- action: google_generative_ai_conversation.generate_content
|
|
metadata: {}
|
|
data:
|
|
prompt: Remind Tony to take his afternoon meds. Use a maximum of two lines.
|
|
response_variable: response
|
|
alias: Generate reminder
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send afternoon notifications via text, and TTS if needed
|
|
parallel:
|
|
- alias: Send text notification
|
|
data:
|
|
who: tony
|
|
type: alert
|
|
title: Afternoon Meds
|
|
message: '{{ response.text }}'
|
|
tag: tony-afternoon-meds
|
|
actions:
|
|
- action: TONY_AFTERNOON_MEDS_TAKEN
|
|
title: Taken
|
|
- action: TONY_AFTERNOON_MEDS_SKIPPED
|
|
title: Skip
|
|
action: script.text_notify
|
|
- alias: Send TTS if reminders > 2 and Tony is home
|
|
if:
|
|
- alias: When reminders > 2 and Tony is home
|
|
condition: and
|
|
conditions:
|
|
- condition: numeric_state
|
|
entity_id: counter.tony_afternoon_meds_reminder_count
|
|
above: 2
|
|
alias: When reminder count > 2
|
|
- condition: state
|
|
entity_id: person.tony_stork
|
|
state: home
|
|
alias: If Tony is home
|
|
then:
|
|
- data:
|
|
who: common_areas
|
|
type: alert
|
|
message: '{{ response.text }}'
|
|
alias: Send TTS notification
|
|
action: script.speech_engine
|
|
else:
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send afternoon notifications via text, and TTS if needed
|
|
parallel:
|
|
- alias: Send text notification
|
|
data:
|
|
who: tony
|
|
type: alert
|
|
title: Afternoon Meds
|
|
tag: tony-afternoon-meds
|
|
actions:
|
|
- action: TONY_AFTERNOON_MEDS_TAKEN
|
|
title: Taken
|
|
- action: TONY_AFTERNOON_MEDS_SKIPPED
|
|
title: Skip
|
|
message: You need to take your afternoon meds
|
|
action: script.text_notify
|
|
- alias: Send TTS if reminders > 2 and Tony is home
|
|
if:
|
|
- alias: When reminders > 2 and Tony is home
|
|
condition: and
|
|
conditions:
|
|
- condition: numeric_state
|
|
entity_id: counter.tony_afternoon_meds_reminder_count
|
|
above: 2
|
|
alias: When reminder count > 2
|
|
- condition: state
|
|
entity_id: person.tony_stork
|
|
state: home
|
|
alias: If Tony is home
|
|
then:
|
|
- alias: Send TTS notification
|
|
data:
|
|
who: common_areas
|
|
type: alert
|
|
message: Tony, you need to take your afternoon meds
|
|
action: script.speech_engine
|
|
tony_ibuprofen:
|
|
alias: Tony Ibuprofen
|
|
sequence:
|
|
- alias: Turn off boolean if this is a notification
|
|
if:
|
|
- condition: template
|
|
value_template: '{{ reason != ''ibuprofen-taken'' }}'
|
|
alias: If reason is not ibuprofen-taken
|
|
then:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.tony_ibuprofen_taken
|
|
data: {}
|
|
alias: Turn off boolean
|
|
- alias: Routing
|
|
choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''ibuprofen-notify'' }}'
|
|
alias: Ibuprofen Notify
|
|
sequence:
|
|
- service: script.text_notify
|
|
data:
|
|
type: alert
|
|
who: tony
|
|
title: Tony Ibuprofen Time
|
|
message: It is time to take your next dose of Ibuprofen
|
|
tag: tony-ibuprofen
|
|
actions:
|
|
- action: TONY_IBUPROFEN_TAKEN
|
|
title: Taken
|
|
- action: TONY_IBUPROFEN_SKIPPED
|
|
title: Skipped
|
|
- action: TONY_IBUPROFEN_ASK_LATER
|
|
title: Ask Later
|
|
alias: Send actionable text notification
|
|
- wait_for_trigger:
|
|
- platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TONY_IBUPROFEN_TAKEN
|
|
id: ibuprofen-taken
|
|
alias: Ibuprofen Taken
|
|
- alias: Ibuprofen Skipped
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TONY_IBUPROFEN_SKIPPED
|
|
id: ibuprofen-skipped
|
|
- alias: Ibuprofen Ask Later
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TONY_IBUPROFEN_ASK_LATER
|
|
id: ibuprofen-ask-later
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.tony_ibuprofen_taken
|
|
from: 'off'
|
|
to: 'on'
|
|
id: ibuprofen-manual
|
|
alias: Manual
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.tony_ibuprofen_active
|
|
from: 'on'
|
|
to: 'off'
|
|
id: cancel
|
|
timeout:
|
|
hours: 0
|
|
minutes: 30
|
|
seconds: 0
|
|
milliseconds: 0
|
|
continue_on_timeout: true
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''ibuprofen-taken'' }}'
|
|
alias: Ibuprofen Taken
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.tony_ibuprofen_taken
|
|
data: {}
|
|
alias: Turn on boolean
|
|
- conditions:
|
|
- alias: Ibuprofen Skipped
|
|
condition: template
|
|
value_template: '{{ wait.trigger.id == ''ibuprofen-skipped'' }}'
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(8)
|
|
}}
|
|
|
|
'
|
|
alias: Set notification time
|
|
- conditions:
|
|
- alias: Ibuprofen Ask Later
|
|
condition: template
|
|
value_template: '{{ wait.trigger.id == ''ibuprofen-ask-later'' }}'
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set ibuprofen notification time
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(4,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set ibuprofen notification time
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
|
|
}}'
|
|
alias: No response
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set notification time
|
|
alias: Act on wait triggers
|
|
- service: script.text_notify
|
|
data:
|
|
type: alert
|
|
who: tony
|
|
message: clear_notification
|
|
tag: tony-ibuprofen
|
|
alias: Clear actionable text notification
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''ibuprofen-taken'' }}'
|
|
alias: Ibuprofen Taken
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_ibuprofen_taken
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import current_time %} {{ current_time(''datetime'',24)
|
|
}}
|
|
|
|
'
|
|
alias: Set time taken
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(8)
|
|
}}
|
|
|
|
'
|
|
alias: Set ibuprofen notification time
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(4)
|
|
}}
|
|
|
|
'
|
|
alias: Set tylenol notification time
|
|
mode: queued
|
|
icon: mdi:medication
|
|
max: 10
|
|
tony_tylenol:
|
|
alias: Tony Tylenol
|
|
sequence:
|
|
- alias: Turn off boolean if this is a notification
|
|
if:
|
|
- condition: template
|
|
value_template: '{{ reason != ''tylenol-taken'' }}'
|
|
alias: If reason is not tylenol-taken
|
|
then:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.tony_tylenol_taken
|
|
data: {}
|
|
alias: Turn off boolean
|
|
- alias: Routing
|
|
choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''tylenol-notify'' }}'
|
|
alias: Tylenol Notify
|
|
sequence:
|
|
- service: script.text_notify
|
|
data:
|
|
type: alert
|
|
who: tony
|
|
title: Tony Tylenol Time
|
|
message: It is time to take your next dose of Tylenol
|
|
tag: tony-tylenol
|
|
actions:
|
|
- action: TONY_TYLENOL_TAKEN
|
|
title: Taken
|
|
- action: TONY_TYLENOL_SKIPPED
|
|
title: Skipped
|
|
- action: TONY_TYLENOL_ASK_LATER
|
|
title: Ask Later
|
|
alias: Send actionable text notification
|
|
- wait_for_trigger:
|
|
- platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TONY_TYLENOL_TAKEN
|
|
id: tylenol-taken
|
|
alias: Tylenol Taken
|
|
- alias: Tylenol Skipped
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TONY_TYLENOL_SKIPPED
|
|
id: tylenol-skipped
|
|
- alias: Tylenol Ask Later
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TONY_TYLENOL_ASK_LATER
|
|
id: tylenol-ask-later
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.tony_tylenol_taken
|
|
from: 'off'
|
|
to: 'on'
|
|
id: tylenol-manual
|
|
alias: Manual
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.tony_tylenol_active
|
|
from: 'on'
|
|
to: 'off'
|
|
id: cancel
|
|
timeout:
|
|
hours: 0
|
|
minutes: 30
|
|
seconds: 0
|
|
milliseconds: 0
|
|
continue_on_timeout: true
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''tylenol-taken'' }}'
|
|
alias: Tylenol Taken
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.tony_tylenol_taken
|
|
data: {}
|
|
alias: Turn on boolean
|
|
- conditions:
|
|
- alias: Tylenol Skipped
|
|
condition: template
|
|
value_template: '{{ wait.trigger.id == ''tylenol-skipped'' }}'
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(8)
|
|
}}
|
|
|
|
'
|
|
alias: Set notification time
|
|
- conditions:
|
|
- alias: Tylenol Ask Later
|
|
condition: template
|
|
value_template: '{{ wait.trigger.id == ''tylenol-ask-later'' }}'
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set tylenol notification time
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(4,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set tylenol notification time
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
|
|
}}'
|
|
alias: No response
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set notification time
|
|
alias: Act on wait triggers
|
|
- service: script.text_notify
|
|
data:
|
|
type: alert
|
|
who: tony
|
|
message: clear_notification
|
|
tag: tony-tylenol
|
|
alias: Clear actionable text notification
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''tylenol-taken'' }}'
|
|
alias: Tylenol Taken
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_tylenol_taken
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import current_time %} {{ current_time(''datetime'',24)
|
|
}}
|
|
|
|
'
|
|
alias: Set time taken
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(8)
|
|
}}
|
|
|
|
'
|
|
alias: Set tylenol notification time
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.tony_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(4)
|
|
}}
|
|
|
|
'
|
|
alias: Set ibuprofen notification time
|
|
mode: queued
|
|
icon: mdi:medication
|
|
max: 10
|
|
kallen_morning_meds:
|
|
alias: Kallen Morning Meds
|
|
sequence:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: counter.kallen_morning_meds_reminder_count
|
|
alias: Increment morning reminder counter
|
|
action: counter.increment
|
|
- alias: Clear previous text notifications
|
|
data:
|
|
type: alert
|
|
who: all
|
|
message: clear_notification
|
|
tag: kallen-morning-meds
|
|
action: script.text_notify
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send text notification
|
|
data:
|
|
who: all
|
|
type: alert
|
|
title: Morning Meds
|
|
message: Kallen needs to take his morning meds
|
|
tag: kallen-morning-meds
|
|
actions:
|
|
- action: KALLEN_MORNING_MEDS_TAKEN
|
|
title: Taken
|
|
- action: KALLEN_MORNING_MEDS_SKIPPED
|
|
title: Skip
|
|
action: script.text_notify
|
|
icon: mdi:medication
|
|
mode: restart
|
|
kallen_night_meds:
|
|
alias: Kallen Night Meds
|
|
sequence:
|
|
- alias: Increment night reminder counter
|
|
metadata: {}
|
|
data: {}
|
|
action: counter.increment
|
|
target:
|
|
entity_id: counter.kallen_night_meds_reminder_count
|
|
- data:
|
|
type: alert
|
|
who: all
|
|
message: clear_notification
|
|
tag: kallen-night-meds
|
|
alias: Clear previous night notification
|
|
action: script.text_notify
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- parallel:
|
|
- data:
|
|
who: "{% if states('person.christina_stork') in ['Bob Evans','BobEvans'] %}\n
|
|
\ tony\n{% else %}\n parents\n{% endif %}\n"
|
|
type: alert
|
|
title: Night Meds
|
|
message: Kallen needs to take his night meds (melatonin)
|
|
tag: kallen-night-meds
|
|
actions:
|
|
- action: KALLEN_NIGHT_MEDS_TAKEN
|
|
title: Taken
|
|
- action: KALLEN_NIGHT_MEDS_SKIPPED
|
|
title: Skip
|
|
alias: Send to parents
|
|
action: script.text_notify
|
|
- alias: Send to Kallen
|
|
data:
|
|
who: kallen
|
|
type: alert
|
|
title: Night Meds
|
|
message: You need to take your night meds (melatonin)
|
|
tag: kallen-night-meds
|
|
actions:
|
|
- action: KALLEN_NIGHT_MEDS_TAKEN
|
|
title: Taken
|
|
- action: KALLEN_NIGHT_MEDS_SKIPPED
|
|
title: Skip
|
|
action: script.text_notify
|
|
alias: Send text notifications
|
|
icon: mdi:medication
|
|
mode: restart
|
|
reset_annc_switches:
|
|
alias: Reset Announcement Switches
|
|
sequence:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id:
|
|
- input_boolean.good_morning
|
|
- input_boolean.daily_briefing
|
|
- input_boolean.nightly_briefing
|
|
- input_boolean.kallen_morning_briefing
|
|
- input_boolean.kallen_nightly_briefing
|
|
- input_boolean.basement_briefing
|
|
data: {}
|
|
mode: single
|
|
icon: mdi:bullhorn-outline
|
|
emma_rainbow_lights:
|
|
alias: Emma Rainbow Lights
|
|
sequence:
|
|
- service: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id:
|
|
- switch.adaptive_lighting_living_room
|
|
- switch.adaptive_lighting_sleep_mode_living_room
|
|
alias: Turn off adaptive lighting
|
|
- service: lifx.effect_stop
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: light.living_room_led_strip
|
|
alias: Stop any current light strip effects
|
|
- alias: Choose Effect
|
|
choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ effect in [''Rainbow'',null] }}'
|
|
alias: Rainbow
|
|
sequence:
|
|
- service: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
effect: prism
|
|
target:
|
|
entity_id: light.living_room_overhead
|
|
alias: Turn on living room overhead in prism effect
|
|
- service: lifx.effect_move
|
|
metadata: {}
|
|
data:
|
|
speed: 8
|
|
direction: right
|
|
theme: exciting
|
|
power_on: true
|
|
target:
|
|
entity_id: light.living_room_led_strip
|
|
alias: Turn on living room LED strip in exciting theme with move effect
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ effect == ''Blue'' }}'
|
|
alias: Blue
|
|
sequence:
|
|
- service: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
rgb_color:
|
|
- 0
|
|
- 0
|
|
- 255
|
|
brightness_pct: 100
|
|
target:
|
|
entity_id: light.living_room_lights
|
|
alias: Turn on living room lights, set to blue
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ effect == ''Purple'' }}'
|
|
alias: Purple
|
|
sequence:
|
|
- service: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
rgb_color:
|
|
- 134
|
|
- 0
|
|
- 211
|
|
brightness_pct: 100
|
|
target:
|
|
entity_id: light.living_room_lights
|
|
alias: Turn on living room lights, set to purple
|
|
- conditions:
|
|
- alias: Green
|
|
condition: template
|
|
value_template: '{{ effect == ''Green'' }}'
|
|
sequence:
|
|
- alias: Turn on living room lights, set to green
|
|
service: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
rgb_color:
|
|
- 0
|
|
- 255
|
|
- 0
|
|
brightness_pct: 100
|
|
target:
|
|
entity_id: light.living_room_lights
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ effect == ''Tokyo'' }}'
|
|
alias: Tokyo
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.living_room_dynamic_scenes
|
|
alias: Turn on dynamic scenes
|
|
- service: input_select.select_option
|
|
metadata: {}
|
|
data:
|
|
option: Tokyo
|
|
target:
|
|
entity_id: input_select.living_room_scenes
|
|
alias: Activate Tokyo scene in Living Room
|
|
- alias: Turn on living room LED strip in intense theme with move effect
|
|
service: lifx.effect_move
|
|
metadata: {}
|
|
data:
|
|
speed: 8
|
|
direction: right
|
|
theme: intense
|
|
power_on: true
|
|
target:
|
|
entity_id: light.living_room_led_strip
|
|
mode: restart
|
|
icon: fas:rainbow
|
|
fields:
|
|
effect:
|
|
selector:
|
|
select:
|
|
options:
|
|
- Rainbow
|
|
- Blue
|
|
- Purple
|
|
- Green
|
|
- Tokyo
|
|
multiple: false
|
|
name: Effect
|
|
description: What type of effect would you like to run?
|
|
default: Rainbow
|
|
required: true
|
|
rabbit_feeding:
|
|
alias: Rabbit Feeding
|
|
sequence:
|
|
- alias: Send notifications
|
|
parallel:
|
|
- alias: Play TTS if this is the 3rd or higher reminder
|
|
if:
|
|
- condition: numeric_state
|
|
entity_id: counter.rabbit_feeding_reminder_count
|
|
above: 2
|
|
then:
|
|
- service: script.speech_engine
|
|
data:
|
|
who: common_areas
|
|
type: alert
|
|
message: Zeus needs to be fed. This is reminder number {{ states('counter.rabbit_feeding_reminder_count')
|
|
}} for today.
|
|
alias: Play TTS announcement
|
|
- alias: Send phone notifications
|
|
service: script.text_notify
|
|
metadata: {}
|
|
data:
|
|
type: alert
|
|
who: all
|
|
title: Rabbit Feeding
|
|
message: Zeus needs to be fed, please do this ASAP!
|
|
tag: rabbit-feeding
|
|
actions:
|
|
- action: RABBIT_FEEDING_DONE
|
|
title: Fed
|
|
- action: RABBIT_FEEDING_SKIPPED
|
|
title: Skip
|
|
- action: RABBIT_FEEDING_ASK_LATER
|
|
title: Ask Later
|
|
- wait_for_trigger:
|
|
- platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: RABBIT_FEEDING_DONE
|
|
alias: Done
|
|
id: done
|
|
- alias: Skipped
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: RABBIT_FEEDING_SKIPPED
|
|
id: skipped
|
|
- alias: Ask Later
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: RABBIT_FEEDING_ASK_LATER
|
|
id: ask-later
|
|
- platform: state
|
|
entity_id:
|
|
- binary_sensor.parents_home
|
|
from: 'on'
|
|
to: 'off'
|
|
id: left
|
|
alias: Left
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.rabbit_fed
|
|
from: 'off'
|
|
to: 'on'
|
|
alias: Manual
|
|
id: manual
|
|
timeout:
|
|
hours: 1
|
|
minutes: 0
|
|
seconds: 0
|
|
milliseconds: 0
|
|
alias: Triggers
|
|
- alias: Routing
|
|
choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id in [''done'',''manual''] }}'
|
|
alias: Feeding done
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.rabbit_fed
|
|
alias: Turn on input boolean
|
|
- alias: Clear critical notification, if it was sent
|
|
service: script.text_notify
|
|
metadata: {}
|
|
data:
|
|
type: alert
|
|
who: all
|
|
message: clear_notification
|
|
tag: rabbit-feeding-critical
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''ask-later'' }}'
|
|
alias: Ask later
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(1)
|
|
}}
|
|
|
|
'
|
|
target:
|
|
entity_id: input_datetime.rabbit_feeding_notify
|
|
alias: Bump feeding notification by an hour
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''left'' }}'
|
|
alias: Left
|
|
sequence:
|
|
- service: script.text_notify
|
|
metadata: {}
|
|
data:
|
|
type: critical
|
|
who: parents
|
|
title: YOU DICK
|
|
message: YOU FORGOT TO FEED THE RABBIT!
|
|
tag: rabbit-feeding-critical
|
|
alias: Send critical text notification
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
|
|
}}'
|
|
alias: None or undefined
|
|
sequence:
|
|
- service: input_datetime.set_datetime
|
|
target:
|
|
entity_id: input_datetime.rabbit_feeding_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,1)
|
|
}}
|
|
|
|
'
|
|
alias: Notify again
|
|
- alias: Clear notification
|
|
service: script.text_notify
|
|
metadata: {}
|
|
data:
|
|
type: alert
|
|
who: all
|
|
message: clear_notification
|
|
tag: rabbit-feeding
|
|
mode: restart
|
|
icon: mdi:rabbit
|
|
rabbit_hutch_cleaning:
|
|
alias: Rabbit Hutch Cleaning
|
|
sequence:
|
|
- alias: Send notifications
|
|
parallel:
|
|
- alias: Play TTS if this is the 3rd or higher reminder
|
|
if:
|
|
- condition: numeric_state
|
|
entity_id: counter.rabbit_hutch_cleaning_reminder_count
|
|
above: 2
|
|
then:
|
|
- data:
|
|
who: living_room
|
|
type: normal
|
|
message: The rabbit hutch is in need of cleaning. This is reminder number
|
|
{{ states('counter.rabbit_hutch_cleaning_reminder_count') }} for today.
|
|
alias: Play TTS announcement
|
|
action: script.speech_engine
|
|
- alias: Send phone notifications
|
|
metadata: {}
|
|
data:
|
|
type: alert
|
|
who: parents
|
|
title: Rabbit Hutch Cleaning
|
|
message: The rabbit hutch is in need of cleaning. For the sake of smell, please
|
|
do this ASAP!
|
|
tag: rabbit-hutch-cleaning
|
|
actions:
|
|
- action: RABBIT_HUTCH_CLEANING_DONE
|
|
title: Cleaned
|
|
- action: RABBIT_HUTCH_CLEANING_SKIPPED
|
|
title: Skip
|
|
- action: RABBIT_HUTCH_CLEANING_ASK_LATER
|
|
title: Ask Later
|
|
action: script.text_notify
|
|
- alias: Triggers
|
|
wait_for_trigger:
|
|
- alias: Done
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: RABBIT_HUTCH_CLEANING_DONE
|
|
id: done
|
|
- alias: Skipped
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: RABBIT_HUTCH_CLEANING_SKIPPED
|
|
id: skipped
|
|
- alias: Ask Later
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: RABBIT_HUTCH_CLEANING_ASK_LATER
|
|
id: ask-later
|
|
- alias: Manual
|
|
platform: state
|
|
entity_id:
|
|
- input_boolean.rabbit_hutch_cleaned
|
|
from: 'off'
|
|
to: 'on'
|
|
id: manual
|
|
timeout:
|
|
hours: 1
|
|
minutes: 0
|
|
seconds: 0
|
|
milliseconds: 0
|
|
- alias: Routing
|
|
choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id in [''done'',''manual''] }}'
|
|
alias: Cleaning done
|
|
sequence:
|
|
- alias: Turn on input boolean
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: input_boolean.rabbit_hutch_cleaned
|
|
action: input_boolean.turn_on
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''ask-later'' }}'
|
|
alias: Ask later
|
|
sequence:
|
|
- data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(1)
|
|
}}
|
|
|
|
'
|
|
target:
|
|
entity_id: input_datetime.rabbit_hutch_cleaning_notify
|
|
alias: Bump cleaning notification by an hour
|
|
action: input_datetime.set_datetime
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
|
|
}}'
|
|
alias: None or undefined
|
|
sequence:
|
|
- target:
|
|
entity_id: input_datetime.rabbit_hutch_cleaning_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,1)
|
|
}}
|
|
|
|
'
|
|
alias: Notify again
|
|
action: input_datetime.set_datetime
|
|
- alias: Clear notification
|
|
metadata: {}
|
|
data:
|
|
type: alert
|
|
who: parents
|
|
message: clear_notification
|
|
tag: rabbit-hutch-cleaning
|
|
action: script.text_notify
|
|
mode: restart
|
|
icon: mdi:rabbit
|
|
emma_sleep:
|
|
alias: Emma Sleep
|
|
sequence:
|
|
- if:
|
|
- condition: time
|
|
after: 04:00:00
|
|
before: '17:00:00'
|
|
then:
|
|
- data: {}
|
|
action: script.emma_bedroom_scheduling_evening
|
|
alias: Run scheduling if it hasn't already been run
|
|
- target:
|
|
entity_id:
|
|
- script.emma_ibuprofen
|
|
- script.emma_tylenol
|
|
- script.emma_cough_meds
|
|
data: {}
|
|
alias: Reset med trackers
|
|
action: script.turn_off
|
|
- target:
|
|
entity_id:
|
|
- light.emma_bedroom_light
|
|
data: {}
|
|
alias: Turn on light
|
|
action: light.turn_on
|
|
- delay:
|
|
seconds: 1
|
|
- target:
|
|
entity_id:
|
|
- input_select.emma_bedroom_scenes
|
|
data:
|
|
option: Adaptive
|
|
alias: Set lights to adaptive
|
|
action: input_select.select_option
|
|
- if:
|
|
- alias: White Noise
|
|
condition: and
|
|
conditions:
|
|
- condition: state
|
|
entity_id: input_select.scheduled_climate_mode_emma_bedroom
|
|
state: White Noise
|
|
alias: Scheduled mode is White Noise
|
|
- condition: state
|
|
entity_id: input_boolean.white_noise_emma_bedroom
|
|
state: 'off'
|
|
alias: White Noise is not already on
|
|
then:
|
|
- target:
|
|
entity_id: input_boolean.white_noise_emma_bedroom
|
|
data: {}
|
|
alias: Turn on white noise
|
|
action: input_boolean.turn_on
|
|
- data:
|
|
who: parents
|
|
title: Emma Climate Schedule
|
|
message: White noise has been activated in Emma's Bedroom.
|
|
type: normal
|
|
tag: emma-climate
|
|
alias: Send white noise notification
|
|
action: script.text_notify
|
|
alias: Select climate mode
|
|
icon: mdi:lightbulb-night
|
|
mode: restart
|
|
tina_morning_meds:
|
|
alias: Tina Morning Meds
|
|
icon: mdi:medication
|
|
mode: restart
|
|
sequence:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: counter.tina_morning_meds_reminder_count
|
|
alias: Increment morning reminder counter
|
|
action: counter.increment
|
|
- data:
|
|
type: alert
|
|
who: tina
|
|
message: clear_notification
|
|
tag: tina-morning-meds
|
|
alias: Clear previous morning notification
|
|
action: script.text_notify
|
|
- alias: Send notifications, using AI if internet is connected
|
|
if:
|
|
- condition: state
|
|
entity_id: binary_sensor.internet
|
|
state: 'on'
|
|
then:
|
|
- if:
|
|
- condition: numeric_state
|
|
entity_id: counter.tina_morning_meds_reminder_count
|
|
above: 2
|
|
then:
|
|
- action: google_generative_ai_conversation.generate_content
|
|
metadata: {}
|
|
data:
|
|
prompt: Remind Tina to take her morning meds. Use a maximum of two lines.
|
|
Be snarky, because at this point she's been reminded multiple times.
|
|
response_variable: response
|
|
alias: Generate snarky reminder
|
|
else:
|
|
- action: google_generative_ai_conversation.generate_content
|
|
metadata: {}
|
|
data:
|
|
prompt: Remind Tina to take her morning meds. Use a maximum of two lines.
|
|
response_variable: response
|
|
alias: Generate reminder
|
|
alias: Generate reminder, be snarky if it's been several times
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send text notification
|
|
data:
|
|
who: tina
|
|
type: alert
|
|
title: Morning Meds
|
|
message: '{{ response.text }}'
|
|
tag: tina-morning-meds
|
|
actions:
|
|
- action: TINA_MORNING_MEDS_TAKEN
|
|
title: Taken
|
|
- action: TINA_MORNING_MEDS_SKIPPED
|
|
title: Skip
|
|
action: script.text_notify
|
|
else:
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send text notification
|
|
data:
|
|
who: tina
|
|
type: alert
|
|
title: Morning Meds
|
|
tag: tina-morning-meds
|
|
actions:
|
|
- action: TINA_MORNING_MEDS_TAKEN
|
|
title: Taken
|
|
- action: TINA_MORNING_MEDS_SKIPPED
|
|
title: Skip
|
|
message: You need to take your morning meds
|
|
action: script.text_notify
|
|
tina_night_meds:
|
|
alias: Tina Night Meds
|
|
icon: mdi:medication
|
|
mode: restart
|
|
sequence:
|
|
- metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: counter.tina_night_meds_reminder_count
|
|
alias: Increment night reminder counter
|
|
action: counter.increment
|
|
- data:
|
|
type: alert
|
|
who: tina
|
|
message: clear_notification
|
|
tag: tina-night-meds
|
|
alias: Clear previous night notification
|
|
action: script.text_notify
|
|
- alias: Send notifications, using AI if internet is connected
|
|
if:
|
|
- condition: state
|
|
entity_id: binary_sensor.internet
|
|
state: 'on'
|
|
then:
|
|
- if:
|
|
- condition: numeric_state
|
|
entity_id: counter.tina_night_meds_reminder_count
|
|
above: 2
|
|
then:
|
|
- action: google_generative_ai_conversation.generate_content
|
|
metadata: {}
|
|
data:
|
|
prompt: Remind Tina to take her night meds. Use a maximum of two lines.
|
|
Be snarky, because at this point she's been reminded multiple times.
|
|
response_variable: response
|
|
alias: Generate snarky reminder
|
|
else:
|
|
- action: google_generative_ai_conversation.generate_content
|
|
metadata: {}
|
|
data:
|
|
prompt: Remind Tina to take her night meds. Use a maximum of two lines.
|
|
response_variable: response
|
|
alias: Generate reminder
|
|
alias: Generate reminder, be snarky if it's been several times
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send text notification
|
|
data:
|
|
who: tina
|
|
type: alert
|
|
title: Night Meds
|
|
message: '{{ response.text }}'
|
|
tag: tina-night-meds
|
|
actions:
|
|
- action: TINA_NIGHT_MEDS_TAKEN
|
|
title: Taken
|
|
- action: TINA_NIGHT_MEDS_SKIPPED
|
|
title: Skip
|
|
action: script.text_notify
|
|
else:
|
|
- delay:
|
|
hours: 0
|
|
minutes: 0
|
|
seconds: 5
|
|
milliseconds: 0
|
|
- alias: Send text notification
|
|
data:
|
|
who: tina
|
|
type: alert
|
|
title: Night Meds
|
|
tag: tina-night-meds
|
|
actions:
|
|
- action: TINA_NIGHT_MEDS_TAKEN
|
|
title: Taken
|
|
- action: TINA_NIGHT_MEDS_SKIPPED
|
|
title: Skip
|
|
message: You need to take your night meds
|
|
action: script.text_notify
|
|
tina_ibuprofen:
|
|
sequence:
|
|
- alias: Turn off boolean if this is a notification
|
|
if:
|
|
- condition: template
|
|
value_template: '{{ reason != ''ibuprofen-taken'' }}'
|
|
alias: If reason is not ibuprofen-taken
|
|
then:
|
|
- target:
|
|
entity_id: input_boolean.tina_ibuprofen_taken
|
|
data: {}
|
|
alias: Turn off boolean
|
|
action: input_boolean.turn_off
|
|
- alias: Routing
|
|
choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''ibuprofen-notify'' }}'
|
|
alias: Ibuprofen Notify
|
|
sequence:
|
|
- data:
|
|
type: alert
|
|
who: tina
|
|
title: Tina Ibuprofen Time
|
|
message: It is time to take your next dose of Ibuprofen
|
|
tag: tina-ibuprofen
|
|
actions:
|
|
- action: TINA_IBUPROFEN_TAKEN
|
|
title: Taken
|
|
- action: TINA_IBUPROFEN_SKIPPED
|
|
title: Skipped
|
|
- action: TINA_IBUPROFEN_ASK_LATER
|
|
title: Ask Later
|
|
alias: Send actionable text notification
|
|
action: script.text_notify
|
|
- wait_for_trigger:
|
|
- platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TINA_IBUPROFEN_TAKEN
|
|
id: ibuprofen-taken
|
|
alias: Ibuprofen Taken
|
|
- alias: Ibuprofen Skipped
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TINA_IBUPROFEN_SKIPPED
|
|
id: ibuprofen-skipped
|
|
- alias: Ibuprofen Ask Later
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TINA_IBUPROFEN_ASK_LATER
|
|
id: ibuprofen-ask-later
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.tina_ibuprofen_taken
|
|
from: 'off'
|
|
to: 'on'
|
|
id: ibuprofen-manual
|
|
alias: Manual
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.tina_ibuprofen_active
|
|
from: 'on'
|
|
to: 'off'
|
|
id: cancel
|
|
timeout:
|
|
hours: 0
|
|
minutes: 30
|
|
seconds: 0
|
|
milliseconds: 0
|
|
continue_on_timeout: true
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''ibuprofen-taken'' }}'
|
|
alias: Ibuprofen Taken
|
|
sequence:
|
|
- target:
|
|
entity_id: input_boolean.tina_ibuprofen_taken
|
|
data: {}
|
|
alias: Turn on boolean
|
|
action: input_boolean.turn_on
|
|
- conditions:
|
|
- alias: Ibuprofen Skipped
|
|
condition: template
|
|
value_template: '{{ wait.trigger.id == ''ibuprofen-skipped'' }}'
|
|
sequence:
|
|
- target:
|
|
entity_id: input_datetime.tina_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(8)
|
|
}}
|
|
|
|
'
|
|
alias: Set notification time
|
|
action: input_datetime.set_datetime
|
|
- conditions:
|
|
- alias: Ibuprofen Ask Later
|
|
condition: template
|
|
value_template: '{{ wait.trigger.id == ''ibuprofen-ask-later'' }}'
|
|
sequence:
|
|
- target:
|
|
entity_id: input_datetime.tina_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set ibuprofen notification time
|
|
action: input_datetime.set_datetime
|
|
- target:
|
|
entity_id: input_datetime.tina_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(4,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set ibuprofen notification time
|
|
action: input_datetime.set_datetime
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
|
|
}}'
|
|
alias: No response
|
|
sequence:
|
|
- target:
|
|
entity_id: input_datetime.tina_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set notification time
|
|
action: input_datetime.set_datetime
|
|
alias: Act on wait triggers
|
|
- data:
|
|
type: alert
|
|
who: tina
|
|
message: clear_notification
|
|
tag: tina-ibuprofen
|
|
alias: Clear actionable text notification
|
|
action: script.text_notify
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''ibuprofen-taken'' }}'
|
|
alias: Ibuprofen Taken
|
|
sequence:
|
|
- target:
|
|
entity_id: input_datetime.tina_ibuprofen_taken
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import current_time %} {{ current_time(''datetime'',24)
|
|
}}
|
|
|
|
'
|
|
alias: Set time taken
|
|
action: input_datetime.set_datetime
|
|
- target:
|
|
entity_id: input_datetime.tina_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(8)
|
|
}}
|
|
|
|
'
|
|
alias: Set ibuprofen notification time
|
|
action: input_datetime.set_datetime
|
|
- target:
|
|
entity_id: input_datetime.tina_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(4)
|
|
}}
|
|
|
|
'
|
|
alias: Set tylenol notification time
|
|
action: input_datetime.set_datetime
|
|
alias: Tina Ibuprofen
|
|
mode: queued
|
|
icon: mdi:medication
|
|
max: 10
|
|
description: ''
|
|
tina_tylenol:
|
|
sequence:
|
|
- alias: Turn off boolean if this is a notification
|
|
if:
|
|
- condition: template
|
|
value_template: '{{ reason != ''tylenol-taken'' }}'
|
|
alias: If reason is not tylenol-taken
|
|
then:
|
|
- target:
|
|
entity_id: input_boolean.tina_tylenol_taken
|
|
data: {}
|
|
alias: Turn off boolean
|
|
action: input_boolean.turn_off
|
|
- alias: Routing
|
|
choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''tylenol-notify'' }}'
|
|
alias: Tylenol Notify
|
|
sequence:
|
|
- data:
|
|
type: alert
|
|
who: tina
|
|
title: Tina Tylenol Time
|
|
message: It is time to take your next dose of Tylenol
|
|
tag: tina-tylenol
|
|
actions:
|
|
- action: TINA_TYLENOL_TAKEN
|
|
title: Taken
|
|
- action: TINA_TYLENOL_SKIPPED
|
|
title: Skipped
|
|
- action: TINA_TYLENOL_ASK_LATER
|
|
title: Ask Later
|
|
alias: Send actionable text notification
|
|
action: script.text_notify
|
|
- wait_for_trigger:
|
|
- platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TINA_TYLENOL_TAKEN
|
|
id: tylenol-taken
|
|
alias: Tylenol Taken
|
|
- alias: Tylenol Skipped
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TINA_TYLENOL_SKIPPED
|
|
id: tylenol-skipped
|
|
- alias: Tylenol Ask Later
|
|
platform: event
|
|
event_type: ios.notification_action_fired
|
|
event_data:
|
|
actionName: TINA_TYLENOL_ASK_LATER
|
|
id: tylenol-ask-later
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.tina_tylenol_taken
|
|
from: 'off'
|
|
to: 'on'
|
|
id: tylenol-manual
|
|
alias: Manual
|
|
- platform: state
|
|
entity_id:
|
|
- input_boolean.tina_tylenol_active
|
|
from: 'on'
|
|
to: 'off'
|
|
id: cancel
|
|
timeout:
|
|
hours: 0
|
|
minutes: 30
|
|
seconds: 0
|
|
milliseconds: 0
|
|
continue_on_timeout: true
|
|
- choose:
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger.id == ''tylenol-taken'' }}'
|
|
alias: Tylenol Taken
|
|
sequence:
|
|
- target:
|
|
entity_id: input_boolean.tina_tylenol_taken
|
|
data: {}
|
|
alias: Turn on boolean
|
|
action: input_boolean.turn_on
|
|
- conditions:
|
|
- alias: Tylenol Skipped
|
|
condition: template
|
|
value_template: '{{ wait.trigger.id == ''tylenol-skipped'' }}'
|
|
sequence:
|
|
- target:
|
|
entity_id: input_datetime.tina_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(8)
|
|
}}
|
|
|
|
'
|
|
alias: Set notification time
|
|
action: input_datetime.set_datetime
|
|
- conditions:
|
|
- alias: Tylenol Ask Later
|
|
condition: template
|
|
value_template: '{{ wait.trigger.id == ''tylenol-ask-later'' }}'
|
|
sequence:
|
|
- target:
|
|
entity_id: input_datetime.tina_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set tylenol notification time
|
|
action: input_datetime.set_datetime
|
|
- target:
|
|
entity_id: input_datetime.tina_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(4,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set tylenol notification time
|
|
action: input_datetime.set_datetime
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ wait.trigger == ''none'' or wait.trigger.idx is undefined
|
|
}}'
|
|
alias: No response
|
|
sequence:
|
|
- target:
|
|
entity_id: input_datetime.tina_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(0,30)
|
|
}}
|
|
|
|
'
|
|
alias: Set notification time
|
|
action: input_datetime.set_datetime
|
|
alias: Act on wait triggers
|
|
- data:
|
|
type: alert
|
|
who: tina
|
|
message: clear_notification
|
|
tag: tina-tylenol
|
|
alias: Clear actionable text notification
|
|
action: script.text_notify
|
|
- conditions:
|
|
- condition: template
|
|
value_template: '{{ reason == ''tylenol-taken'' }}'
|
|
alias: Tylenol Taken
|
|
sequence:
|
|
- target:
|
|
entity_id: input_datetime.tina_tylenol_taken
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import current_time %} {{ current_time(''datetime'',24)
|
|
}}
|
|
|
|
'
|
|
alias: Set time taken
|
|
action: input_datetime.set_datetime
|
|
- target:
|
|
entity_id: input_datetime.tina_tylenol_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(8)
|
|
}}
|
|
|
|
'
|
|
alias: Set tylenol notification time
|
|
action: input_datetime.set_datetime
|
|
- target:
|
|
entity_id: input_datetime.tina_ibuprofen_notify
|
|
data:
|
|
datetime: '{% from ''time.jinja'' import set_datetime %} {{ set_datetime(4)
|
|
}}
|
|
|
|
'
|
|
alias: Set ibuprofen notification time
|
|
action: input_datetime.set_datetime
|
|
alias: Tina Tylenol
|
|
mode: queued
|
|
icon: mdi:medication
|
|
max: 10
|
|
description: ''
|
|
reading_mode_in_tina_desk:
|
|
sequence:
|
|
- action: switch.turn_off
|
|
metadata: {}
|
|
data: {}
|
|
target:
|
|
entity_id: switch.adaptive_lighting_adapt_brightness_tina_lamp
|
|
alias: Turn off adaptive brightness, leave adaptive color on
|
|
- alias: Turn on lamp
|
|
action: light.turn_on
|
|
metadata: {}
|
|
data:
|
|
brightness_pct: 100
|
|
target:
|
|
entity_id: light.tina_desk_lights
|
|
- alias: Apply adaptive lighting to lamp
|
|
if:
|
|
- condition: state
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
state: 'off'
|
|
alias: If switch is off
|
|
then:
|
|
- data: {}
|
|
target:
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
alias: Turn on the switch
|
|
action: switch.turn_on
|
|
else:
|
|
- alias: Apply adaptive lighting
|
|
data:
|
|
entity_id: switch.adaptive_lighting_tina_lamp
|
|
adapt_color: true
|
|
turn_on_lights: true
|
|
adapt_brightness: false
|
|
action: adaptive_lighting.apply
|
|
alias: Reading Mode in Tina Desk
|
|
description: ''
|
|
icon: mdi:palette
|