299 lines
7.9 KiB
YAML
299 lines
7.9 KiB
YAML
- alias: 'Alarm: Motion Trigger'
|
|
id: alarm_motion_trigger
|
|
mode: restart
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.pir_sensor_porch
|
|
to: 'on'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.alarm_toggle
|
|
state: 'on'
|
|
action:
|
|
- event: alarm_triggered
|
|
event_data:
|
|
name: '{{ state_attr(trigger.entity_id, ''friendly_name'') or trigger.entity_id
|
|
}}'
|
|
area: '{{ area_name(trigger.entity_id) or ''Unknown'' }}'
|
|
- delay:
|
|
milliseconds: 100
|
|
- choose:
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.alarm_level
|
|
state: 'off'
|
|
sequence:
|
|
- service: input_boolean.turn_on
|
|
target:
|
|
entity_id: input_boolean.alarm_level
|
|
- service: timer.start
|
|
data:
|
|
entity_id: timer.alarm_reset
|
|
duration: '{{ states(''input_number.alarm_reset_delay'') | int }}'
|
|
- conditions:
|
|
- condition: state
|
|
entity_id: input_boolean.alarm_level
|
|
state: 'on'
|
|
sequence:
|
|
- service: timer.start
|
|
data:
|
|
entity_id: timer.alarm_reset
|
|
duration: '{{ states(''input_number.alarm_reset_delay'') | int }}'
|
|
- alias: 'Alarm: Telegram Alert'
|
|
id: alarm_telegram_alert
|
|
mode: queued
|
|
trigger:
|
|
- platform: event
|
|
event_type: alarm_triggered
|
|
action:
|
|
- service: telegram_bot.send_message
|
|
metadata: {}
|
|
data:
|
|
title: '*ALARM* (SALE)'
|
|
message: 'Motion detected in area {{ trigger.event.data.area }} ({{ trigger.event.data.name
|
|
}})
|
|
|
|
'
|
|
- alias: 'Alarm: Auto Reset'
|
|
id: alarm_auto_reset
|
|
mode: single
|
|
trigger:
|
|
- platform: event
|
|
event_type: timer.finished
|
|
event_data:
|
|
entity_id: timer.alarm_reset
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.alarm_level
|
|
state: 'on'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.alarm_level
|
|
- alias: 'Alarm: Toggle Off Reset'
|
|
id: alarm_toggle_off_reset
|
|
mode: single
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.alarm_toggle
|
|
to: 'off'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
target:
|
|
entity_id: input_boolean.alarm_level
|
|
- service: timer.cancel
|
|
target:
|
|
entity_id: timer.alarm_reset
|
|
- id: '1743004587794'
|
|
alias: sunset_light_on
|
|
description: ''
|
|
triggers:
|
|
- trigger: sun
|
|
event: sunset
|
|
offset: 00:15:00
|
|
conditions: []
|
|
actions:
|
|
- type: turn_on
|
|
device_id: ba93c82f4e4bc3945de1addd27bc91fc
|
|
entity_id: 00744d74a8832ce2e0b378b7c7dfb7cb
|
|
domain: switch
|
|
mode: single
|
|
- id: '1743018659299'
|
|
alias: HA_start
|
|
description: ''
|
|
triggers:
|
|
- trigger: homeassistant
|
|
event: start
|
|
conditions: []
|
|
actions:
|
|
- action: telegram_bot.send_message
|
|
metadata: {}
|
|
data:
|
|
message: HA has been started
|
|
title: '*INFO* (SALE)'
|
|
mode: single
|
|
- id: '1743020290197'
|
|
alias: printer_office_cartridge_low
|
|
description: ''
|
|
triggers:
|
|
- type: value
|
|
device_id: 71fb6f3b0b913c2a17ac5b4a0f7e76a8
|
|
entity_id: 67083b118c16c903c1bda687619b32c7
|
|
domain: sensor
|
|
trigger: device
|
|
below: 5
|
|
- type: value
|
|
device_id: 71fb6f3b0b913c2a17ac5b4a0f7e76a8
|
|
entity_id: 8bfbcf2f002b92165408de491e583a96
|
|
domain: sensor
|
|
trigger: device
|
|
below: 5
|
|
- type: value
|
|
device_id: 71fb6f3b0b913c2a17ac5b4a0f7e76a8
|
|
entity_id: 8fb8fb024a12ae0df21171efe6a87398
|
|
domain: sensor
|
|
trigger: device
|
|
below: 5
|
|
conditions: []
|
|
actions:
|
|
- action: telegram_bot.send_message
|
|
metadata: {}
|
|
data:
|
|
message: '{{ trigger.entity.friendly_name }} level is below 5%'
|
|
title: '*ALERT* (SALE)'
|
|
mode: single
|
|
- id: '1743257316932'
|
|
alias: geo_d_left_school
|
|
description: ''
|
|
use_blueprint:
|
|
path: homeassistant/notify_leaving_zone.yaml
|
|
input:
|
|
person_entity: person.d
|
|
zone_entity: zone.sale_high_school
|
|
notify_device: 44404b635daf7ed8a1ef67dd59f1debf
|
|
- id: '1743257703972'
|
|
alias: geo_nikodim_left_work
|
|
description: ''
|
|
triggers:
|
|
- trigger: zone
|
|
entity_id: person.nikodim
|
|
zone: zone.work
|
|
event: leave
|
|
conditions: []
|
|
actions:
|
|
- action: telegram_bot.send_message
|
|
metadata: {}
|
|
data:
|
|
message: Elvis left the building
|
|
mode: single
|
|
- id: '1743257581580'
|
|
alias: geo_nikodim_enter_home
|
|
description: ''
|
|
triggers:
|
|
- trigger: zone
|
|
entity_id: person.nikodim
|
|
zone: zone.home
|
|
event: enter
|
|
conditions: []
|
|
actions:
|
|
- action: telegram_bot.send_message
|
|
metadata: {}
|
|
data:
|
|
message: Будулай вернулся
|
|
mode: single
|
|
- id: geo_d_left_school
|
|
alias: D left school
|
|
description: Sends notification when D leaves Sale High School
|
|
trigger:
|
|
- trigger: state
|
|
entity_id: person.d
|
|
from: zone.sale_high_school
|
|
to: not_home
|
|
condition: []
|
|
actions:
|
|
- action: telegram_bot.send_message
|
|
metadata: {}
|
|
data:
|
|
message: D has left Sale High School.
|
|
mode: single
|
|
- id: start_tvphotoframe_on_tv_inactive
|
|
alias: Start Photo Frame on TV Inactive
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.lg_tv_activity_status
|
|
to: idle
|
|
for:
|
|
minutes: '{{ states(''input_number.tv_inactive_timeout'') | int }}'
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.tvphotoframe_enabled
|
|
state: 'on'
|
|
- condition: state
|
|
entity_id: input_boolean.tvphotoframe_active
|
|
state: 'off'
|
|
- condition: template
|
|
value_template: '{{ states(''input_number.tvphotoframe_total_photos'') | int >
|
|
0 }}'
|
|
action:
|
|
- service: input_boolean.turn_on
|
|
entity_id: input_boolean.tvphotoframe_active
|
|
- service: automation.trigger
|
|
entity_id: automation.tvphotoframe_show_next_photo
|
|
- id: stop_tvphotoframe_on_tv_active
|
|
alias: Stop Photo Frame on TV Active
|
|
trigger:
|
|
- platform: state
|
|
entity_id: sensor.lg_tv_activity_status
|
|
to: active
|
|
- platform: state
|
|
entity_id: media_player.lg_webos_tv_ur80006lj_2
|
|
attribute: source
|
|
- platform: state
|
|
entity_id: media_player.lg_webos_tv_ur80006lj_2
|
|
attribute: volume_level
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.tvphotoframe_active
|
|
state: 'on'
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
entity_id: input_boolean.tvphotoframe_active
|
|
- service: media_player.media_stop
|
|
target:
|
|
entity_id: media_player.lg_webos_tv_ur80006lj_2
|
|
- id: tvphotoframe_show_next_photo
|
|
alias: Show Next Photo
|
|
trigger:
|
|
- platform: state
|
|
entity_id: input_boolean.tvphotoframe_active
|
|
to: 'on'
|
|
- platform: event
|
|
event_type: automation.triggered
|
|
event_data:
|
|
entity_id: automation.tvphotoframe_show_next_photo
|
|
condition:
|
|
- condition: state
|
|
entity_id: input_boolean.tvphotoframe_active
|
|
state: 'on'
|
|
- condition: template
|
|
value_template: '{{ states(''sensor.random_photo_path'') != ''unavailable'' }}'
|
|
action:
|
|
- service: shell_command.get_next_photo
|
|
- service: media_player.play_media
|
|
target:
|
|
entity_id: media_player.lg_webos_tv_ur80006lj_2
|
|
data:
|
|
media_content_type: image/jpeg
|
|
media_content_id: '{{ states(''sensor.random_photo_path'') }}'
|
|
- service: notify.persistent_notification
|
|
data:
|
|
message: 'Showing photo: {{ state_attr(''sensor.random_photo_path'', ''photo_file'')
|
|
}}'
|
|
title: TV Photo Frame
|
|
- delay:
|
|
seconds: '{{ states(''input_number.tvphotoframe_interval'') | int }}'
|
|
- condition: state
|
|
entity_id: input_boolean.tvphotoframe_active
|
|
state: 'on'
|
|
- event: automation.triggered
|
|
event_data:
|
|
entity_id: automation.tvphotoframe_show_next_photo
|
|
- id: tvphotoframe_run_python_scanner
|
|
alias: Run Python Photo Scanner
|
|
trigger:
|
|
- platform: homeassistant
|
|
event: start
|
|
- platform: event
|
|
event_type: tvphotoframe_scan_photos
|
|
- platform: state
|
|
entity_id: input_text.tvphotoframe_folder
|
|
action:
|
|
- delay:
|
|
seconds: 30
|
|
- service: notify.persistent_notification
|
|
data:
|
|
message: '🐍 Running photo scan from folder: {{ states(''input_text.tvphotoframe_folder'')
|
|
}}'
|
|
title: TV Photo Frame
|
|
- service: shell_command.scan_photos
|