Files
srv-docker/homeassistant/config/automations.yaml
2026-03-07 17:28:59 +00:00

396 lines
12 KiB
YAML
Raw Permalink 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.

- id: '1762991834560'
alias: Утро - свет
description: ''
triggers:
- trigger: time
at: '9:30:00'
weekday:
- mon
- tue
- wed
- thu
- fri
conditions:
- condition: device
device_id: 51bac6c99c3cc7a5c2640ce4cd55cca8
domain: device_tracker
entity_id: 842d4a75a61896ca8d3930b322c57764
type: is_home
actions:
- action: light.turn_on
metadata: {}
data:
color_temp_kelvin: 6500
brightness_pct: 100
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
mode: single
- id: '1762992032227'
alias: Утро - свет моргание
description: ''
triggers:
- trigger: time
at: 09:10:00
weekday:
- mon
- wed
- tue
- thu
- fri
- sat
- sun
conditions:
- condition: device
device_id: 51bac6c99c3cc7a5c2640ce4cd55cca8
domain: device_tracker
entity_id: 842d4a75a61896ca8d3930b322c57764
type: is_home
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- action: light.turn_on
metadata: {}
data: {}
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- action: light.turn_on
metadata: {}
data: {}
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- action: light.turn_on
metadata: {}
data: {}
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- action: light.turn_on
metadata: {}
data: {}
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
mode: single
- id: '1762992378204'
alias: Ночь - свет
description: ''
triggers:
- trigger: time
at: 00:00:00
weekday:
- mon
- wed
- tue
- thu
- fri
- sat
- sun
conditions: []
actions:
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
mode: single
- id: '1762992684588'
alias: Вечер - свет
description: ''
triggers:
- trigger: sun
event: sunset
offset: 0
conditions:
- condition: device
device_id: 51bac6c99c3cc7a5c2640ce4cd55cca8
domain: device_tracker
entity_id: 842d4a75a61896ca8d3930b322c57764
type: is_home
actions:
- action: light.turn_on
metadata: {}
data:
color_temp_kelvin: 2000
brightness_pct: 50
target:
entity_id:
- light.iot_led_classic
- light.iot_a61_rgb
mode: single
- id: '1762994506315'
alias: Утренний дашборд в Telegram
description: Подробный утренний отчёт о доме и системе
triggers:
- at: 09:30:00
trigger: time
conditions: []
actions:
- action: telegram_bot.send_message
data:
message: 'Доброе утро!
Это тестовое сообщение
Свет уже должен гореть в спальне'
mode: single
- id: "1762999000001"
alias: "Алерты - ресурсы системы"
description: "Диск/память/CPU: уведомления в Telegram"
triggers:
- trigger: numeric_state
entity_id: sensor.localhost_disk_free
below: 20
for: "00:10:00"
- trigger: numeric_state
entity_id: sensor.localhost_mnt_disk2_disk_usage
above: 80
for: "00:10:00"
- trigger: numeric_state
entity_id: sensor.localhost_mnt_disk3_disk_usage
above: 80
for: "00:10:00"
- trigger: numeric_state
entity_id: sensor.localhost_memory_usage
above: 90
for: "00:10:00"
- trigger: numeric_state
entity_id: sensor.localhost_swap_usage
above: 80
for: "00:10:00"
- trigger: numeric_state
entity_id: sensor.localhost_cpu_usage
above: 80
for: "00:05:00"
actions:
- choose:
- conditions: "{{ trigger.entity_id == sensor.localhost_disk_free and (trigger.to_state.state|float(0)) < 10 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🔴 CRIT: Мало места на root — {{ trigger.to_state.state }} {{ trigger.to_state.attributes.unit_of_measurement }} свободно"
- conditions: "{{ trigger.entity_id == sensor.localhost_disk_free and (trigger.to_state.state|float(0)) < 20 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🟡 WARN: Мало места на root — {{ trigger.to_state.state }} {{ trigger.to_state.attributes.unit_of_measurement }} свободно"
- conditions: "{{ trigger.entity_id in [sensor.localhost_mnt_disk2_disk_usage,sensor.localhost_mnt_disk3_disk_usage] and (trigger.to_state.state|float(0)) >= 90 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🔴 CRIT: Диск {{ trigger.entity_id }} заполнен на {{ trigger.to_state.state }}%"
- conditions: "{{ trigger.entity_id in [sensor.localhost_mnt_disk2_disk_usage,sensor.localhost_mnt_disk3_disk_usage] and (trigger.to_state.state|float(0)) >= 80 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🟡 WARN: Диск {{ trigger.entity_id }} заполнен на {{ trigger.to_state.state }}%"
- conditions: "{{ trigger.entity_id == sensor.localhost_memory_usage and (trigger.to_state.state|float(0)) >= 95 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🔴 CRIT: RAM {{ trigger.to_state.state }}%"
- conditions: "{{ trigger.entity_id == sensor.localhost_memory_usage and (trigger.to_state.state|float(0)) >= 90 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🟡 WARN: RAM {{ trigger.to_state.state }}%"
- conditions: "{{ trigger.entity_id == sensor.localhost_swap_usage and (trigger.to_state.state|float(0)) >= 90 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🔴 CRIT: Swap {{ trigger.to_state.state }}%"
- conditions: "{{ trigger.entity_id == sensor.localhost_swap_usage and (trigger.to_state.state|float(0)) >= 80 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🟡 WARN: Swap {{ trigger.to_state.state }}%"
- conditions: "{{ trigger.entity_id == sensor.localhost_cpu_usage and (trigger.to_state.state|float(0)) >= 90 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🔴 CRIT: CPU {{ trigger.to_state.state }}% (5+ мин)"
- conditions: "{{ trigger.entity_id == sensor.localhost_cpu_usage and (trigger.to_state.state|float(0)) >= 80 }}"
sequence:
- action: telegram_bot.send_message
data:
message: "🟡 WARN: CPU {{ trigger.to_state.state }}% (5+ мин)"
mode: single
- id: "1763004000001"
alias: "Контекст: выход из дома — лампочки"
description: "Напоминание о покупке лампочек при выходе из дома"
triggers:
- trigger: state
entity_id: person.aleksandr
to: "not_home"
for: "00:02:00"
conditions:
- condition: template
value_template: "{{ this.attributes.last_triggered is none or (as_timestamp(now()) - as_timestamp(this.attributes.last_triggered)) > 21600 }}"
actions:
- action: telegram_bot.send_message
data:
message: "🛒 Не забудь: купить лампочки на кухню и коридор."
mode: single
- id: "1763004000002"
alias: "Контекст: возвращение домой — барабаны"
description: "Вечернее напоминание обновить заметку про барабаны"
triggers:
- trigger: state
entity_id: person.aleksandr
to: "home"
for: "00:02:00"
conditions:
- condition: time
after: "18:00:00"
before: "23:30:00"
- condition: template
value_template: "{{ this.attributes.last_triggered is none or (as_timestamp(now()) - as_timestamp(this.attributes.last_triggered)) > 21600 }}"
actions:
- action: telegram_bot.send_message
data:
message: "🥁 Если есть силы: обнови заметку по барабанам (цели/план/что практиковать)."
mode: single
- id: "1763004000003"
alias: "Контекст: утро дома — 3 приоритета"
description: "Утреннее напоминание выбрать 3 приоритета дня"
triggers:
- trigger: state
entity_id: person.aleksandr
to: "home"
for: "00:05:00"
conditions:
- condition: time
after: "08:30:00"
before: "12:00:00"
- condition: template
value_template: "{{ this.attributes.last_triggered is none or (as_timestamp(now()) - as_timestamp(this.attributes.last_triggered)) > 21600 }}"
actions:
- action: telegram_bot.send_message
data:
message: "☀️ Выбери 3 главных приоритета на сегодня (1 важное, 1 среднее, 1 мелочь)."
mode: single
- id: "1763004000004"
alias: "Контекст: ночь — проверить дом"
description: "Ночное напоминание проверить свет и утренние дела"
triggers:
- trigger: time
at: "23:30:00"
conditions:
- condition: state
entity_id: person.aleksandr
state: "home"
actions:
- action: telegram_bot.send_message
data:
message: "🌙 На ночь: проверь, что свет/приборы выключены, и отметь 1 утреннюю задачу."
mode: single
- id: "1763004000005"
alias: "Контекст: выезд с работы — Ozon"
description: "Напоминание зайти в пункт выдачи Ozon по дороге"
triggers:
- trigger: state
entity_id: person.aleksandr
to: "not_home"
for: "00:02:00"
conditions:
- condition: time
after: "17:00:00"
before: "21:30:00"
- condition: template
value_template: "{{ this.attributes.last_triggered is none or (as_timestamp(now()) - as_timestamp(this.attributes.last_triggered)) > 21600 }}"
actions:
- action: telegram_bot.send_message
data:
message: "📦 По дороге: зайди в пункт выдачи Ozon."
mode: single
- id: "1763004000006"
alias: "Напоминание: отпуск к 25 числу"
description: "Раз в пару дней после 1 марта напоминать про отпуск на 25 число"
triggers:
- trigger: time
at: "10:00:00"
conditions:
- condition: template
value_template: "{{ now().date() >= strptime(2026-03-01,%Y-%m-%d).date() }}"
- condition: template
value_template: "{{ (now().timetuple().tm_yday % 2) == 1 }}"
actions:
- action: telegram_bot.send_message
data:
message: "✈️ Напоминание: подумай об отпуске на 25е (и соседние даты)."
mode: single