449 lines
12 KiB
YAML
449 lines
12 KiB
YAML
- id: c9e5b5d8-3d97-404c-8158-50956278fb72
|
|
alias: Alarm Notify
|
|
triggers:
|
|
trigger: state
|
|
entity_id: alarm_control_panel.alarm
|
|
to: triggered
|
|
actions:
|
|
parallel:
|
|
- action: notify.notify
|
|
data:
|
|
message: The alarm has been triggered
|
|
- action: light.turn_on
|
|
entity_id: all
|
|
trace:
|
|
stored_traces: 20
|
|
- id: 5350a641-9769-4587-b0a0-3dd2ba6d0fd3
|
|
alias: Alarm Trigger
|
|
triggers:
|
|
trigger: state
|
|
entity_id:
|
|
- binary_sensor.back_door
|
|
- binary_sensor.dining_room_sliding_door
|
|
- binary_sensor.front_door
|
|
- binary_sensor.living_room_sliding_door
|
|
to: 'on'
|
|
conditions:
|
|
condition: state
|
|
entity_id: alarm_control_panel.alarm
|
|
state: armed_away
|
|
actions:
|
|
action: alarm_control_panel.alarm_trigger
|
|
entity_id: alarm_control_panel.alarm
|
|
trace:
|
|
stored_traces: 20
|
|
- id: 7a14e9b0-b1ea-43da-9057-fcd7be8c66c3
|
|
alias: Arriving Home
|
|
triggers:
|
|
trigger: state
|
|
entity_id: group.family
|
|
from: not_home
|
|
to: home
|
|
conditions:
|
|
condition: sun
|
|
after: sunset
|
|
actions:
|
|
- parallel:
|
|
- action: scene.turn_on
|
|
entity_id: scene.arriving_home
|
|
- wait_for_trigger:
|
|
trigger: state
|
|
entity_id: binary_sensor.front_door
|
|
from: 'off'
|
|
to: 'on'
|
|
timeout: 900
|
|
continue_on_timeout: false
|
|
- wait_for_trigger:
|
|
trigger: state
|
|
entity_id: binary_sensor.front_door
|
|
from: 'on'
|
|
to: 'off'
|
|
timeout: 300
|
|
- delay: 300
|
|
- action: light.turn_off
|
|
entity_id: light.outside_wall
|
|
mode: single
|
|
- id: 05cfb2f2-6f36-498f-a321-88756cfe534d
|
|
alias: Attic Fan
|
|
triggers:
|
|
- trigger: numeric_state
|
|
id: low
|
|
entity_id: sensor.attic_temperature
|
|
below: 25
|
|
variables:
|
|
action: fan.turn_off
|
|
- trigger: numeric_state
|
|
id: high
|
|
entity_id: sensor.attic_temperature
|
|
above: 30
|
|
variables:
|
|
action: fan.turn_on
|
|
actions:
|
|
action: '{{ action }}'
|
|
target:
|
|
area_id: attic
|
|
mode: single
|
|
- id: d66c61c9-1819-4909-bf49-accb40fadfea
|
|
alias: Basement Dehumidifier
|
|
triggers:
|
|
trigger: state
|
|
entity_id:
|
|
- sensor.basement_humidity
|
|
- sensor.outside_humidity
|
|
conditions:
|
|
condition: template
|
|
value_template: '{{ (as_timestamp(now()) - as_timestamp(state_attr("automation.basement_dehumidifier",
|
|
"last_triggered")) | int(0)) > 1800 }}'
|
|
actions:
|
|
choose:
|
|
- conditions:
|
|
condition: numeric_state
|
|
entity_id: sensor.basement_humidity
|
|
below: 40
|
|
sequence:
|
|
action: switch.turn_off
|
|
entity_id:
|
|
- switch.basement_primary_dehumidifier
|
|
- switch.basement_secondary_dehumidifier
|
|
- conditions:
|
|
condition: numeric_state
|
|
entity_id: sensor.basement_humidity
|
|
above: 80
|
|
sequence:
|
|
action: switch.turn_on
|
|
entity_id:
|
|
- switch.basement_primary_dehumidifier
|
|
- switch.basement_secondary_dehumidifier
|
|
- conditions:
|
|
condition: numeric_state
|
|
entity_id: sensor.basement_humidity
|
|
above: sensor.outside_humidity
|
|
sequence:
|
|
parallel:
|
|
- action: switch.turn_on
|
|
entity_id: switch.basement_primary_dehumidifier
|
|
- action: switch.turn_off
|
|
entity_id: switch.basement_secondary_dehumidifier
|
|
- conditions:
|
|
condition: numeric_state
|
|
entity_id: sensor.basement_humidity
|
|
below: sensor.outside_humidity
|
|
sequence:
|
|
action: switch.turn_off
|
|
entity_id:
|
|
- switch.basement_primary_dehumidifier
|
|
- switch.basement_secondary_dehumidifier
|
|
mode: single
|
|
max_exceeded: silent
|
|
trace:
|
|
stored_traces: 20
|
|
- id: 31c797b8-4353-4bd6-b4b8-d185c6e963f0
|
|
alias: Day Lighting
|
|
triggers:
|
|
trigger: sun
|
|
event: sunrise
|
|
actions:
|
|
- scene: scene.day_time
|
|
- action: light.turn_on
|
|
target:
|
|
entity_id:
|
|
- light.hallway
|
|
- light.toilet
|
|
data:
|
|
brightness: 255
|
|
- action: light.turn_off
|
|
target:
|
|
entity_id:
|
|
- light.hallway
|
|
- light.toilet
|
|
- alias: Device Offline
|
|
id: 7fa5aace-5294-4181-a6f3-4720b1fe1fde
|
|
triggers:
|
|
trigger: state
|
|
entity_id: sensor.unavailable_devices
|
|
not_to: unavailable
|
|
actions:
|
|
- delay: 5
|
|
- choose:
|
|
conditions:
|
|
- condition: numeric_state
|
|
entity_id: sensor.unavailable_devices
|
|
below: 1
|
|
- condition: numeric_state
|
|
entity_id: sensor.unavailable_devices
|
|
value_template: '{{ state.attributes.entities | count }}'
|
|
below: 1
|
|
sequence:
|
|
action: script.mobile_app_clear_notification
|
|
data:
|
|
target: josh_phone
|
|
tag: devices-offline
|
|
default:
|
|
action: script.mobile_app_notify
|
|
data:
|
|
target: josh_phone
|
|
title: Devices Offline
|
|
subtitle: '{{ states(''sensor.unavailable_devices'') }} {{ is_state(''sensor.unavailable_devices'',
|
|
''1'') | iif(''device is'', ''devices are'') }} offline.'
|
|
message: '{% for device, entities in state_attr(''sensor.unavailable_devices'',
|
|
''devices'').items() -%} - {{ device_attr(device, ''name_by_user'') | default(device_attr(device,
|
|
''name''), true) }} {% endfor %} {% for entity in state_attr(''sensor.unavailable_devices'',
|
|
''entities'') -%} - {{ entity }} {% endfor %}'
|
|
channel: Device Offline
|
|
icon: mdi:lan-disconnect
|
|
persistent: true
|
|
sticky: true
|
|
tag: devices-offline
|
|
url: entityId:sensor.unavailable_devices
|
|
mode: restart
|
|
trace:
|
|
stored_traces: 10
|
|
- id: e672aca4-7227-422f-b4e5-af477cb67cbf
|
|
alias: Device Registry Notification
|
|
triggers:
|
|
trigger: event
|
|
event_type: device_registry_updated
|
|
event_data:
|
|
action: create
|
|
variables:
|
|
device_id: '{{ trigger.event.data.device_id }}'
|
|
actions:
|
|
action: persistent_notification.create
|
|
data:
|
|
title: New device registered
|
|
message: '[{{ device_attr(device_id, ''name_by_user'') | default(device_attr(device_id,
|
|
''name''), true) }}](/config/devices/device/{{device_id}}) was added to the
|
|
device registry.'
|
|
notification_id: device_registry_{{ device_id }}
|
|
mode: parallel
|
|
- alias: Leaving Home
|
|
id: b6b9bdb0-b60f-4de0-91b0-c545ad0b0f06
|
|
triggers:
|
|
trigger: state
|
|
entity_id: group.family
|
|
from: home
|
|
to: not_home
|
|
actions:
|
|
- action: light.turn_off
|
|
entity_id: all
|
|
- action: climate.turn_off
|
|
entity_id: climate.aircon
|
|
mode: single
|
|
- alias: Let's Encrypt Certificate Renewal
|
|
id: 94d091f3-9e9d-49d8-a192-a6cb7ca679bd
|
|
triggers:
|
|
trigger: time
|
|
at: 00:00:00
|
|
conditions:
|
|
condition: template
|
|
value_template: '{{ (as_datetime(states(''sensor.homeassistant_certificate_expiry''))
|
|
- now()).days < 7 }}'
|
|
actions:
|
|
- action: hassio.addon_start
|
|
data:
|
|
addon: core_letsencrypt
|
|
- alias: Wait for addon to start
|
|
wait_for_trigger:
|
|
trigger: state
|
|
entity_id: binary_sensor.lets_encrypt_addon_running
|
|
to: 'on'
|
|
timeout: 5
|
|
- alias: Wait for addon to stop
|
|
wait_for_trigger:
|
|
trigger: state
|
|
entity_id: binary_sensor.lets_encrypt_addon_running
|
|
to: 'off'
|
|
timeout: 120
|
|
- action: hassio.addon_restart
|
|
data:
|
|
addon: core_nginx_proxy
|
|
- action: homeassistant.update_entity
|
|
data:
|
|
entity_id: sensor.homeassistant_certificate_expiry
|
|
- alias: Low Battery
|
|
id: 685c0eb4-1d80-4ca3-8b5f-46a5e4e20c27
|
|
triggers:
|
|
trigger: state
|
|
entity_id: sensor.low_battery
|
|
actions:
|
|
if:
|
|
condition: numeric_state
|
|
entity_id: sensor.low_battery
|
|
below: 1
|
|
then:
|
|
action: script.mobile_app_clear_notification
|
|
data:
|
|
target: josh_phone
|
|
tag: low-battery
|
|
else:
|
|
action: script.mobile_app_notify
|
|
data:
|
|
target: josh_phone
|
|
title: Low Battery
|
|
message: '{{ states(''sensor.low_battery'') }} devices with low battery.
|
|
|
|
{% for entity in state_attr(''sensor.low_battery'', ''entities'') -%} -
|
|
{{ entity }} {% endfor %}'
|
|
tag: low-battery
|
|
mode: restart
|
|
- id: ffb89ef2-6be4-4625-9e12-953d23b5b4a7
|
|
alias: Low Storage
|
|
triggers:
|
|
trigger: numeric_state
|
|
entity_id: sensor.disk_use_percent
|
|
above: '90'
|
|
actions:
|
|
action: script.mobile_app_notify
|
|
data:
|
|
target: josh_phone
|
|
message: '{{ trigger.to_state.state }}'
|
|
title: Low Storage
|
|
- id: 4f1d6cb3-b8fb-42d1-a0fc-b90eee1bf7a5
|
|
alias: Mail Delivery
|
|
triggers:
|
|
trigger: state
|
|
entity_id: binary_sensor.mailbox_top_door
|
|
from: 'off'
|
|
to: 'on'
|
|
conditions:
|
|
condition: time
|
|
after: 08:00:00
|
|
before: '18:00:00'
|
|
weekday:
|
|
- mon
|
|
- tue
|
|
- wed
|
|
- thu
|
|
- fri
|
|
actions:
|
|
action: script.mobile_app_notify
|
|
data:
|
|
target: josh_phone
|
|
title: Mailbox Activity
|
|
message: Mailbox door was opened.
|
|
tag: mail-delivery
|
|
- alias: Zigbee2MQTT Health Check
|
|
id: e6dc7aa0-14e9-4750-80a0-cb05da0c459c
|
|
triggers:
|
|
trigger: time_pattern
|
|
minutes: '*'
|
|
actions:
|
|
action: mqtt.publish
|
|
data:
|
|
topic: zigbee2mqtt/bridge/request/health_check
|
|
trace:
|
|
stored_traces: 0
|
|
- id: a7cf20d9-3be3-4b9d-8cb0-67652ebe48ae
|
|
alias: Smoke Alarm
|
|
triggers:
|
|
trigger: state
|
|
entity_id:
|
|
- binary_sensor.carbon_monoxide_alarm
|
|
- binary_sensor.heat_alarm
|
|
- binary_sensor.smoke_alarm
|
|
to: 'on'
|
|
actions:
|
|
action: script.mobile_app_notify
|
|
data:
|
|
target:
|
|
- josh_phone
|
|
- lily_phone
|
|
title: '{{ trigger.to_state.attributes.friendly_name }}'
|
|
url: entityId:{{ trigger.entity_id }}
|
|
- id: 595cc2f2-ac5d-4447-a995-5d6e71327141
|
|
alias: Netgear SMS
|
|
triggers:
|
|
- trigger: event
|
|
event_type: netgear_lte_sms
|
|
id: receive
|
|
- trigger: event
|
|
event_type: mobile_app_notification_action
|
|
event_data:
|
|
action: netgear_lte.delete_sms
|
|
id: delete
|
|
actions:
|
|
choose:
|
|
- conditions:
|
|
condition: trigger
|
|
id: receive
|
|
sequence:
|
|
action: script.mobile_app_notify
|
|
data:
|
|
target: josh_phone
|
|
title: SMS Message Received
|
|
subtitle: '{{ trigger.event.data.from }}'
|
|
message: '{{ trigger.event.data.message }}'
|
|
actions:
|
|
- action: URI
|
|
title: Open
|
|
uri: http://{{ trigger.event.data.host }}#messaging/{{ trigger.event.data.sms_id
|
|
}}
|
|
- action: netgear_lte.delete_sms
|
|
title: Delete
|
|
uri: '{{ trigger.event.data.sms_id }}'
|
|
channel: Netgear LTE SMS
|
|
group: netgear_lte
|
|
icon: mdi:message-text
|
|
- conditions:
|
|
condition: trigger
|
|
id: delete
|
|
sequence:
|
|
action: netgear_lte.delete_sms
|
|
data:
|
|
sms_id: '{{ trigger.event.data.action_2_uri }}'
|
|
- alias: Speedtest Unavailable
|
|
id: c142089f-4826-4de4-b813-c188885e874f
|
|
triggers:
|
|
trigger: state
|
|
entity_id: &id001
|
|
- sensor.speedtest_download
|
|
- sensor.speedtest_ping
|
|
- sensor.speedtest_upload
|
|
to: unavailable
|
|
for: 60
|
|
conditions:
|
|
condition: state
|
|
entity_id: *id001
|
|
state: unavailable
|
|
actions:
|
|
action: homeassistant.update_entity
|
|
target:
|
|
entity_id: *id001
|
|
mode: restart
|
|
- id: 116e3a13-2dfa-4199-9fcb-982d1f6708da
|
|
alias: Living Room TV Sleep
|
|
triggers:
|
|
trigger: state
|
|
entity_id: media_player.living_room_tv
|
|
to:
|
|
- idle
|
|
- standby
|
|
for: 600
|
|
actions:
|
|
action: media_player.turn_off
|
|
entity_id: media_player.living_room_tv
|
|
- id: a7e693d8-45df-4f2a-85e4-b0fa7cf6a682
|
|
alias: Water Leak
|
|
triggers:
|
|
trigger: state
|
|
entity_id:
|
|
- binary_sensor.bathroom_sink_water_leak
|
|
- binary_sensor.dishwasher_water_leak
|
|
- binary_sensor.kitchen_sink_water_leak
|
|
- binary_sensor.spa_bath_water_leak
|
|
- binary_sensor.toilet_sink_water_leak
|
|
from: 'off'
|
|
to: 'on'
|
|
actions:
|
|
action: script.mobile_app_notify
|
|
data:
|
|
target: josh_phone
|
|
title: Water Leak
|
|
subtitle: '{{ area_name(trigger.entity_id) }}'
|
|
message: Water leak detected by {{ trigger.to_state.attributes.friendly_name
|
|
}} sensor.
|
|
tag: water-leak
|
|
url: entityId:{{ trigger.entity_id }}
|
|
trace:
|
|
stored_traces: 20
|