AutomationDataset/epleypa/epleypa_automations.yaml

1434 lines
41 KiB
YAML

- id: wake_up
alias: Wake Up
trigger:
- platform: template
value_template: '{{ states(''sensor.time'') == states(''sensor.alarm_time'') }}'
condition:
- condition: or
conditions:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.alarmweekday
state: 'on'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
before: 00:00:00
after: 00:00:00
- condition: state
entity_id: input_boolean.alarmweekday
state: 'off'
action:
- service: light.turn_on
data:
brightness_pct: 25
target:
entity_id: light.under_bed_lights
- delay:
hours: 0
minutes: 30
seconds: 0
milliseconds: 0
- service: light.turn_on
data:
brightness_pct: 100
target:
entity_id:
- group.office_lights
- service: notify.discord
data_template:
target: '814328602270498817'
message: "{# Deliveries Sentence #}\n {% macro deliveries_sentence() -%}\n\
\ {%- if states(\"sensor.mail_usps_mail\")|int(0) == 0 -%}\n \
\ No\n {%- else -%}\n {{states(\"sensor.mail_usps_mail\"\
)|int(0)}}\n {%- endif -%}\n {{' '}} \n {%- if states(\"\
sensor.mail_usps_mail\")|int(0) == 0 -%}\n mail\n {%- elif\
\ states(\"sensor.mail_usps_mail\")|int(0) == 1 -%}\n piece of mail\n\
\ {%- else -%}\n pieces of mail\n {%- endif -%}\n \
\ {{' '}}will be delivered.{{' '}} \n {%- if states(\"sensor.mail_packages_in_transit\"\
)|int(0) == 0 -%}\n No\n {%- else -%}\n {{states(\"\
sensor.mail_packages_in_transit\")|int(0)}}\n {%- endif -%}\n \
\ {{' '}} \n {%- if states(\"sensor.mail_packages_in_transit\")|int(0)\
\ == 1 -%}\n package is\n {%- else -%}\n packages\
\ are\n {%- endif -%}\n {{' '}}in transit.{{' '}}\n {%- endmacro\
\ %}\n{{deliveries_sentence()}}"
data:
embed:
title: Package Status
description: "{# Deliveries Sentence #}\n {% macro deliveries_sentence()\
\ -%}\n {%- if states(\"sensor.mail_usps_mail\")|int(0) == 0 -%}\n\
\ No\n {%- else -%}\n {{states(\"sensor.mail_usps_mail\"\
)|int(0)}}\n {%- endif -%}\n {{' '}} \n {%- if states(\"\
sensor.mail_usps_mail\")|int(0) == 1 -%}\n letter\n {%-\
\ else -%}\n letters\n {%- endif -%}\n {{' '}}will\
\ be delivered.{{' '}} \n {%- if states(\"sensor.mail_usps_delivering\"\
)|int(0) == 0 -%}\n No\n {%- else -%}\n {{states(\"\
sensor.mail_usps_delivering\")|int(0)}}\n {%- endif -%}\n \
\ {{' '}} \n {%- if states(\"sensor.mail_usps_delivering\")|int(0)\
\ == 1 -%}\n USPS package\n {%- else -%}\n USPS\
\ packages\n {%- endif -%}\n {{' '}}\n{{''}}\n {%-\
\ if states(\"sensor.mail_fedex_delivering\")|int(0) == 0 -%}\n \
\ No\n {%- else -%}\n {{states(\"sensor.mail_fedex_delivering\"\
)|int(0)}}\n {%- endif -%}\n {{' '}} \n {%- if states(\"\
sensor.mail_fedex_delivering\")|int(0) == 1 -%}\n FedEx package\n\
\ {%- else -%}\n Fedex packages\n {%- endif -%}\n\
\ {{' '}}\n{{''}}\n {%- if states(\"sensor.mail_ups_delivering\"\
)|int(0) == 0 -%}\n No\n {%- else -%}\n {{states(\"\
sensor.mail_ups_delivering\")|int(0)}}\n {%- endif -%}\n {{'\
\ '}} \n {%- if states(\"sensor.mail_ups_delivering\")|int(0) ==\
\ 1 -%}\n UPS package\n {%- else -%}\n UPS packages\n\
\ {%- endif -%}\n {{' '}}\n{{''}}\n {%- if states(\"\
sensor.mail_amazon_packages\")|int(0) == 0 -%}\n No\n \
\ {%- else -%}\n {{states(\"sensor.mail_amazon_packages\")|int(0)}}\n\
\ {%- endif -%}\n {{' '}} \n {%- if states(\"sensor.mail_amazon_packages\"\
)|int(0) == 1 -%}\n Amazon package\n {%- else -%}\n \
\ Amazon packages\n {%- endif -%}\n {{' '}}{{' '}}\n\
\ {%- endmacro %}\n{{deliveries_sentence()}}"
thumbnail:
url: https://brands.home-assistant.io/mail_and_packages/logo.png
footer:
text: Mail and Packages
mode: single
- id: later
alias: See You Later
trigger:
- entity_id: alarm_control_panel.10th_street
platform: state
to: armed_home
for: 0:20:00
- entity_id: alarm_control_panel.10th_street
platform: state
to: armed_away
action:
- service: homeassistant.turn_off
target:
entity_id: group.home_lights
mode: single
- id: fan
alias: Fan
trigger:
- platform: time_pattern
hours: /1
- platform: state
entity_id: fan.hvac_fan
to: 'on'
for:
hours: 1
minutes: 0
seconds: 0
condition:
- condition: and
conditions:
- condition: state
entity_id: group.family
state: home
action:
- data: {}
service: fan.turn_on
target:
entity_id: fan.hvac_fan
- delay:
hours: 0
minutes: 15
seconds: 0
milliseconds: 0
- service: fan.turn_off
target:
entity_id: fan.hvac_fan
data: {}
mode: single
- id: workday
alias: Workday
trigger:
- at: 08:30:00
platform: time
- at: '17:30:00'
platform: time
condition:
- condition: state
entity_id: binary_sensor.workday
state: 'on'
action:
- service: '{% if now().strftime(''%H:%M:%S'') <= ''12:00:00'' %}input_boolean.turn_off
{% else %}input_boolean.turn_on{% endif %}'
entity_id: input_boolean.voice_notifications
mode: single
- id: humidfier
alias: Humidifier
trigger:
- platform: template
value_template: '{{ states(''sensor.time'') == states(''sensor.alarm_time'') }}'
- platform: time
at: '22:00:00'
action:
- service: '{% if now().strftime(''%H:%M:%S'') >= ''12:00:00'' %}humidifier.turn_on
{% else %}humidifier.turn_off {% endif %}'
entity_id: humidifier.bedroom_humidifier
- id: ledweather
alias: LED Weather
trigger:
- platform: state
entity_id: weather.kdca_daynight
action:
- service: light.turn_on
entity_id: light.living_room_led, light.office_led, light.bedroom_led
data_template:
color_name: '{% if "clear" in states.weather.kdca_daynight.state %}yellow {%-elif
"cloudy" in states.weather.kdca_daynight.state %}purple {%-elif "overcast"
in states.weather.kdca_daynight.state %}purple {%-elif "fog" in states.weather.kdca_daynight.state
%}blue {%-elif "rain" in states.weather.kdca_daynight.state %}blue {%-elif
"wind" in states.weather.kdca_daynight.state %}cyan {%-elif "ice" in states.weather.kdca_daynight.state
%}cyan {%-elif "snow" in states.weather.kdca_daynight.state %}cyan {%-elif
"thunderstorm" in states.weather.kdca_daynight.state %}red {%-elif "hail"
in states.weather.kdca_daynight.state %}cyan {%-elif "tornado" in states.weather.kdca_daynight.state
%}red {%-else %}white {% endif %}'
- service: light.turn_off
entity_id: light.living_room_led, light.office_led, light.bedroom_led
- id: hassstart
alias: HASS Reload
trigger:
- event: start
platform: homeassistant
id: start
- event_data:
domain: automation
service: reload
event_type: call_service
platform: event
action:
- delay: 0:00:02
- entity_id: switch.neo
service: switch.turn_on
- data:
color_temp: 369
service: light.turn_on
target:
entity_id:
- light.office_light
- light.storage_light
- data:
rgb_color:
- 255
- 255
- 255
service: light.turn_on
target:
entity_id:
- light.living_room_led
- light.office_led
- light.bedroom_led
- data:
color_name: blueviolet
entity_id: light.tv_backlight
service: light.turn_on
- delay: 00:00:02
- service: light.turn_off
target:
entity_id:
- light.living_room_led
- light.office_led
- light.bedroom_led
- light.storage_light
- light.office_light
- light.tv_backlight
data: {}
- data: {}
entity_id: automation.information_alert
service: automation.turn_on
- if:
- condition: trigger
id:
- start
then:
- service: notify.discord
data:
message: Home Assistant has Restarted
target: '814328602270498817'
mode: single
- id: ledmotion
alias: LED Motion
trigger:
- platform: state
entity_id: binary_sensor.living_room_motion, binary_sensor.bedroom_motion, binary_sensor.office_motion
to: 'on'
condition:
- condition: time
after: 06:00:00
before: '23:00:00'
action:
- service: light.turn_on
entity_id: light.living_room_led, light.office_led, light.bedroom_led
- delay: 00:00:01
- service: light.turn_off
entity_id: light.living_room_led, light.office_led, light.bedroom_led
mode: single
- id: motionless
alias: Motionless
trigger:
- entity_id: binary_sensor.living_room_motion
for: 02:00:00
platform: state
to: 'off'
- entity_id: binary_sensor.bedroom_motion
for: 01:00:00
platform: state
to: 'off'
condition:
- condition: time
after: 00:00:00
- condition: sun
before: sunset
action:
- data_template:
entity_id: "{% if trigger.entity_id == 'binary_sensor.bedroom_motion' %}\n \
\ group.bedroom_lights\n{% elif trigger.entity_id == 'binary_sensor.living_room_motion'\
\ %}\n group.living_room_lights\n{% endif %}\n"
service: homeassistant.turn_off
mode: single
max: 10
- id: plex
alias: Plex Wake
trigger:
- platform: time_pattern
minutes: /59
condition:
- condition: and
conditions:
- condition: time
after: '18:58:00'
before: 00:00:00
action:
- service: switch.turn_on
entity_id: switch.neo
- service: logbook.log
data:
name: Wake Plex
message: has woke Neo
mode: single
- id: ifttt_remote
alias: IFTTT - Send Remote
trigger:
- event_data:
action: call_service
event_type: ifttt_webhook_received
platform: event
condition:
- condition: template
value_template: '{% if trigger.event.data.service == ''remote.send_command'' %}true{%endif
%}'
action:
- data_template:
command: '{% set source = trigger.event.data.command|lower %} {% if source ==
"cable" %}cm2 {% elif source == "roku" %}hdmi3 {% elif source == "chromecast"
%}hdmi4 {% elif source == "switch" %}hdmi1 {% elif source == "xbox" %}hdmi2
{% endif %}'
device: '{{ trigger.event.data.device|lower }}'
entity_id: '{{ trigger.event.data.entity_id|lower }}'
service: '{{ trigger.event.data.service }}'
- id: ifttt_tracker
alias: IFTTT - Device Tracker
trigger:
- event_data:
action: call_service
event_type: ifttt_webhook_received
platform: event
condition:
- condition: template
value_template: '{% if trigger.event.data.service == ''device_tracker.see'' %}true{%
endif %}'
action:
- data_template:
dev_id: '{{ trigger.event.data.dev_id | lower | replace(" ","_") }}'
location_name: '{{ trigger.event.data.location_name|lower }}'
service: '{{ trigger.event.data.service }}'
mode: single
- id: ifttt
alias: IFTTT Webhook
trigger:
- event_data:
action: call_service
event_type: ifttt_webhook_received
platform: event
condition:
- condition: template
value_template: '{% if trigger.event.data.service != ''remote.send_command'' and
trigger.event.data.service != ''device_tracker.see'' %}true{% endif %}'
action:
- data_template:
entity_id: '{{ trigger.event.data.entity_id|lower }}'
service: '{{ trigger.event.data.service }}'
- id: tvsource
alias: Change TV Source
trigger:
- entity_id: input_select.living_room_tv_source
platform: state
action:
- data_template:
command: '{% set source = states(''input_select.living_room_tv_source'') | lower
%} {% if source == "cable" %}cm2 {% elif source == "roku" %}hdmi3 {% elif
source == "chromecast" %}hdmi4 {% elif source == "switch" %}hdmi1 {% elif
source == "xbox" %}hdmi2 {% endif %}'
device: television
entity_id: remote.broadlink
num_repeats: 5
service: remote.send_command
- id: changechannel
alias: Change Channel
trigger:
- platform: state
entity_id: input_select.cable_channel
action:
- service: remote.send_command
data_template:
entity_id: remote.broadlink
device: cable
command: '{% set indexes = states.input_select.cable_channel.state.split(''
'')[0] %} {{ indexes[0] | int }}
'
- condition: template
value_template: '{% set indexes = states.input_select.cable_channel.state.split(''
'')[0] %} {{ indexes | count >= 2 }}
'
- delay:
milliseconds: 500
- service: remote.send_command
data_template:
entity_id: remote.broadlink
device: cable
command: '{% set indexes = states.input_select.cable_channel.state.split(''
'')[0] %} {{ indexes[1] | int }}
'
- condition: template
value_template: '{% set indexes = states.input_select.cable_channel.state.split(''
'')[0] %} {{ indexes | count >= 3 }}
'
- delay:
milliseconds: 500
- service: remote.send_command
data_template:
entity_id: remote.broadlink
device: cable
command: '{% set indexes = states.input_select.cable_channel.state.split(''
'')[0] %} {{ indexes[2] | int }}
'
- id: changeroute
alias: Change Route
trigger:
- platform: state
entity_id: input_select.destination
- platform: state
entity_id: input_select.origin
action:
- service: input_boolean.turn_on
entity_id: input_boolean.update_route
- service: homeassistant.update_entity
data:
entity_id: sensor.via_driving
- service: homeassistant.update_entity
data:
entity_id: sensor.via_metro
- service: homeassistant.update_entity
data:
entity_id: sensor.via_bus
- id: updateroute
alias: Update Route
trigger:
- platform: state
entity_id: input_boolean.update_route
to: 'on'
action:
- delay: 00:30
- service: input_boolean.turn_off
entity_id: input_boolean.update_route
- id: dailyroute
alias: Daily Route
trigger:
- platform: time
at: 08:00:00
- platform: time
at: '16:00:00'
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
before: 00:00:00
after: 00:00:00
action:
- service: input_select.select_option
data_template:
entity_id: input_select.origin
option: ' {% if now().hour|int > 12 %}Peter DC Office {% else %}Home {% endif
%}'
- service: input_select.select_option
data_template:
entity_id: input_select.destination
option: ' {% if now().hour|int > 12 %}Home {% else %}Peter DC Office {% endif
%}'
- service: input_boolean.turn_on
entity_id: input_boolean.update_route
- delay: 00:45
- service: input_boolean.turn_off
entity_id: input_boolean.update_route
- id: updatecommute
alias: Update Commute
trigger:
- platform: time_pattern
minutes: /2
condition:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.update_route
state: 'on'
action:
- service: homeassistant.update_entity
data:
entity_id: sensor.via_driving
- service: homeassistant.update_entity
data:
entity_id: sensor.via_metro
- service: homeassistant.update_entity
data:
entity_id: sensor.via_bus
mode: restart
- id: updateavailable
alias: Update Available
trigger:
- platform: state
entity_id:
- binary_sensor.docker_hub_update_available
to: 'on'
action:
- service: notify.persistent_notification
data_template:
title: New Home Assistant Release
message: Home Assistant {{ states('sensor.docker_hub_version') }} is now available
- service: notify.discord
data_template:
message: Home Assistant {{ states('sensor.docker_hub_version') }} is now available
target: '814328602270498817'
mode: single
- id: emergencyalert
alias: Emergency Alert
trigger:
- event_type: state_changed
platform: event
condition:
- condition: or
conditions:
- condition: template
value_template: '{% if ''_leak_sensor_water'' in trigger.event.data.entity_id
and trigger.event.data.new_state.state == ''on'' %}True{% endif %}'
- condition: template
value_template: '{% if ''_alarm'' in trigger.event.data.entity_id and trigger.event.data.new_state.state
== ''on'' %}True{% endif %}'
action:
- data_template:
message: '{{ trigger.event.data.new_state.attributes.friendly_name | replace("_",
"\_") }} is {{ trigger.event.data.new_state.state | replace("_", "\_") }}'
service: telegram_bot.send_message
- entity_id: media_player.home_speakers
service: media_player.turn_on
- data_template:
entity_id: media_player.home_speakers
volume_level: 0.6
service: media_player.volume_set
- data_template:
cache: false
message: '{{ trigger.event.data.new_state.attributes.friendly_name | replace("_",
"\_") }} is {{ trigger.event.data.new_state.state | replace("_", "\_") }}'
entity_id: media_player.home_speakers
service: tts.google_cloud_say
- choose:
- conditions:
- condition: template
value_template: '{% for state in states.binary_sensor -%}{% if "alarm" in
state.name | lower and state.state == "on" %}True{% endif %}{%- endfor %}'
sequence:
- service: homeassistant.turn_on
target:
entity_id: group.home_lights
default: []
- data_template:
target: '814328602270498817'
message: '{{ trigger.event.data.new_state.attributes.friendly_name | replace("_",
"\_") }} is {{ trigger.event.data.new_state.state | replace("_", "\_") }}'
service: notify.discord
mode: single
- id: infoalert
alias: Information Alert
triggers:
- entity_id: binary_sensor.mailbox_contact
from: 'off'
to: 'on'
trigger: state
- entity_id: binary_sensor.dryer_status
from: 'on'
to: 'off'
trigger: state
- entity_id: binary_sensor.washer_status
from: 'on'
to: 'off'
trigger: state
- entity_id: binary_sensor.trash
to: 'on'
trigger: state
- entity_id: binary_sensor.recycle
to: 'on'
trigger: state
- entity_id: binary_sensor.street_sweeping
to: 'on'
trigger: state
- entity_id:
- switch.amcrest_dining_room_privacy_mode
id: privacy_dining_room
trigger: state
- entity_id:
- switch.amcrest_office_privacy_mode
id: privacy_office
trigger: state
- entity_id: person.peter
zone: zone.peter_dc_office
event: leave
trigger: zone
- entity_id: person.kelley
zone: zone.kelley_office
event: leave
trigger: zone
- entity_id:
- switch.peter_table_light
- switch.kelley_table_light
- camera.cat_bed_camera
to: unavailable
trigger: state
- entity_id: binary_sensor.bedroom_humidifier_out_of_water
to: 'on'
trigger: state
conditions: []
actions:
- choose:
- conditions:
- condition: template
value_template: '{% if trigger.entity_id == "binary_sensor.dryer_status" %}True{%
endif %}'
sequence:
- data:
message: The dryer is done
target: '814328602270498817'
action: notify.discord
- conditions:
- condition: template
value_template: '{% if trigger.entity_id == "binary_sensor.washer_status"
%}True{% endif %}'
sequence:
- data:
message: The washer is done
target: '814328602270498817'
action: notify.discord
- conditions:
- condition: template
value_template: '{% if trigger.entity_id == "binary_sensor.mailbox_contact"
%}True{% endif %}'
sequence:
- data:
message: The mail has arrived!
target: '814328602270498817'
action: notify.discord
- conditions:
- condition: template
value_template: '{% if trigger.entity_id == "binary_sensor.trash" or trigger.entity_id
== "binary_sensor.recycle" or trigger.entity_id == "binary_sensor.street_sweeping"
%}True{% endif %}'
sequence:
- data_template:
message: Tomorrow is {{ trigger.to_state.attributes.friendly_name }} day!
target: '814328602270498817'
action: notify.discord
- conditions:
- condition: template
value_template: '{% if trigger.entity_id == "person.peter" or trigger.entity_id
== "person.kelley" %}True{% endif %}'
sequence:
- data_template:
message: '{{ trigger.to_state.attributes.friendly_name }} has left {{ trigger.from_state.state
}}'
target: '814328602270498817'
action: notify.discord
- conditions:
- condition: template
value_template: '{% if trigger.entity_id == "binary_sensor.bedroom_humidifier_out_of_water"
%}True{% endif %}'
sequence:
- data:
message: Humidifier is out of water
target: '814328602270498817'
action: notify.discord
default:
- data_template:
message: '{{ trigger.to_state.attributes.friendly_name }} is {{ trigger.to_state.state
}}'
target: '814328602270498817'
action: notify.discord
initial_state: false
mode: queued
max: 10
- id: system_log
alias: Log Error to File
trigger:
- event_data:
level: ERROR
event_type: system_log_event
platform: event
action:
- data_template:
message: '{{ trigger.event.data }}'
service: notify.error_logfile
initial_state: false
mode: parallel
max: 10
- id: '1588304855176'
alias: Night Motion
description: ''
trigger:
- entity_id: binary_sensor.backyard_camera_motion_detected
platform: state
to: 'on'
condition:
- condition: and
conditions:
- condition: or
conditions:
- after: sunset
condition: sun
- before: sunrise
condition: sun
- condition: template
value_template: '{% if state_attr(''weather.kdca_daynight'', ''wind_speed'')
< 5 %}true{% else %}false{% endif %}'
action:
- type: turn_on
device_id: f0a5bdb86a5e49bebd0aece4f7ab1062
entity_id: switch.patio_wall_lights
domain: switch
- delay: 00:{{ '{:02}'.format(range(10,20) | random | int) }}:00
- type: turn_off
device_id: f0a5bdb86a5e49bebd0aece4f7ab1062
entity_id: switch.patio_wall_lights
domain: switch
mode: single
- id: '1588452474080'
alias: Camect Motion
description: ''
triggers:
- event_data:
type: alert
raw_data:
cam_name: Backyard
detected_obj:
- person
event_type: camect_event
trigger: event
- event_data:
type: alert
raw_data:
detected_obj:
- cat
event_type: camect_event
trigger: event
- event_data:
raw_data:
cam_name: Front Door
detected_obj:
- person
event_type: camect_event
enabled: true
trigger: event
conditions:
- condition: template
value_template: '{% if trigger.event.data.cam_name != "" and ( as_timestamp(now())
- as_timestamp(state_attr("automation.camect_automation", "last_triggered"))
|int(0) ) > 90 %}True{% endif %}'
actions:
- data_template:
entity_id: camera.{{ trigger.event.data.raw_data.cam_name | lower | replace
(" ", "_") }}
filename: /config/www/{{ trigger.event.data.raw_data.cam_name | lower | replace
(" ", "_") }}_{{ trigger.event.data.raw_data.detected_obj | lower }}.jpg
enabled: false
action: camera.snapshot
- data_template:
entity_id: '{{ trigger.event.data.device_id }}'
filename: /config/www/{{ trigger.event.data.raw_data.cam_name | lower | replace
(" ", "_") }}_{{ trigger.event.data.raw_data.detected_obj | lower }}.jpg
action: camera.snapshot
- delay: 00:00:01
- data_template:
target: '812545796339400708'
message: '{{ trigger.event.data.raw_data.cam_name }} detected {{ trigger.event.data.raw_data.detected_obj
| replace("[", "") | replace("]", "") | replace("''", "")}}'
data:
images:
- /config/www/{{ trigger.event.data.raw_data.cam_name | lower | replace ("
", "_") }}_{{trigger.event.data.raw_data.detected_obj | lower }}.jpg
embed:
description: '{{ trigger.event.data.raw_data.cam_name }} Camera'
author:
name: Camect (via Home Assistant)
icon_url: https://brands.home-assistant.io/camect/icon.png
url: '{{ trigger.event.data.raw_data.url }}'
fields: []
action: notify.discord
- choose:
- conditions:
- condition: or
conditions:
- condition: sun
before: sunrise
- condition: sun
after: sunset
- condition: template
value_template: '{% if trigger.event.data.raw_data.cam_name | lower == "backyard"
%}True{% endif %}'
sequence:
- data: {}
target:
entity_id: group.patio_lights
action: homeassistant.turn_on
- delay:
hours: 0
minutes: 11
seconds: 0
milliseconds: 0
- data: {}
target:
entity_id: group.patio_lights
action: homeassistant.turn_off
default: []
trace:
stored_traces: 20
mode: single
- id: '1588452709021'
alias: Sun
description: ''
trigger:
- event: sunrise
platform: sun
id: sunrise
- event: sunset
platform: sun
id: sunset
- platform: time
at: '23:00:00'
id: goodnight
- platform: state
entity_id:
- group.hallway_lights
for:
hours: 0
minutes: 1
seconds: 0
to: 'on'
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: sunrise
sequence: []
- conditions:
- condition: trigger
id: sunset
sequence:
- service: homeassistant.turn_on
target:
entity_id:
- light.tv_backlight
- group.front_lights
- group.holiday_lights
- light.under_bed_lights
data: {}
- conditions:
- condition: time
after: '21:00:00'
before: 08:00:00
- condition: state
entity_id: group.family
state: home
sequence:
- service: homeassistant.turn_off
target:
entity_id:
- group.front_lights
- light.hallway_laundry_light
- light.hallway_bathroom_light
data: {}
- delay:
hours: 0
minutes: 30
seconds: 0
milliseconds: 0
- service: homeassistant.turn_off
data: {}
target:
entity_id: group.holiday_lights
default: []
- choose:
- conditions:
- condition: not
conditions:
- condition: state
entity_id: group.family
state: home
- condition: time
before: '23:00:00'
after: 00:00:00
- condition: trigger
id: sunset
sequence:
- delay: 00:{{ '{:02}'.format(range(0,30) | random | int) }}:00
- service: homeassistant.turn_on
target:
entity_id:
- group.kitchen_lights
- group.living_room_lights
- light.bedroom_overhead_light
- group.hallway_lights
- group.holiday_lights
data: {}
- conditions:
- condition: not
conditions:
- condition: state
entity_id: group.family
state: home
- condition: time
after: '23:00:00'
before: 00:00:00
sequence:
- delay: 00:{{ '{:02}'.format(range(0,30) | random | int) }}:00
- service: homeassistant.turn_off
target:
entity_id:
- group.kitchen_lights
- group.living_room_lights
- light.bedroom_overhead_light
- group.hallway_lights
- group.holiday_lights
data: {}
default: []
mode: single
- id: '1608091420017'
alias: Doorbell
description: ''
trigger:
- platform: device
device_id: 238b3c51d11f99da1bd7bedd372f050a
domain: nest
type: doorbell_chime
condition: []
action:
- data:
entity_id: camera.front_door
filename: /config/www/doorbell.jpg
service: camera.snapshot
- delay: 00:00:01
- data_template:
target: '812545796339400708'
message: Someone is at the door!
data:
images:
- /config/www/doorbell.jpg
embed:
description: Doorbell Camera
author:
name: Nest (via Home Assistant)
icon_url: https://brands.home-assistant.io/nest/icon.png
fields: []
service: notify.discord
- service: camera.record
metadata: {}
data:
filename: /config/www/doorbell.mp4
target:
entity_id: camera.front_door
- data_template:
target: '812545796339400708'
message: Doorbell Camera
data:
images:
- /config/www/doorbell.mp4
embed:
description: Doorbell Camera
author:
name: Nest (via Home Assistant)
icon_url: https://brands.home-assistant.io/nest/icon.png
fields: []
service: notify.discord
mode: single
- id: '1612648017088'
alias: Package Tracking Import
description: ''
trigger:
- platform: state
entity_id: sensor.imported_package
condition: []
action:
- service: aftership.add_tracking
data_template:
tracking_number: '{{ states("sensor.imported_package") }}'
slug: '{{ state_attr("sensor.imported_package","slug") }}'
mode: single
- id: '1619127008629'
alias: 0AMZN Dash
description: ''
trigger:
- platform: event
event_type: amzn_tide
- platform: event
event_type: amzn_bounty
- platform: event
event_type: amzn_cascade
- platform: event
event_type: amzn_all
- platform: event
event_type: amzn_brita
- platform: event
event_type: amzn_nature
- platform: event
event_type: amzn_trojan
- platform: event
event_type: amzn_airborne
- platform: event
event_type: amzn_zyrtec
- platform: event
event_type: amzn_charmin
condition: []
action:
- service: notify.mobile_app_peter_sm_g981u
data:
message: '{{ trigger.event.event_type }}'
mode: single
- id: '1673365170897'
alias: Amcrest Privacy Mode
description: ''
trigger:
- platform: state
entity_id:
- group.family
to: home
id: family_home
- platform: time
at: 00:00:00
id: goodnight
- platform: time
at: 07:00:00
id: goodmorning
- platform: state
entity_id:
- group.family
id: family_away
from: home
- platform: state
entity_id:
- alarm_control_panel.10th_street
to: disarmed
id: disarmed
- platform: state
entity_id:
- alarm_control_panel.10th_street
from: disarmed
id: armed
condition:
- condition: not
conditions:
- condition: state
entity_id: alarm_control_panel.10th_street
state: unavailable
- condition: state
entity_id: alarm_control_panel.10th_street
state: unknown
action:
- if:
- condition: or
conditions:
- condition: trigger
id: goodnight
- condition: trigger
id: family_away
- condition: trigger
id: armed
then:
- service: switch.turn_off
data: {}
target:
entity_id:
- switch.amcrest_dining_room_privacy_mode
- switch.amcrest_office_privacy_mode
- service: alarm_control_panel.alarm_arm_away
metadata: {}
data: {}
target:
device_id: fa72deb95f10377f1f021123e1f54026
- if:
- condition: or
conditions:
- condition: trigger
id: family_home
- condition: trigger
id: disarmed
- condition: and
conditions:
- condition: trigger
id:
- goodmorning
- condition: state
entity_id: group.family
state: home
then:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.amcrest_dining_room_privacy_mode
- switch.amcrest_office_privacy_mode
- service: alarm_control_panel.alarm_disarm
metadata: {}
data: {}
target:
device_id: fa72deb95f10377f1f021123e1f54026
mode: restart
- id: '1675640672790'
alias: Tag Bedroom Overhead On/Off is scanned
description: ''
trigger:
- platform: tag
tag_id: 43caf5a0-95a5-414b-8fc7-bf0bf80e5128
condition: []
action:
- service: homeassistant.toggle
data: {}
target:
entity_id: light.bedroom_overhead_light
mode: single
- id: backup
alias: Backup
description: ''
trigger:
- platform: time
at: 00:00:01
condition:
- condition: or
conditions:
- condition: template
value_template: '{{ now().day == 1 }}'
- condition: template
value_template: '{{ now().day == 15 }}'
action:
- service: backup.create
data: {}
- service: notify.discord
data_template:
message: Backup completed and took {{ (((now()-trigger.event.time_fired).total_seconds()
| round(0))/60 | round(2)) }} minutes
target: '814328602270498817'
mode: single
- &id001
id: '1683830929478'
alias: Tag Office Light Strip Toggle
description: ''
trigger:
- platform: tag
tag_id: a75efc06-51f5-46ef-bb9e-455c8a871050
condition: []
action:
- service: light.toggle
data: {}
target:
device_id:
- d1205c6f345891abf6cd332b16a8963d
- 3b70e075d4f3a226381eb231d6c331fe
- 3b2327cbac3a69e8ebef9276606eadca
mode: single
- *id001
- id: '1696126117145'
alias: Tag Indoor Cameras Off is scanned
description: ''
trigger:
- platform: tag
tag_id: e0774fcd-d221-4232-b64f-eb017ab24884
condition: []
action:
- service: switch.turn_on
data: {}
target:
entity_id:
- switch.amcrest_office_privacy_mode
- switch.amcrest_dining_room_privacy_mode
mode: single
- id: '1696442097979'
alias: Alley Motion
description: ''
trigger:
- platform: state
entity_id:
- binary_sensor.alley_motion_detected
to: 'on'
- platform: state
entity_id:
- binary_sensor.alley_person_detected
to: 'on'
condition: []
action:
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: downloader.download_file
data_template:
overwrite: true
filename: alley_motion.jpg
url: https://hass.peterepley.com{{ state_attr('image.alley_event_image', 'entity_picture')
}}
- data_template:
target: '812545796339400708'
message: Alley Motion Detected
data:
images:
- /config/www/alley_motion.jpg
embed:
description: Alley Camera
author:
name: Home Assistant
icon_url: https://www.home-assistant.io/images/favicon-192x192-full.png
fields: []
service: notify.discord
- choose:
- conditions:
- condition: or
conditions:
- condition: sun
before: sunrise
- condition: sun
after: sunset
sequence:
- service: homeassistant.turn_on
data: {}
target:
entity_id: group.patio_lights
- delay:
hours: 0
minutes: 11
seconds: 0
milliseconds: 0
- service: homeassistant.turn_off
data: {}
target:
entity_id: group.patio_lights
default: []
mode: single
- id: '1705613818940'
alias: Blink Camera
description: ''
triggers:
- entity_id:
- binary_sensor.cat_bed_camera_motion
to: 'on'
id: catbed
trigger: state
- entity_id:
- binary_sensor.bedroom_camera_motion
to: 'on'
id: bedroom
trigger: state
- trigger: state
entity_id:
- binary_sensor.kitty_condo_motion
to: 'on'
id: kittycondo
actions:
- target:
entity_id: '{%- if trigger.id == ''catbed'' -%}camera.cat_bed_camera {%- elif
trigger.id == ''bedroom'' -%}camera.bedroom_camera {%- elif trigger.id ==
''kittycondo'' -%}camera.kitty_condo {%- endif -%}'
data:
filename: /config/www/videos/blink_video_{{ now().strftime('%Y%m%d_%H%M') }}.mp4
action: blink.save_video
- delay: 00:00:01
enabled: false
- data_template:
target: '812545796339400708'
message: "{%- if trigger.id == 'catbed' -%}Cat Bed{%- elif trigger.id == 'bedroom'\
\ -%}Bedroom {%- elif trigger.id == 'kittycondo' -%}Kitty Condo{%- endif -%}\n\
\ Camera detected motion"
data:
images:
- /config/www/videos/blink_video_{{ now().strftime('%Y%m%d_%H%M') }}.mp4
embed:
description: '{%- if trigger.id == ''catbed'' -%}Cat Bed{%- else -%}Bedroom{%-
endif -%}'
author:
name: Blink (via Home Assistant)
icon_url: https://brands.home-assistant.io/blink/icon.png
fields: []
action: notify.discord
mode: single
- id: '1705632083918'
alias: 0Test Nest
description: ''
trigger:
- platform: device
device_id: 238b3c51d11f99da1bd7bedd372f050a
domain: nest
type: camera_motion
- platform: device
device_id: 238b3c51d11f99da1bd7bedd372f050a
domain: nest
type: camera_person
condition: []
action:
- service: notify.discord
metadata: {}
data:
target: '812545796339400708'
message: test camera
data:
images:
- /api/nest/event_media/{{ trigger.event.data.device_id }}/{{ trigger.event.data.nest_event_id
}}/thumbnail
- service: notify.mobile_app_peter_sm_s911u
data:
data:
image: /api/nest/event_media/{{ trigger.event.data.device_id }}/{{ trigger.event.data.nest_event_id
}}/thumbnail
message: test camera
mode: single
- id: '1710214521979'
alias: Weather Light
description: ''
trigger:
- entity_id:
- weather.kdca_daynight
platform: state
condition: []
action:
- variables:
color_options:
clear-night: white
sunny: yellow
cloudy: purple
partlycloudy: purple
fog: yellowgreen
rainy: blue
windy: darkorange
snowy: cyan
lightning: red
hail: aquamarine
windy-variant: lightsalmon
lightning-rainy: crimson
color: '{{ color_options.get(states(''weather.kdca_daynight'')) }}'
- alias: Save current light State to Scene
service: scene.create
data:
scene_id: before
snapshot_entities:
- light.living_room_led
- light.office_led
- light.bedroom_led
- light.under_bed_lights
- light.govee_gaming_light_strip_g1
- light.office_lamp
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- alias: Flash light color based on weather condition
service: light.turn_on
data:
color_name: '{{color}}'
brightness_pct: 100
flash: long
target:
entity_id:
- light.living_room_led
- light.office_led
- light.bedroom_led
- light.under_bed_lights
- light.govee_gaming_light_strip_g1
- light.office_lamp
- delay:
hours: 0
minutes: 0
seconds: 3
milliseconds: 0
- alias: Return light to white
service: light.turn_on
data:
color_name: white
brightness_pct: 100
flash: long
target:
entity_id:
- light.living_room_led
- light.office_led
- light.bedroom_led
- light.under_bed_lights
- light.govee_gaming_light_strip_g1
- light.office_lamp
- alias: Return light to previous state
entity_id: scene.before
service: scene.turn_on
mode: single
- id: '1733609554286'
alias: Doorbell Unifi Fingerprint
description: Automation that triggers when an event is successfully identified on
the G4 Doorbell Pro
triggers:
- event_type: state_changed
event_data:
entity_id: event.g4_doorbell_pro_fingerprint
trigger: event
conditions:
- condition: template
value_template: "{{\n not trigger.event.data.old_state.attributes.get('restored',\
\ false) and\n not trigger.event.data.old_state.state == 'unavailable' and\n\
\ trigger.event.data.new_state is not none and\n trigger.event.data.new_state.attributes.event_type\
\ == 'identified' and\n (trigger.event.data.new_state.attributes.ulp_id|default(''))\
\ != '' and\n trigger.event.data.new_state.attributes.ulp_id in ['8c09e6d1-719e-449d-9ddf-f691118f6c47']\n\
\ }}\n"
actions:
- data_template:
target: '812545796339400708'
message: 'Fingerprint identified with ID: {{ trigger.event.data.new_state.attributes.ulp_id
}}'
title: Fingerprint Scan Notification
data:
embed:
description: Doorbell Camera
author:
name: Unifi Protect (via Home Assistant)
icon_url: https://brands.home-assistant.io/unifi/icon.png
fields: []
action: notify.discord
- action: lock.unlock
metadata: {}
data:
code: 03281990
target:
device_id: 62271a51db7e9203f232a7d95bbb8d00