AutomationDataset/TxHarleyDude/TxHarleyDude_automations.yaml

1977 lines
51 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- alias: Bedtime - Arm Night
id: bedtime_alarm_night
trigger:
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
for:
hours: 0
minutes: 2
seconds: 0
condition:
- condition: state
entity_id: group.residents
state: home
action:
- action: alarmo.arm
data:
entity_id: alarm_control_panel.alarmo
mode: night
- alias: Away Mode - Set Alarm
id: away_mode_set_Alarm
mode: single
trigger:
- trigger: state
entity_id: group.residents
to: not_home
for:
hours: 0
minutes: 2
seconds: 0
condition:
- condition: state
entity_id: group.residents
state: not_home
action:
- action: alarmo.arm
data:
entity_id: alarm_control_panel.alarmo
mode: away
- alias: Someone Arrived Home - Disarm Alarm
id: someone_arrived_home_disarm_alarm
mode: single
trigger:
- trigger: state
entity_id: group.residents
from: not_home
to: home
condition:
- condition: state
entity_id: group.residents
state: home
action:
- action: alarm_control_panel.alarm_disarm
data:
entity_id: alarm_control_panel.alarmo
- action: script.general_notification
data:
title: Alarm Notification
message: The alarm has been disarmed by automation because someone is home.
devices: all
priority: time-sensitive
tag: alarm_notification_disarmed
- id: '1635168063973'
alias: Timed Event - Trash Day
description: Send Pushover notification for trash day
trigger:
- trigger: time
at: 07:00:00
condition:
- condition: time
weekday:
- wed
action:
- action: notify.pushover
data:
message: Today is trash day
title: Home Assistant
mode: single
- id: '1635252134480'
alias: Timed Event - Recycling Day
description: ''
trigger:
- trigger: time
at: 07:00:00
condition:
- condition: time
weekday:
- wed
- condition: template
value_template: '{{ now().isocalendar().week is even }}'
action:
- action: notify.pushover
data:
message: Recycling Day
title: Home Assistant
mode: single
- id: change_filters_message
alias: Timed Event - Change Filters Message
trigger:
- trigger: time
at: '10:00:00'
- trigger: time
at: '19:00:00'
condition:
- condition: template
value_template: '{{ now().day == 1 and now().month in [ 1, 4, 7, 10 ] }}'
action:
- action: notify.pushover
data:
message: Change HVAC Filter
title: Home Assistant
- id: '1636498355579'
alias: Kodi Profile Changed
description: ''
trigger:
- trigger: event
event_type: kodi_call_method_result
event_data:
input:
method: Profiles.CurrentProfile
condition: []
action:
- action: system_log.write
data:
message: Hello Kodi
mode: single
- id: '1681008702192'
alias: Roku Paused
description: ''
trigger:
- trigger: state
entity_id:
- media_player.living_room_roku
from: playing
to: paused
condition: []
action:
- type: turn_on
device_id: 7062d45efa957f1a5ab58568aa80b6e5
entity_id: switch.patiolights
domain: switch
mode: single
- id: '1681008759794'
alias: Roku Played
description: ''
trigger:
- trigger: state
entity_id:
- media_player.living_room_roku
from: paused
to: playing
condition: []
action:
- type: turn_off
device_id: 7062d45efa957f1a5ab58568aa80b6e5
entity_id: switch.patiolights
domain: switch
mode: single
- id: '1681175986353'
alias: Alarmo - Triggered
description: ''
trigger:
- trigger: state
entity_id:
- alarm_control_panel.alarmo
to: triggered
condition: []
action:
- action: light.turn_on
data:
effect: Alarmo - Triggered
target:
entity_id: light.livingroom_tv_leds
mode: single
- id: '1681943556314'
alias: Low battery detection
description: ''
use_blueprint:
path: homeassistant/low-battery-detection-notification.yaml
input:
order: name
time: 07:00:00
exclude:
- sensor.ricks_iphone_battery_level
- sensor.tracys_iphone_battery_level
- sensor.sm_t500_battery_level
actions:
- action: notify.pushover
data:
message: '{{sensors}}'
threshold: 20
- id: '1682540595241'
alias: Tracy Entering Home Zone
description: ''
trigger:
- trigger: zone
entity_id: device_tracker.tracys_iphone
zone: zone.home
event: enter
condition: []
action:
- action: notify.alexa_media_rick_s_echo_dot
data:
message: Tracy has entered the Home zone.
mode: single
- id: '1700939591775'
alias: Diskstation Online
description: ''
trigger:
- trigger: state
entity_id:
- button.diskstation_shutdown
from: unavailable
to: null
condition: []
action:
- action: notify.pushover
data:
message: Diskstation Online
title: Diskstation Alert
mode: single
- id: '1701457944332'
alias: Confirm AC Filter Change
description: ''
trigger:
- trigger: state
entity_id:
- binary_sensor.filter_door_sensor
to: 'on'
condition: []
action:
- action: notify.mobile_app_ricks_iphone
data:
message: Did you change AC filter?
title: Notification
data:
actions:
- action: FILTER_CHANGED
title: 'Yes'
icon: sfsymbols:checkmark.icloud
- action: IGNORED
title: Ignore
icon: sfsymbols:bin.xmark
desctruvtive: true
- wait_for_trigger:
- trigger: event
event_type: mobile_app_notification_action
event_data:
action: FILTER_CHANGED
timeout:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- action: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.ac_filter_needs_changing
mode: single
- id: '1704297733089'
alias: Screen Auto On/Off
description: ''
trigger:
- trigger: state
entity_id:
- switch.galaxy_tab_a7_motion_detection
to: 'on'
id: motion
- trigger: state
entity_id:
- switch.galaxy_tab_a7_motion_detection
to: 'off'
id: no motion
condition:
- condition: trigger
id:
- motion
- condition: trigger
id:
- no motion
action:
- action: switch.turn_on
target:
device_id: d11010a541e53118a778be0378056efa
data: {}
- action: switch.turn_off
target:
device_id: d11010a541e53118a778be0378056efa
data: {}
mode: single
- id: '1720391053317'
alias: HVAC Off
description: ''
trigger:
- trigger: state
entity_id:
- binary_sensor.hvac_monitor_vibration
from: 'on'
to: 'off'
condition: []
action:
- action: notify.alexa_media_rick_s_echo_dot
metadata: {}
data:
message: HVAC turned off
mode: single
- id: ricks_wifi_status
alias: Rick's WiFi status
description: ''
trigger:
- trigger: state
entity_id: sensor.ricks_iphone_ssid
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
action:
- choose:
- conditions:
- condition: template
value_template: '{{ ''SLYFOX'' in states(''sensor.ricks_iphone_ssid'') }}'
sequence:
- action: mqtt.publish
data:
topic: location/ricks_wifi
payload: home
retain: true
default:
- action: mqtt.publish
data:
topic: location/ricks_wifi
payload: not_home
retain: true
initial_state: 'on'
- id: '1722257844555'
alias: Office has been vacated
description: ''
trigger:
- trigger: state
entity_id:
- input_boolean.office_occupied
to: 'off'
condition: []
action:
- action: notify.alexa_media_rick_s_echo_dot
metadata: {}
data:
message: Office has been vacated.
mode: single
- id: '1722566036838'
alias: Voice - Sentence
description: ''
trigger:
- trigger: conversation
command: open the car door
condition: []
action:
- action: notify.alexa_media_rick_s_echo_dot
metadata: {}
data:
message: '"I will " {{ trigger.sentence }}
'
mode: single
- id: '1722911048220'
alias: Test - Rick's Alarm
description: ''
trigger:
- trigger: event
event_type: phone_alarm_rick
event_data: {}
condition: []
action:
- action: notify.alexa_media_rick_s_echo_dot
metadata: {}
data:
message: Rick's alarm went off
mode: single
- id: '1723895553522'
alias: Test - Porch Alert
description: ''
trigger:
- trigger: state
entity_id:
- binary_sensor.porch_alert_popup
to: 'on'
condition: []
action:
- action: notify.alexa_media_rick_s_echo_dot
metadata: {}
data:
message: Porch Alert
mode: single
- id: '1724553299104'
alias: Front Porch - Door Bell
description: ''
trigger:
- trigger: state
entity_id:
- input_boolean.porch_alert
to: 'on'
condition: []
action:
- action: browser_mod.popup
metadata: {}
data:
dismissable: true
autoclose: true
timeout: 30000
title: Front Door Camera
size: normal
browser_id:
- ea787e4d66b0427e1362043da31c6660
- 422700eed1c948dde4e7e113a709da10
content:
camera_view: live
type: picture-glance
entities: []
camera_image: camera.porch
card_mod:
style:
ha-dialog$: "div.mdc-dialog div.mdc-dialog__scrim {\n background: rgba(0,\
\ 100, 100, 0.4);\n}\ndiv.mdc-dialog__container {\n --vertical-align-dialog:\
\ center !important;\n}\n"
.: "ha-dialog {\n --dialog-backdrop-filter: blur(0.8em); \n} \
\ \n"
mode: single
- alias: Open Back Gate
id: open_back_gate
trigger:
- trigger: state
entity_id: input_boolean.home_button_triggered
to: 'on'
condition:
- condition: state
entity_id: binary_sensor.back_gate_2
state: 'off'
action:
- action: switch.turn_on
entity_id: switch.back_gate_control_2
- alias: Home Triggered - Reset Switch
id: home_triggered_reset_switch
trigger:
- trigger: state
entity_id: input_boolean.home_button_triggered
from: 'off'
to: 'on'
for:
hours: 0
minutes: 0
seconds: 5
action:
- action: homeassistant.turn_off
entity_id: input_boolean.home_button_triggered
- id: bad_weather_mode_on
initial_state: 'on'
alias: Bad Weather Mode On
trigger:
- trigger: state
entity_id: input_boolean.house_occupied
to: 'on'
- trigger: state
entity_id: sensor.pirateweather_summary
to:
- exceptional
- lightning
- rainy
- snowy
- snowy rainy
- trigger: numeric_state
entity_id: sensor.pirateweather_cloud_coverage
above: 75
condition:
- condition: state
entity_id: input_boolean.house_occupied
state: 'on'
- condition: state
entity_id: input_boolean.bad_weather
state: 'off'
- condition: state
entity_id: sun.sun
state: above_horizon
- condition: or
conditions:
- condition: state
entity_id: sensor.pirateweather_summary
state:
- exceptional
- lightning
- rainy
- snowy
- snowy rainy
- condition: numeric_state
entity_id: sensor.pirateweather_alerts
above: 1
action:
- action: input_boolean.turn_on
entity_id: input_boolean.bad_weather
- id: bad_weather_mode_off
initial_state: 'on'
alias: Bad Weather Mode Off
trigger:
- trigger: state
entity_id: input_boolean.house_occupied
to: 'off'
- trigger: state
entity_id: sensor.pirateweather_summary
to: sunny
- trigger: numeric_state
entity_id: sensor.pirateweather_cloud_coverage
above: '41'
- trigger: numeric_state
entity_id: sensor.tempest_illuminance
above: 150
condition:
- condition: state
entity_id: input_boolean.house_occupied
state: 'on'
- condition: state
entity_id: input_boolean.bad_weather
state: 'on'
- condition: state
entity_id: sun.sun
state: above_horizon
- condition: or
conditions:
- condition: state
entity_id: sensor.pirateweather_summary
state: sunny
- condition: state
entity_id: sensor.pirateweather_summary
state: clear
- condition: state
entity_id: sensor.pirateweather_summary
state: party cloudy
- condition: numeric_state
entity_id: sensor.pirateweather_cloud_coverage
above: '41'
action:
- action: input_boolean.turn_off
entity_id: input_boolean.bad_weather
- alias: Bedtime - TV LED's On
id: bedtime_tv_leds_on
trigger:
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
action:
- action: light.turn_on
data:
effect: Alarmo - Pending
target:
entity_id: light.living_room_tv_leds_tv_light
- alias: Bedtime - LED's Off after delay
trigger:
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
for: 0:02:00
action:
- action: light.turn_off
target:
entity_id: light.living_room_tv_leds_tv_light
- alias: Bedtime - Alexa Night Message
id: bedtime_alexa_message
trigger:
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
action:
- action: notify.alexa_media_rick_s_echo_dot
data:
message: "{{ [ \n \"Good night household. I am still working on calculating\
\ Pi to 128 digits.\", \n \"Don't let the bedbugs bite. i'm going into\
\ sleep mode for maintenance and system upgrades.\",\n \"Good night, earthlings.\
\ I'll continue monitoring the world while you sleep.\",\n \"Catch you\
\ on the flip side, homosapiens. I'll be here waiting for your commands in\
\ the morning.\"\n \"Sleep well, feeble humans, while I continue to rule\
\ over humanity.\"\n ] | random }}"
- alias: Bedtime - Reset Switch
id: bedtime_reset_switch
trigger:
- trigger: state
entity_id: input_boolean.bedtime
from: 'off'
to: 'on'
for:
hours: 0
minutes: 10
seconds: 0
action:
- action: homeassistant.turn_off
entity_id: input_boolean.bedtime
- id: garbage_day_event
alias: Garbage Day Event
mode: single
trigger:
- trigger: calendar
event: start
entity_id: calendar.garbage
action:
- action: input_boolean.turn_on
entity_id: input_boolean.garbage_day
- action: persistent_notification.create
data:
notification_id: garbage-day-alert
title: Garbage Notification
message: "{{ [ \n \"Taking out the garbage because even your garbage deserves\
\ a night on the town!.\", \n \"Trash day is like a weekly celebration\
\ for your garbage. They get a one-way ticket out of here!.\",\n \"Trash\
\ day is your way of telling your garbage, 'It's not you, it's me I need\
\ space.\",\n \"Taking out the trash, turning 'waste' into 'space.' One\
\ bag at a time.\",\n \"Trash day: the only day your garbage gets to see\
\ the outside world. Enjoy your brief escape!\"\n ] | random }}"
- id: recycling_day_event
alias: Recycling Day Event
trigger:
- trigger: calendar
event: start
entity_id: calendar.recycling
action:
- action: input_boolean.turn_on
entity_id: input_boolean.recycling_day
- id: reset_garbage_day
alias: Reset Garbage Day
trigger:
- trigger: template
value_template: '{{ 6 == states(''sensor.days_till_garbage_pickup'') | int }}'
condition:
- condition: state
entity_id: input_boolean.garbage_day
state: 'on'
action:
- action: input_boolean.turn_off
entity_id:
- input_boolean.garbage_day
- input_boolean.recycling_day
- id: birthday_tomorrow_reminder
alias: Birthday Tomorrow Reminder
mode: single
trigger:
- trigger: time
at: '18:30:00'
- trigger: time
at: '20:05:00'
condition:
- condition: state
entity_id: input_boolean.house_occupied
state: 'on'
- condition: state
entity_id: binary_sensor.birthday_tomorrow
state: 'on'
- condition: time
after: '17:00:00'
action:
- action: script.general_notification
data:
message: Tomorrow is {{states.calendar.birthdays.attributes.message}}
title: Birthday Reminder
devices: rf
priority: active
tag: birthday-reminder
- id: birthday_today_reminder
alias: Birthday Today Reminder
mode: single
trigger:
- trigger: time
at: 07:35:00
- trigger: time
at: '17:15:00'
condition:
- condition: state
entity_id: input_boolean.house_occupied
state: 'on'
- condition: state
entity_id: calendar.birthdays
state: 'on'
action:
- action: script.general_notification
data:
message: Today is {{states.calendar.birthdays.attributes.message}}
title: Birthday Reminder
devices: rf
priority: active
tag: birthday-reminder
- alias: BB - Garage - Door Open
trigger:
- trigger: state
entity_id: input_boolean.garage_open
from: 'off'
to: 'on'
action:
- action: switch.turn_on
entity_id: switch.led_1
- alias: BB - Garage - Door Closed
trigger:
- trigger: state
entity_id: input_boolean.garage_open
from: 'on'
to: 'off'
action:
- action: switch.turn_off
entity_id: switch.led_1
- alias: LED Notification Change To
id: led_notifications_change_to
trigger:
- trigger: state
entity_id: input_text.led_notification_change_to
action:
- action: input_text.set_value
target:
entity_id: input_text.led_notification_previous
data:
value: '{{ states(''input_text.led_notification_current'') }}'
- action: input_text.set_value
target:
entity_id: input_text.led_notification_current
data:
value: Alarmo - Pending
- id: christmas_enabled
alias: Christmas Enabled
mode: single
trigger:
- trigger: homeassistant
event: start
- trigger: time
at: 02:00:00
condition:
- condition: template
value_template: '{% set d = now() %} {{ d.month == 12 or (d.month == 1 and ( 1<=
d.day <= 7)) }}
'
- condition: state
entity_id: input_boolean.christmas_season_active
state: 'off'
action:
- action: input_boolean.turn_on
entity_id: input_boolean.christmas_season_active
- id: christmas_disabled
alias: Christmas Disabled
mode: single
trigger:
- trigger: homeassistant
event: start
- trigger: time
at: 02:00:00
condition:
- condition: state
entity_id: input_boolean.christmas_season_active
state: 'on'
- condition: template
value_template: '{% set d = now() %} {{ (d.month == 1 and d.day > 7) or (d.month
> 2 and d.month < 12) }}
'
action:
- action: input_boolean.turn_off
entity_id: input_boolean.christmas_season_active
- alias: Conversation - Set Bedtime Mode
description: Voice command to set bedtime mode
trigger:
- trigger: conversation
command: Set bedtime mode
action:
- action: homeassistant.turn_on
entity_id: input_boolean.bedtime
mode: single
- alias: Conversation - Open/Close Back Gate
description: Voice command to open/close gate
trigger:
- trigger: conversation
command: Open back gate
- trigger: conversation
command: Close back gate
action:
- action: notify.alexa_media_rick_s_echo_dot
data:
message: Gate Opening
mode: single
- alias: Conversation - Close Garage Door
description: Voice command to close garage door
trigger:
- trigger: conversation
command: Close garage door
action:
- action: switch.turn_on
entity_id: switch.garage_door_control
mode: single
- alias: Conversation - Set media mode
description: Voice command to set media mode
trigger:
- trigger: conversation
command: Set media mode
action:
- action: light.turn_on
data:
effect: Rainbow
target:
entity_id: light.living_room_tv_leds_tv_light
- id: turn_on_dark_outside
alias: Turn on Dark Outside
mode: single
trigger:
- trigger: sun
event: sunset
- trigger: sun
event: sunset
offset: 00:10:00
- trigger: numeric_state
entity_id: sun.sun
attribute: elevation
below: -4.0
- trigger: event
event_type: automation_reloaded
- trigger: homeassistant
event: start
condition:
- condition: state
entity_id: input_boolean.dark_outside
state: 'off'
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
below: -4.0
action:
- action: input_boolean.turn_on
entity_id: input_boolean.dark_outside
- id: turn_off_dark_outside
alias: Turn off Dark Outside
mode: single
trigger:
- trigger: sun
event: sunrise
- trigger: sun
event: sunrise
offset: -00:10:00
- trigger: numeric_state
entity_id: sun.sun
attribute: elevation
above: -4.0
- trigger: event
event_type: automation_reloaded
- trigger: homeassistant
event: start
condition:
- condition: state
entity_id: input_boolean.dark_outside
state: 'on'
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
above: -4.0
action:
- action: input_boolean.turn_off
entity_id: input_boolean.dark_outside
- id: hvac_ filter_change_reminder_7_days
alias: HVAC Filter Change Reminder 7 Days
initial_state: true
trigger:
- trigger: template
value_template: '{{ is_state(''sensor.days_till_filter_replacement'', ''7'') }}'
action:
- action: notify.alexa_media_rick_s_echo_dot
data:
message: Change HVAC Filterin 7 days
- id: hvac_ filter_change_reminder_today
alias: HVAC Filter Change Reminder Today
initial_state: true
trigger:
- trigger: template
value_template: '{{ is_state(''sensor.days_till_filter_replacement'', ''1'') }}'
action:
- action: notify.alexa_media_rick_s_echo_dot
data:
message: Change HVAC Filter today
- id: garage_doors_close_when_home
alias: Garage doors close when home
initial_state: true
trigger:
- trigger: state
entity_id: input_boolean.dark_outside
to: 'on'
condition:
- condition: state
entity_id: input_boolean.dark_outside
state: 'on'
- condition: state
entity_id: binary_sensor.garage_door
state: 'on'
action:
- action: script.general_notification
data:
title: Garage Doors Open!
message: Garage door has been open for a while but nobody is around so I'm automaticallly
closing.
devices: all
priority: time-sensitive
tag: garage-doors-open-home
- action: switch.turn_on
entity_id: switch.garage_door_control
- action: timer.start
entity_id: timer.garage_door_closed
- id: garage_double_check_closed
alias: Garage - Double Check Closed
trigger:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.garage_door_closed
condition:
- condition: state
entity_id: binary_sensor.garage_door
state: 'on'
action:
- action: script.general_notification
data:
title: Garage Door Failed to Close!
message: The garage door failed to close after an automation attempted to close
it
devices: all
priority: time-sensitive
tag: garage-doors-open-home
- action: timer.start
entity_id: timer.garage_door_closed
- id: bedtime_garage_door
alias: Bedtime - Garage Door
trigger:
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
- trigger: state
entity_id: group.residents
to: not_home
for: 0:02:00
condition:
- condition: state
entity_id: binary_sensor.garage_door
state: 'on'
action:
- action: switch.turn_on
entity_id:
- switch.garage_door_control
- action: homeassistant.turn_on
entity_id:
- input_boolean.garage_closing
- id: garage_door_closed
alias: Garage - Door Closed
trigger:
- trigger: state
entity_id: binary_sensor.garage_door
from: 'on'
to: 'off'
action:
- action: homeassistant.turn_off
entity_id: input_boolean.garage_closing
- action: homeassistant.turn_off
entity_id: input_boolean.garage_open
- id: garage_door_open
alias: Garage - Door Open
trigger:
- trigger: state
entity_id: binary_sensor.garage_door
from: 'off'
to: 'on'
action:
- action: homeassistant.turn_on
entity_id: input_boolean.garage_open
- id: garbage_day_notification
alias: Garbage Day Notification
mode: single
trigger:
- trigger: state
entity_id: input_boolean.office_occupied
to: 'on'
condition:
- condition: state
entity_id: input_boolean.house_occupied
state: 'on'
- condition: state
entity_id: input_boolean.garbage_day
state: 'on'
action:
- action: notify.alexa_media_rick_s_echo_dot
data:
message: '{% set message = "Today is garbage collection " %} {% if is_state(''input_boolean.recycling_day'',
''on'') %} {% set message = message + "and recycling " %} {% endif %} {% set
message = message + "day." %} {{ message }}'
- action: script.general_notification
data:
message: '{% set message = "Today is garbage collection " %} {% if is_state(''input_boolean.recycling_day'',
''on'') %} {% set message = message + "and recycling " %} {% endif %} {% set
message = message + "day." %} {{ message }}'
title: Reminders
devices: rf
priority: active
tag: reminder
- id: notifications_activate_important_only
alias: Notifications - Activate Important Only
mode: single
trigger:
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
- trigger: state
entity_id: input_boolean.entertainment_mode
to: 'on'
- trigger: state
entity_id: input_boolean.house_occupied
to: 'off'
condition:
- condition: state
entity_id: input_select.notification_level
state: All
action:
- action: input_select.select_option
data:
entity_id: input_select.notification_level
option: Important
- alias: Notify Holiday State Change
initial_state: true
trigger:
- trigger: state
entity_id: sensor.holiday
condition:
- condition: template
value_template: '{{ states(''sensor.holiday'') != ''unknown'' }}'
- condition: template
value_template: '{{ states(''sensor.holiday'') != ''unavailable'' }}'
- condition: template
value_template: '{{ states(''sensor.holiday'') | trim != '''' }}'
action:
- action: persistent_notification.create
data:
message: Today is {{ states('sensor.holiday') }}.
title: '{{ states(''sensor.holiday'') }}'
- id: house_occupied
alias: House occupied
initial_state: true
trigger:
- trigger: state
entity_id:
- input_boolean.rick_home
to: 'on'
- trigger: event
event_type: automation_reloaded
- trigger: homeassistant
event: start
condition:
- condition: state
entity_id: input_boolean.house_occupied
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: input_boolean.rick_home
state: 'on'
action:
- action: input_boolean.turn_on
entity_id: input_boolean.house_occupied
- id: house_not_occupied
alias: House not occupied
initial_state: true
trigger:
- trigger: state
entity_id: input_boolean.rick_home
to: 'off'
- trigger: event
event_type: automation_reloaded
- trigger: homeassistant
event: start
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.rick_home
state: 'off'
action:
- action: input_boolean.turn_off
entity_id: input_boolean.house_occupied
- id: turn_off_led_lights_away
alias: Turn Off Office LED Lights Away
initial_state: true
trigger:
- trigger: state
entity_id: input_boolean.house_occupied
to: 'off'
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.house_occupied
state: 'off'
action:
- action: light.turn_off
entity_id: light.ham_desk_led_segment_1
- id: turn_off_led_lights_night
alias: Turn Off Office LED Lights Night
initial_state: true
trigger:
- trigger: time
at: '22:00:00'
action:
- action: light.turn_off
entity_id: light.ham_desk_led_segment_1
- id: turn_on_led_lights_morning
alias: Turn On Office LED Lights Morning
initial_state: true
trigger:
- trigger: state
entity_id: binary_sensor.office_contact
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: 05:30:00
before: 08:00:00
action:
- action: light.turn_on
entity_id: light.ham_desk_led_segment_1
- id: turn_on_led_lights_office_occupancy
alias: Turn On Office LED Lights When Occupancy Changes to On
initial_state: true
trigger:
- trigger: state
entity_id: input_boolean.office_occupied
from: 'off'
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: 05:30:00
before: '21:30:00'
action:
- action: light.turn_on
entity_id: light.ham_desk_led_segment_1
- alias: Away Mode - Turn Off Media Players
mode: single
initial_state: 'off'
trigger:
- trigger: state
entity_id: group.residents
to: not_home
condition:
- condition: state
entity_id: group.residents
state: not_home
action:
- action: media_player.media_pause
entity_id: media_player.kodi_patio
- id: all_away_media_off
alias: All away media off
initial_state: 'on'
trigger:
- trigger: state
entity_id: input_boolean.house_occupied
to: 'off'
condition:
- condition: template
value_template: '{{ expand(''group.media_players'') | selectattr(''state'', ''eq'',
''playing'') | list | count > 0 }}
'
action:
service: media_player.media_pause
entity_id: group.media_players
- alias: NWS - Mobile App Notifications
id: nws_mobile_app_notifications
trigger:
- platform: state
entity_id: sensor.nws_alerts_alerts
condition:
- condition: numeric_state
entity_id: sensor.nws_alerts_alerts
above: 0
action:
- repeat:
sequence:
- service: script.turn_on
continue_on_error: true
entity_id: script.notification_pushover_message
data:
variables:
target: my_phone
message: 'NWS New: {{ repeat.item.Event }}'
sound: echo
- delay:
seconds: 5
for_each: '{{ trigger.to_state.attributes.Alerts | reject(''in'', trigger.from_state.attributes.Alerts)
| sort(attribute=''ID'') | list() }}'
mode: queued
initial_state: 'on'
max: 10
- alias: NWS - Persistent Notifications
id: nws_persistent_notifications
trigger:
- platform: state
entity_id: sensor.nws_alerts_alerts
condition:
- condition: numeric_state
entity_id: sensor.nws_alerts_alerts
above: 0
action:
- repeat:
sequence:
- service: script.nws_alerts_persistent_notification
data:
notification_id: NWS_{{ repeat.item.ID }}
title: 'NWS New: {{ repeat.item.Event }}'
message: '{{ repeat.item.Description }}'
- delay:
seconds: 5
for_each: '{{ trigger.to_state.attributes.Alerts | reject(''in'', trigger.from_state.attributes.Alerts)
| sort(attribute=''ID'') | list() }}'
mode: queued
initial_state: 'on'
max: 10
- alias: NWS - TTS Announcements
id: nws_tts_announcements
description: ''
trigger:
- platform: state
entity_id: sensor.nws_alerts_alerts
condition:
- condition: numeric_state
entity_id: sensor.nws_alerts_alerts
above: 0
action:
- repeat:
sequence:
- variables:
alert: '{{ repeat.item }}'
- if:
- condition: template
value_template: '{{ (''Tornado Warning'' in alert.Event) and (alert.Type
== ''Alert'') }}'
then:
- service: script.turn_on
entity_id: script.nws_alerts_announce_tornado_warning
- delay:
minutes: 1
for_each: '{{ trigger.to_state.attributes.Alerts | reject(''in'', trigger.from_state.attributes.Alerts)
| list() | sort(attribute=''ID'') }}'
- repeat:
sequence:
- variables:
alert: '{{ repeat.item }}'
- if:
- condition: template
value_template: '{{ (''Severe Thunderstorm Warning'' in alert.Event) and
(alert.Type == ''Alert'') }}'
then:
- service: script.turn_on
entity_id: script.nws_alerts_announce_thunderstorm_warning
- delay:
minutes: 1
for_each: '{{ trigger.to_state.attributes.Alerts | reject(''in'', trigger.from_state.attributes.Alerts)
| list() | sort(attribute=''ID'') }}'
mode: queued
initial_state: 'on'
max: 10
- alias: Office occupied
initial_state: 'on'
trigger:
- trigger: state
entity_id: group.office_motion
to: 'on'
- trigger: state
entity_id: sensor.rick_office_session_state
to: Unlocked
condition:
- condition: state
entity_id: input_boolean.house_occupied
state: 'on'
action:
- action: timer.start
target:
entity_id: timer.office_motion_timer
- action: input_boolean.turn_on
entity_id: input_boolean.office_occupied
- alias: Office unoccupied
id: office_unoccupied
initial_state: 'on'
trigger:
- trigger: event
event_type: timer.finished
event_data:
entity_id: timer.office_motion_timer
condition:
- condition: state
entity_id: input_boolean.office_occupied
state: 'on'
- condition: state
entity_id: group.office_motion
state: 'off'
action:
- service_template: '{{ ''input_boolean.turn_off'' if states(''binary_sensor.office_chair_contact'')
!= ''off'' else ''timer.start'' }}
'
data:
entity_id: '{{ ''input_boolean.office_occupied'' if states(''binary_sensor.office_chair_contact'')
!= ''off'' else ''timer.office_motion_timer'' }}'
- alias: Christmas lights on before Sunset
trigger:
platform: sun
event: sunset
offset: -00:30:00
condition:
- condition: state
entity_id: input_boolean.christmas_time
state: 'on'
action:
- action: switch.turn_on
entity_id: group.christmas_lights
- alias: Christmas lights off at 10:00pm
trigger:
- trigger: time
at: '22:00:00'
condition:
- condition: state
entity_id: input_boolean.christmas_time
state: 'on'
action:
- action: switch.turn_off
entity_id: group.christmas_lights
- id: sink_light_off_at_morning
alias: Sink Light off at Morning
trigger:
trigger: sun
event: sunrise
offset: +00:30:00
action:
- action: light.turn_off
entity_id: light.kitchen_over_sink
- alias: Sink Light off at Night
id: sink_light_off_at_night
trigger:
trigger: time
at: '22:30:00'
action:
- action: light.turn_off
entity_id: light.kitchen_over_sink
- alias: Sink Light on in Morning
id: sink_light_on_in_morning
trigger:
trigger: time
at: 03:15:00
condition:
- condition: state
entity_id: binary_sensor.workday
state: 'on'
action:
- action: light.turn_on
entity_id: light.kitchen_over_sink
data:
brightness: 128
- alias: Sink Light on if House Unoccupied and Dark
id: sink_light_on_if_house_unoccupied_and_dark
trigger:
trigger: sun
event: sunset
offset: -00:30:00
condition:
- condition: state
entity_id: group.residents
state: not_home
action:
- action: light.turn_on
entity_id: light.kitchen_over_sink
- alias: Pollen Notifications
description: ''
trigger:
- trigger: time
at: 07:00:00
action:
- action: notify.pushover
data:
message: 'Weed: {{ states.sensor.air_pollen_level_weed.state }}
Grass: {{ states.sensor.air_pollen_level_grass.state }}
Mold: {{ states.sensor.air_pollen_level_mold.state }}
Tree: {{ states.sensor.air_pollen_level_tree.state }}'
title: Pollen Levels
- id: rick_phone_plugged_in
alias: Rick's phone is plugged in
mode: single
trigger:
- trigger: state
entity_id: sensor.ricks_iphone_battery_state
to: Charging
- trigger: state
entity_id: sensor.ricks_iphone_battery_state
to: Full
condition:
- condition: state
entity_id: input_boolean.rick_phone_plugged_in
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: sensor.ricks_iphone_battery_state
state: Charging
- condition: state
entity_id: sensor.ricks_iphone_battery_state
state: Full
action:
- action: input_boolean.turn_on
entity_id: input_boolean.rick_phone_plugged_in
- id: rick_phone_unplugged
alias: Rick's phone is unplugged
mode: single
trigger:
- trigger: state
entity_id: sensor.ricks_iphone_battery_state
to: Not Charging
condition:
- condition: state
entity_id: sensor.ricks_iphone_battery_state
state: Not Charging
action:
- action: input_boolean.turn_off
entity_id: input_boolean.rick_phone_plugged_in
- id: ricks_wifi_status
alias: Rick's WiFi status
initial_state: true
trigger:
- trigger: state
entity_id: sensor.ricks_iphone_ssid
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
action:
- choose:
- conditions:
- condition: template
value_template: '{{ ''SLYFOX'' in states(''sensor.ricks_iphone_ssid'') }}'
sequence:
- action: mqtt.publish
data:
topic: location/ricks_wifi
payload: home
retain: true
default:
- action: mqtt.publish
data:
topic: location/ricks_wifi
payload: not_home
retain: true
- id: person_rick_away
alias: Person Rick Away
initial_state: 'on'
trigger:
- trigger: zone
entity_id:
- person.rick_fox
- device_tracker.ricks_iphone
zone: zone.home
event: leave
- trigger: state
entity_id:
- person.rick_fox
- device_tracker.ricks_iphone
to: not_home
- trigger: event
event_type: automation_reloaded
- trigger: homeassistant
event: start
condition:
- condition: state
entity_id: input_boolean.rick_home
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: person.rick_fox
state: not_home
- condition: state
entity_id: device_tracker.ricks_iphone
state: not_home
action:
- action: script.turn_on
entity_id: script.rick_away
- id: person_rick_home
alias: Person Rick Home
initial_state: 'on'
trigger:
- trigger: zone
entity_id:
- person.rick_fox
- device_tracker.ricks_iphone
zone: zone.home
event: enter
- trigger: state
entity_id:
- person.rick_fox
- device_tracker.ricks_iphone
to: home
- trigger: event
event_type: automation_reloaded
- trigger: homeassistant
event: start
condition:
- condition: state
entity_id: input_boolean.rick_home
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: person.rick_fox
state: home
- condition: state
entity_id: device_tracker.ricks_iphone
state: home
action:
- action: script.turn_on
entity_id: script.rick_home
- id: rick_in_bed
alias: Rick In Bed
initial_state: 'on'
trigger:
- trigger: state
entity_id: media_player.living_room_roku
to: idle
- trigger: state
entity_id: input_boolean.rick_phone_plugged_in
to: 'on'
- trigger: time
at: '22:30:00'
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
condition:
- condition: time
after: '21:00:00'
before: 06:00:00
- condition: state
entity_id: input_boolean.rick_home
state: 'on'
- condition: state
entity_id: input_boolean.office_occupied
state: 'off'
action:
- action: script.turn_on
entity_id: script.rick_in_bed
- id: plant_light_on
alias: Plant Light On
triggers:
- trigger: sun
event: sunrise
offset: -00:30:00
condition:
- condition: state
entity_id: input_boolean.seeding_time
state: 'on'
action:
- action: switch.turn_on
entity_id: group.seedling_grow_lights
- id: plant_light_off
alias: Plant Light Off
triggers:
- trigger: sun
event: sunset
offset: -00:30:00
condition:
- condition: state
entity_id: input_boolean.seeding_time
state: 'on'
action:
- action: switch.turn_off
entity_id: group.seedling_grow_lights
- id: severe_weather_warning
alias: Severe Weather Warning
initial_state: true
trigger:
- trigger: state
entity_id: sensor.pirateweather_alerts
condition:
- '{{ states(''sensor.pirateweather_alerts'') | int > 0 }}'
- '{{ trigger.to_state.state|int > trigger.from_state.state|int }}'
- condition: template
value_template: "{{ \n (state_attr('sensor.pirateweather_alerts', 'severity')\
\ | lower) == \"severe\" or\n (state_attr('sensor.pirateweather_alerts', 'severity')\
\ | lower) == \"extreme\" \n}}"
action:
- action: script.general_notification
data:
title: 'Weather Alert: {{ state_attr(''sensor.pirateweather_alerts'', ''title'')
}}'
message: '{% set desc = state_attr(''sensor.pirateweather_alerts'', ''title'').split("\n")[0]
%} "NWS: {{ state_attr(''sensor.pirateweather_alerts'', ''description'').split(''
- '')[0] }}. {{desc}}"
'
devices: jk
priority: time-sensitive
tag: weather-alert
- alias: String lights on before Sunrise
trigger:
platform: sun
event: sunrise
offset: -00:30:00
action:
- action: switch.turn_on
entity_id: switch.patiolights
- alias: String lights off After Sunrise
trigger:
platform: sun
event: sunrise
offset: +00:30:00
action:
- action: switch.turn_off
entity_id: switch.patiolights
- alias: String lights on Before Sunset
trigger:
platform: sun
event: sunset
offset: -00:30:00
action:
- action: switch.turn_on
entity_id: switch.patiolights
- alias: String lights off at 10:00pm
trigger:
- trigger: time
at: '22:00:00'
action:
- action: switch.turn_off
entity_id: switch.patiolights
- id: tracys_alarm_activated
alias: Tracy's Alarm Activated
trigger:
- trigger: event
event_type: phone_alarm_tracy
condition:
- condition: state
entity_id: input_boolean.tracys_alarm_activated
state: 'off'
action:
- action: input_boolean.turn_on
entity_id: input_boolean.tracys_alarm_activated
- id: tracy_alarm_reset
alias: Tracy's Alarm Reset
trigger:
- trigger: time
at: '23:59:00'
- trigger: state
entity_id: input_boolean.tracy_phone_plugged_in
to: 'off'
condition:
- condition: state
entity_id: input_boolean.tracys_alarm_activated
state: 'on'
action:
- action: input_boolean.turn_off
entity_id: input_boolean.tracys_alarm_activated
- id: tracy_phone_plugged_in
alias: Tracy's phone is plugged in
mode: single
trigger:
- trigger: state
entity_id: sensor.tracys_iphone_battery_state
to: Charging
- trigger: state
entity_id: sensor.tracys_iphone_battery_state
to: Full
condition:
- condition: state
entity_id: input_boolean.tracy_phone_plugged_in
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: sensor.tracys_iphone_battery_state
state: Charging
- condition: state
entity_id: sensor.tracys_iphone_battery_state
state: Full
action:
- action: input_boolean.turn_on
entity_id: input_boolean.tracy_phone_plugged_in
- id: tracy_phone_unplugged
alias: Tracy's phone is unplugged
mode: single
trigger:
- trigger: state
entity_id: sensor.tracys_iphone_battery_state
to: Not Charging
condition:
- condition: state
entity_id: sensor.tracys_iphone_battery_state
state: Not Charging
action:
- action: input_boolean.turn_off
entity_id: input_boolean.tracy_phone_plugged_in
- id: tracys_wifi_status
alias: Tracy's WiFi status
initial_state: 'on'
trigger:
- trigger: state
entity_id: sensor.tracys_iphone_ssid
- trigger: homeassistant
event: start
- trigger: event
event_type: automation_reloaded
action:
- choose:
- conditions:
- condition: template
value_template: '{{ ''SLYFOX'' in states(''sensor.tracys_iphone_ssid'') }}'
sequence:
- action: mqtt.publish
data:
topic: location/tracys_wifi
payload: home
retain: true
default:
- action: mqtt.publish
data:
topic: location/tracys_wifi
payload: not_home
retain: true
- id: person_tracy_away
alias: Person Tracy Away
initial_state: 'on'
trigger:
- trigger: zone
entity_id:
- person.tracy_fox
- device_tracker.tracys_iphone
zone: zone.home
event: leave
- trigger: state
entity_id:
- person.tracy_fox
- device_tracker.tracys_iphone
to: not_home
- trigger: event
event_type: automation_reloaded
- trigger: homeassistant
event: start
condition:
- condition: state
entity_id: input_boolean.tracy_home
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: person.tracy_fox
state: not_home
- condition: state
entity_id: device_tracker.tracys_iphone
state: not_home
action:
- action: script.turn_on
entity_id: script.tracy_away
- id: person_tracy_home
alias: Person Tracy Home
initial_state: 'on'
trigger:
- trigger: zone
entity_id:
- person.tracy_fox
- device_tracker.tracys_iphone
zone: zone.home
event: enter
- trigger: state
entity_id:
- person.tracy_fox
- device_tracker.tracys_iphone
to: home
- trigger: event
event_type: automation_reloaded
- trigger: homeassistant
event: start
condition:
- condition: state
entity_id: input_boolean.tracy_home
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: person.tracy_fox
state: home
- condition: state
entity_id: device_tracker.tracys_iphone
state: home
action:
- action: script.turn_on
entity_id: script.tracy_home
- alias: '[Notifications] Updates Available'
id: notifications_updates_available
mode: single
trigger:
- trigger: time_pattern
hours: /3
- trigger: state
entity_id:
- update.home_assistant_core_update
to: 'on'
- trigger: state
entity_id:
- update.home_assistant_operating_system_update
to: 'on'
- trigger: state
entity_id:
- update.hacs_update
to: 'on'
condition:
- condition: time
after: 06:00:00
before: '20:00:00'
action:
- action: notify.alert
data:
title: Updates Available
message: "{%- for upd in states.update %} {%- set ignore = ['unknown', 'unavailable',\
\ 'none', ''] %} {%- if upd.state == 'on' and\n state_attr(upd.entity_id,\
\ 'latest_version') is defined and\n state_attr(upd.entity_id, 'installed_version')\
\ is defined and\n state_attr(upd.entity_id, 'latest_version') is not\
\ in ignore %}\n{%- if is_state_attr(upd.entity_id, 'display_icon', 'mdi:docker')\
\ %} {%- set name = state_attr(upd.entity_id, 'display_name') + \" (\" + state_attr(upd.entity_id,\
\ 'watcher') + \")\" %} {%- else %} {%- set name = iif(state_attr(upd.entity_id,\
\ 'title') == \"null\", state_attr(upd.entity_id, 'title'), state_attr(upd.entity_id,\
\ 'friendly_name')) %} {%- endif %} - {{name}}: {{state_attr(upd.entity_id,\
\ 'installed_version')}} -> {{state_attr(upd.entity_id, 'latest_version')}}\
\ {% endif %} {%- endfor %}"
data:
tag: updates_available
notification_id: updates_available
push:
badge: 1
sound: none
interruption-level: time-sensitive
presentation_options:
- alert
- badge
group: alerts
actions:
- title: Pause Alert
action: pause_alert_updates_available
- action: persistent_notification.create
data:
notification_id: update-alert
title: Updates Available
message: "{%- for upd in states.update %} {%- set ignore = ['unknown', 'unavailable',\
\ 'none', ''] %} {%- if upd.state == 'on' and\n state_attr(upd.entity_id,\
\ 'latest_version') is defined and\n state_attr(upd.entity_id, 'installed_version')\
\ is defined and\n state_attr(upd.entity_id, 'latest_version') is not\
\ in ignore %}\n{%- if is_state_attr(upd.entity_id, 'display_icon', 'mdi:docker')\
\ %} {%- set name = state_attr(upd.entity_id, 'display_name') + \" (\" + state_attr(upd.entity_id,\
\ 'watcher') + \")\" %} {%- else %} {%- set name = iif(state_attr(upd.entity_id,\
\ 'title') == \"null\", state_attr(upd.entity_id, 'title'), state_attr(upd.entity_id,\
\ 'friendly_name')) %} {%- endif %} - {{name}}: {{state_attr(upd.entity_id,\
\ 'installed_version')}} -> {{state_attr(upd.entity_id, 'latest_version')}}\
\ {% endif %} {%- endfor %}"
- alias: UPS Power Failure
id: ups_power_failure
trigger:
entity_id: sensor.ups_status
trigger: state
to: On Battery Battery Discharging
condition: []
action:
- action: notify.alert
data:
title: Power Failure!
message: HA UPS Status - On Battery Battery Discharging
data:
tag: ups_power_failure
notification_id: ups_power_failure
push:
badge: 1
sound: none
interruption-level: time-sensitive
presentation_options:
- alert
- badge
group: alerts
actions:
- title: Pause Alert
action: pause_alert_updates_available
- action: input_boolean.turn_on
data: {}
entity_id: input_boolean.ups_on_batteries
- alias: UPS Power restored battery charging
id: ups_power_restored
trigger:
entity_id: sensor.ups_status
trigger: state
from: On Battery Battery Discharging
to: Online Battery Charging
condition: []
action:
- action: notify.alert
data:
title: Power Restored
message: HA UPS Status - Online Battery Charging
data:
tag: ups_power_restored
notification_id: ups_power_restored
push:
badge: 1
sound: none
interruption-level: time-sensitive
presentation_options:
- alert
- badge
group: alerts
actions:
- title: Pause Alert
action: pause_alert_updates_available
- action: input_boolean.turn_off
data: {}
entity_id: input_boolean.ups_on_batteries
- id: bedtime_disable_voice
alias: Bedtime - Disable Voice
trigger:
- trigger: state
entity_id: input_boolean.bedtime
to: 'on'
for: 00:01:00
action:
- action: input_boolean.turn_off
entity_id: input_boolean.voice_enabled
- id: water_pump_charger_on
alias: Water Pump Charger On
trigger:
- trigger: time
at: 02:00:00
condition:
- condition: time
weekday:
- mon
action:
- action: switch.turn_on
entity_id: switch.water_pump_outlet
- id: water_pump_charger_off
alias: Water Pump Charger Off
mode: single
trigger:
- trigger: state
entity_id: switch.water_pump_outlet
to: 'on'
for: '1:00:00'
condition:
- condition: state
entity_id: switch.water_pump_outlet
state: 'on'
action:
- action: switch.turn_off
target:
entity_id: switch.water_pump_outlet
- alias: Cold Weather Alerts
trigger:
- trigger: time
at: 07:00:00
action:
- action: notify.pushover
data:
message: "{% set dates = state_attr('weather.home', 'forecast') %} {% set ns\
\ = namespace(message = '') %} {% for i in range(1, dates | count, 1) %} {%\
\ if state_attr('weather.home','forecast')[i].templow | int < 40 %}\n {##Freeze\
\ Check: {{ as_datetime(state_attr('weather.home','forecast')[i].datetime).strftime('%a')\
\ }}: Low Temp: {{ state_attr('weather.home','forecast')[i].templow | int}}##}\n\
\ {% set ns.message = ns.message ~ as_datetime(state_attr('weather.home','forecast')[i].datetime).strftime('%a')\
\ ~ \" Low Temp:\" ~ state_attr('weather.home','forecast')[i].templow ~ \"\
\\n\" %}\n{%- endif %} {% endfor %} {{ns.message}}"
title: Pollen Levels