3433 lines
108 KiB
YAML
3433 lines
108 KiB
YAML
- id: c6382818-05ed-4590-be92-b367489fb0e1
|
||
alias: 'HELPER: Обновление списка пользователей, находящихся дома'
|
||
triggers:
|
||
- platform: state
|
||
entity_id:
|
||
- binary_sensor.andrei_is_home
|
||
- person.master
|
||
actions:
|
||
- service: input_text.set_value
|
||
target:
|
||
entity_id: input_text.currently_home
|
||
data:
|
||
value: "{% set home_users = [] %} {% if is_state('binary_sensor.andrei_is_home',\
|
||
\ 'on') %}\n {% set home_users = home_users + ['Andrei'] %}\n{% endif %}\
|
||
\ {{ home_users | join(', ') }}\n"
|
||
- id: d8084e61-405b-4f92-8c86-527254cc6753
|
||
alias: HELPER:Переключение зимнего режима по месяцам
|
||
description: 'Автоматизация, которая ежедневно проверяет, нужно ли включить или
|
||
выключить зимний режим в зависимости от текущего месяца. Считаем «зимой» период
|
||
с ноября (11) по март (3). Если время года подходит под зимний период, включаем
|
||
boolean.winter_mode, иначе -- выключаем.
|
||
|
||
'
|
||
mode: single
|
||
triggers:
|
||
- platform: time
|
||
at: 00:01:00
|
||
- platform: homeassistant
|
||
event: start
|
||
conditions: []
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ now().month >= 11 or now().month <= 3 }}
|
||
|
||
'
|
||
sequence:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.winter_mode
|
||
default:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.winter_mode
|
||
- id: 38ea50fb-09bc-4d39-a771-1727ab72f265
|
||
alias: 'HELPER: Фаза: Включение датчика загрузки'
|
||
description: Активируем system_startup_phase при старте Home Assistant
|
||
mode: single
|
||
triggers:
|
||
- platform: homeassistant
|
||
event: start
|
||
actions:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.system_startup_phase
|
||
- id: 03e3ffd0-4e1e-4200-b0e3-1ce6a2d77d6a
|
||
alias: 'HELPER: Фаза: Отключение датчика загрузки (2 минуты)'
|
||
description: Выключаем input_boolean.system_startup_phase спустя 2 минуты после
|
||
старта
|
||
mode: single
|
||
triggers:
|
||
- platform: homeassistant
|
||
event: start
|
||
actions:
|
||
- delay: 00:02:00
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.system_startup_phase
|
||
- id: cc269239-a6dd-422f-ba2a-3d57e4c5981e
|
||
alias: 'HELPER: Установка режима тишины (23:00)'
|
||
mode: single
|
||
triggers:
|
||
- platform: time
|
||
at: '23:00:00'
|
||
actions:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.silent_mode
|
||
- id: 6ed14663-ebe5-4ab3-bc3b-43e682c45f3b
|
||
alias: 'HELPER: Снятие режима тишины (09:00)'
|
||
mode: single
|
||
triggers:
|
||
- platform: time
|
||
at: 09:00:00
|
||
actions:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.silent_mode
|
||
- id: 7df1e59a-af5d-4496-be72-e687afdbf08e
|
||
alias: 'HELPER: Обновление сенсора контроля уведомлений о уровне CO2'
|
||
mode: single
|
||
triggers:
|
||
- platform: state
|
||
entity_id: binary_sensor.livingroom_ventilation_status
|
||
from: 'on'
|
||
to: 'off'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id:
|
||
- input_boolean.co2_voice_notification_sensor
|
||
- input_boolean.co2_text_notification_sensor
|
||
- id: 5b187cde-0ad5-4132-bb68-a622dd15d6ff
|
||
alias: 'HELPER: Сохранение состояний климатической техники'
|
||
mode: single
|
||
triggers:
|
||
- platform: homeassistant
|
||
event: shutdown
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: climate.konditsioner
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.winter_mode
|
||
state: 'off'
|
||
sequence:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.climate_pre_restart_state
|
||
default:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.climate_pre_restart_state
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: switch.zhimi_mb3_a5d3_switch_status
|
||
state: 'on'
|
||
sequence:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.fan_pre_restart_state
|
||
default:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.fan_pre_restart_state
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: switch.evolution_hf_878
|
||
state: 'on'
|
||
sequence:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.humidifier_pre_restart_state
|
||
default:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.humidifier_pre_restart_state
|
||
- id: 457a6711-67fa-4cb2-bcab-63c0cc58e054
|
||
alias: 'HELPER: Восстановление состояний климатической техники'
|
||
mode: single
|
||
triggers:
|
||
- platform: homeassistant
|
||
event: start
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.climate_pre_restart_state
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.winter_mode
|
||
state: 'off'
|
||
sequence:
|
||
- service: climate.turn_on
|
||
target:
|
||
entity_id: climate.konditsioner
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.fan_pre_restart_state
|
||
state: 'on'
|
||
sequence:
|
||
- service: switch.turn_on
|
||
target:
|
||
entity_id: switch.zhimi_mb3_a5d3_switch_status
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.humidifier_pre_restart_state
|
||
state: 'on'
|
||
sequence:
|
||
- service: switch.turn_on
|
||
target:
|
||
entity_id: switch.evolution_hf_878
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id:
|
||
- input_boolean.climate_pre_restart_state
|
||
- input_boolean.fan_pre_restart_state
|
||
- input_boolean.humidifier_pre_restart_state
|
||
- id: bee019e8-c011-4283-85df-4cbbbc00e92f
|
||
alias: 'Камеры: Управление в зависимости от присутствия'
|
||
description: Включение/выключение камер в зависимости от того, кто дома, но с учетом
|
||
режима форсированного отключения.
|
||
mode: single
|
||
triggers:
|
||
- platform: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.force_camera_off
|
||
state: 'off'
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
state: 'off'
|
||
sequence:
|
||
- service: switch.turn_on
|
||
target:
|
||
entity_id: group.cameras
|
||
- service: notify.master
|
||
data:
|
||
message: 'Камеры включены: Никого нет дома.'
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
state: 'on'
|
||
sequence:
|
||
- service: switch.turn_off
|
||
target:
|
||
entity_id: group.cameras
|
||
- service: notify.master
|
||
data:
|
||
message: 'Камеры выключены: Кто-то дома.'
|
||
- id: 98df0b92-1c60-4e48-a065-3412a0706124
|
||
alias: 'Камеры: Блокировка включения при форсированном отключении'
|
||
description: 'Эта автоматизация предназначена для предотвращения включения камер,
|
||
когда активирован режим принудительного отключения (force_camera_off). Если один
|
||
из переключателей камер переходит в состояние "on" при активном режиме, автоматизация
|
||
немедленно отключает его и отправляет уведомление пользователю.
|
||
|
||
'
|
||
mode: parallel
|
||
triggers:
|
||
- platform: state
|
||
entity_id:
|
||
- switch.chuangmi_cn_309825146_ipc019_on_p_2_1
|
||
- switch.chuangmi_cn_311366982_ipc019_on_p_2_1
|
||
to: 'on'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.force_camera_off
|
||
state: 'on'
|
||
actions:
|
||
- service: switch.turn_off
|
||
target:
|
||
entity_id:
|
||
- switch.chuangmi_cn_309825146_ipc019_on_p_2_1
|
||
- switch.chuangmi_cn_311366982_ipc019_on_p_2_1
|
||
- service: notify.master
|
||
data:
|
||
message: Попытка включения камер заблокирована (форсированное отключение).
|
||
- id: 779498b6-e63f-454d-8866-8e7e7a94d8e4
|
||
alias: 'MariaDB: Очистка базы в 3:00'
|
||
description: 'Автоматизация запускается ежедневно в 03:00 и выполняет очистку базы
|
||
данных с использованием сервиса recorder.purge, оставляя данные за последние 90
|
||
дней. Это помогает предотвратить бесконтрольное разрастание БД.
|
||
|
||
'
|
||
mode: single
|
||
trigger:
|
||
- platform: time
|
||
at: 03:40:00
|
||
action:
|
||
- service: recorder.purge
|
||
data:
|
||
keep_days: 90
|
||
repack: false
|
||
apply_to_entities: []
|
||
- id: 8a46561c-f48f-4c93-b53e-d1af940fdb6d
|
||
alias: 'Рабочие дни: Выключение света, отпаривателя и ТВ (09:00-17:00)'
|
||
description: 'В рабочие дни (ПН-ПТ) в период с 09:00 до 17:00, если режим уборки
|
||
выключен и никого нет дома, отключаются все освещение, розетка отпаривателя и
|
||
ТВ.
|
||
|
||
'
|
||
mode: single
|
||
triggers:
|
||
- platform: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
to: 'off'
|
||
- platform: time
|
||
at: 09:00:00
|
||
conditions:
|
||
- condition: time
|
||
weekday:
|
||
- mon
|
||
- tue
|
||
- wed
|
||
- thu
|
||
- fri
|
||
- condition: time
|
||
after: 09:00:00
|
||
before: '17:00:00'
|
||
- condition: state
|
||
entity_id: input_boolean.bathroom_cleaning_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
state: 'off'
|
||
actions:
|
||
- service: homeassistant.turn_off
|
||
target:
|
||
entity_id: light.all_lights
|
||
- service: switch.turn_off
|
||
target:
|
||
entity_id: switch.smart_plug_in_unit_vykliuchatel
|
||
- service: homeassistant.turn_off
|
||
target:
|
||
entity_id: group.living_room_tv
|
||
- id: ee320693-2e76-435b-8012-3a908046d4d5e
|
||
alias: Выключение отпаривателя при отсутствии дома
|
||
description: 'Автоматизация отключает розетку отпаривателя (switch.smart_plug_in_unit_vykliuchatel),
|
||
если датчик присутствия (binary_sensor.someone_is_home) фиксирует, что никого
|
||
нет дома.
|
||
|
||
'
|
||
mode: single
|
||
triggers:
|
||
- platform: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
to: 'off'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
state: 'off'
|
||
actions:
|
||
- service: switch.turn_off
|
||
target:
|
||
entity_id: switch.smart_plug_in_unit_vykliuchatel
|
||
- id: plant-send-pending-notifications
|
||
alias: 'Растения: Отправка отложенных уведомлений при возвращении домой'
|
||
description: Если накопились уведомления за время отсутствия — отправим их по приходу.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: person.master
|
||
to: home
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
action:
|
||
- delay: 00:01:00
|
||
- service: script.check_all_plants
|
||
- id: 4370eb06-5640-4c42-adde-b91046f301f4-1
|
||
alias: 'Растение. Молочай: Уведомление о поливе'
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.plant_alert_euphorbia_leuconeura_soil
|
||
to: 'on'
|
||
condition:
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{% set last = states(''input_datetime.last_euphorbia_leuconeura_soil_notification'')
|
||
%} {% set last_ts = as_timestamp(last) if last not in [''unknown'',''unavailable'',''none'']
|
||
else 0 %} {% set cooldown = (states(''input_number.plants_notification_cooldown_hours'')
|
||
| float(3) * 3600) | int %} {{ (now().timestamp() - last_ts) > cooldown }}'
|
||
action:
|
||
- service: script.plant_check_conditions
|
||
data:
|
||
plant_name: Молочай
|
||
plant_name_latin: euphorbia_leuconeura
|
||
- id: 4370eb06-5640-4c42-adde-b91046f301f4-2
|
||
alias: 'Растение. Молочай: Уведомление о температуре'
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.plant_alert_euphorbia_leuconeura_temperature
|
||
to: 'on'
|
||
condition:
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{% set last = states(''input_datetime.last_euphorbia_leuconeura_temperature_notification'')
|
||
%} {% set last_ts = as_timestamp(last) if last not in [''unknown'',''unavailable'',''none'']
|
||
else 0 %} {% set cooldown = (states(''input_number.plants_notification_cooldown_hours'')
|
||
| float(3) * 3600) | int %} {{ (now().timestamp() - last_ts) > cooldown }}'
|
||
action:
|
||
- service: script.plant_check_conditions
|
||
data:
|
||
plant_name: Молочай
|
||
plant_name_latin: euphorbia_leuconeura
|
||
- id: 4370eb06-5640-4c42-adde-b91046f301f4-3
|
||
alias: 'Растение. Молочай: Уведомление об освещенности'
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.plant_alert_euphorbia_leuconeura_illuminance
|
||
to: 'on'
|
||
condition:
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{% set last = states(''input_datetime.last_euphorbia_leuconeura_illuminance_notification'')
|
||
%} {% set last_ts = as_timestamp(last) if last not in [''unknown'',''unavailable'',''none'']
|
||
else 0 %} {% set cooldown = (states(''input_number.plants_notification_cooldown_hours'')
|
||
| float(3) * 3600) | int %} {{ (now().timestamp() - last_ts) > cooldown }}'
|
||
action:
|
||
- service: script.plant_check_conditions
|
||
data:
|
||
plant_name: Молочай
|
||
plant_name_latin: euphorbia_leuconeura
|
||
- id: plant-euphorbia-periodic-check
|
||
alias: 'Растение. Молочай: Периодическая проверка'
|
||
mode: single
|
||
trigger:
|
||
- platform: time_pattern
|
||
hours: /6
|
||
action:
|
||
- service: script.plant_check_conditions
|
||
data:
|
||
plant_name: Молочай
|
||
plant_name_latin: euphorbia_leuconeura
|
||
- id: 3ee8085c-621a-49f0-98f6-cce0d5c3c49b
|
||
alias: 'Растение. Фикус лировидный: Уведомление о поливе'
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.plant_alert_ficus_lyrata_soil
|
||
to: 'on'
|
||
condition:
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{% set last = states(''input_datetime.last_ficus_lyrata_soil_notification'')
|
||
%} {% set last_ts = as_timestamp(last) if last not in [''unknown'',''unavailable'',''none'']
|
||
else 0 %} {% set cooldown = (states(''input_number.plants_notification_cooldown_hours'')
|
||
| float(3) * 3600) | int %} {{ (now().timestamp() - last_ts) > cooldown }}'
|
||
action:
|
||
- service: script.plant_check_conditions
|
||
data:
|
||
plant_name: Фикус лировидный
|
||
plant_name_latin: ficus_lyrata
|
||
- id: 3ee8085c-621a-49f0-98f6-cce0d5c3c49c
|
||
alias: 'Растение. Фикус лировидный: Уведомление о температуре'
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.plant_alert_ficus_lyrata_temperature
|
||
to: 'on'
|
||
condition:
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{% set last = states(''input_datetime.last_ficus_lyrata_temperature_notification'')
|
||
%} {% set last_ts = as_timestamp(last) if last not in [''unknown'',''unavailable'',''none'']
|
||
else 0 %} {% set cooldown = (states(''input_number.plants_notification_cooldown_hours'')
|
||
| float(3) * 3600) | int %} {{ (now().timestamp() - last_ts) > cooldown }}'
|
||
action:
|
||
- service: script.plant_check_conditions
|
||
data:
|
||
plant_name: Фикус лировидный
|
||
plant_name_latin: ficus_lyrata
|
||
- id: plant-ficus-periodic-check
|
||
alias: 'Растение. Фикус лировидный: Периодическая проверка'
|
||
mode: single
|
||
trigger:
|
||
- platform: time_pattern
|
||
hours: /6
|
||
action:
|
||
- service: script.plant_check_conditions
|
||
data:
|
||
plant_name: Фикус лировидный
|
||
plant_name_latin: ficus_lyrata
|
||
- id: dc1acbee-6ecd-45a4-8eae-ab69034c3117
|
||
alias: 'Ванная: Вытяжка, включение.'
|
||
description: Включение вентилятора при высокой усреднённой влажности в ванной.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.bathroom_humidity_max
|
||
to: 'on'
|
||
condition:
|
||
- condition: state
|
||
entity_id: fan.bathroom_relay_l1
|
||
state: 'off'
|
||
action:
|
||
- service: fan.turn_on
|
||
target:
|
||
entity_id: fan.bathroom_relay_l1
|
||
- id: 6ebb6fa8-9cd1-4ebd-839d-44d175e6c319
|
||
alias: 'Ванная: Запуск таймера на продув по снижении влажности'
|
||
description: При снижении влажности ниже минимального порога запускается таймер
|
||
на 2 минуты перед отключением вентилятора.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.bathroom_humidity_min
|
||
to: 'on'
|
||
action:
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.bathroom_fan_cooldown
|
||
- id: 7a1db18b-0366-47cf-8260-6109b01447f9
|
||
alias: 'Ванная: Выключение вентилятора по окончании продува'
|
||
description: После истечения таймера bathroom_fan_cooldown вентилятора автоматически
|
||
выключают.
|
||
mode: single
|
||
trigger:
|
||
- platform: event
|
||
event_type: timer.finished
|
||
event_data:
|
||
entity_id: timer.bathroom_fan_cooldown
|
||
action:
|
||
- service: fan.turn_off
|
||
target:
|
||
entity_id: fan.bathroom_relay_l1
|
||
- id: 5525cbdc-3a8d-4464-908e-795c8205b40c
|
||
alias: 'Ванная: Освещение, вкл/выкл с выключателя'
|
||
description: Управление светом через MQTT-выключатель.
|
||
mode: restart
|
||
trigger:
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: cc6ef89720abb376a24e910e13f37902
|
||
type: action
|
||
subtype: single_left
|
||
action:
|
||
- if:
|
||
condition: state
|
||
entity_id: binary_sensor.is_night_mode
|
||
state: 'on'
|
||
then:
|
||
- service: script.turn_on
|
||
target:
|
||
entity_id: script.bathroom_toggle_night_mode
|
||
else:
|
||
- service: script.turn_on
|
||
target:
|
||
entity_id: script.bathroom_toggle_day_mode
|
||
- id: 0007279c-13b5-402b-9aef-bf264273fa90
|
||
alias: 'Ванная: Освещение, вкл по движению и датчикам открытия'
|
||
description: Включает свет в зависимости от времени суток.
|
||
mode: restart
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.bathroom_open_door
|
||
from: 'off'
|
||
to: 'on'
|
||
for:
|
||
seconds: 1
|
||
- platform: state
|
||
entity_id: binary_sensor.bathroom_motions
|
||
from: 'off'
|
||
to: 'on'
|
||
for:
|
||
seconds: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.bathroom_cleaning_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.bathroom_lights_startup_protection
|
||
state: 'off'
|
||
action:
|
||
- if:
|
||
condition: state
|
||
entity_id: binary_sensor.is_night_mode
|
||
state: 'on'
|
||
then:
|
||
- service: script.turn_on
|
||
target:
|
||
entity_id: script.bathroom_turn_on_night_mode
|
||
else:
|
||
- service: script.turn_on
|
||
target:
|
||
entity_id: script.bathroom_turn_on_day_mode
|
||
- id: 50323f55-c6dd-483a-8799-af3c57e3e363
|
||
alias: 'Ванная: Отмена таймера при обнаружении движения'
|
||
description: Отменяет таймер, если снова появилось движение.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.bathroom_motions
|
||
to: 'on'
|
||
condition:
|
||
- condition: state
|
||
entity_id: timer.timer_bathroom
|
||
state: active
|
||
- condition: state
|
||
entity_id: input_boolean.bathroom_cleaning_mode
|
||
state: 'off'
|
||
action:
|
||
- service: timer.cancel
|
||
target:
|
||
entity_id: timer.timer_bathroom
|
||
- id: e519fa4c-bbad-4b0d-b06c-8521b3b10131
|
||
alias: 'Ванная: Запуск таймера при отсутствии движения'
|
||
description: Если движения нет 1 минуту, запускает таймер авто-выключения.
|
||
mode: restart
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.bathroom_motions
|
||
to: 'off'
|
||
for:
|
||
minutes: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: group.bathroom_all_lights
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.bathroom_cleaning_mode
|
||
state: 'off'
|
||
action:
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.timer_bathroom
|
||
data:
|
||
duration: '{{ (states(''input_number.bathroom_timer_duration'') | float * 60)
|
||
| int }}'
|
||
- id: b30b7ad8-6563-4279-a78f-1a113f9cb252
|
||
alias: 'Ванная: Освещение, выключение по таймеру'
|
||
description: Выключает свет по истечении таймера.
|
||
mode: single
|
||
trigger:
|
||
- platform: event
|
||
event_type: timer.finished
|
||
event_data:
|
||
entity_id: timer.timer_bathroom
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.bathroom_cleaning_mode
|
||
state: 'off'
|
||
action:
|
||
- service: light.turn_off
|
||
target:
|
||
entity_id: group.bathroom_all_lights
|
||
- id: 0c5020c3-e674-4789-8086-38dbc07253d7
|
||
alias: 'Ванная: Включение реле основного света при недоступности спотов'
|
||
description: Включает резервный свет, если >=2 спотов 'unavailable'.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id:
|
||
- light.bathroom_spot_r1_philips
|
||
- light.bathroom_spot_r2_philips
|
||
- light.bathroom_spot_l1_philips
|
||
- light.bathroom_spot_c1_philips
|
||
- light.bathroom_spot_c2_philips
|
||
to: unavailable
|
||
for:
|
||
seconds: 30
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.bathroom_lights_startup_protection
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: light.bathroom_main
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: "{% set unavailable_count = \n [states.light.bathroom_spot_r1_philips,\n\
|
||
\ states.light.bathroom_spot_r2_philips,\n states.light.bathroom_spot_l1_philips,\n\
|
||
\ states.light.bathroom_spot_c1_philips,\n states.light.bathroom_spot_c2_philips]\n\
|
||
\ | selectattr('state', 'eq', 'unavailable')\n | list | length %}\n{{ unavailable_count\
|
||
\ >= 2 }}\n"
|
||
action:
|
||
- service: light.turn_on
|
||
target:
|
||
entity_id: light.bathroom_main
|
||
- service: notify.master
|
||
data:
|
||
message: ⚠️ Включено резервное освещение в ванной. Недоступны споты.
|
||
- id: 14a6f0ef-8217-4fc6-8dca-067875b950a7
|
||
alias: 'Ванная: Выключение света после перезагрузки'
|
||
description: Выключает свет после старта, если нет движения.
|
||
mode: single
|
||
trigger:
|
||
- platform: homeassistant
|
||
event: start
|
||
action:
|
||
- delay:
|
||
seconds: 30
|
||
- condition: state
|
||
entity_id: binary_sensor.bathroom_motions
|
||
state: 'off'
|
||
for:
|
||
minutes: 1
|
||
- service: light.turn_off
|
||
target:
|
||
entity_id:
|
||
- group.bathroom_all_lights
|
||
- light.bathroom_main
|
||
- id: 048bc34f-9e6d-475c-84ed-0af54dedeed9
|
||
alias: 'Ванная: Таймер защиты при запуске'
|
||
mode: single
|
||
trigger:
|
||
- platform: homeassistant
|
||
event: start
|
||
action:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.bathroom_lights_startup_protection
|
||
- delay:
|
||
minutes: 5
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.bathroom_lights_startup_protection
|
||
- id: a658b6fc-d264-4c6b-8185-e3b503f5a7e5
|
||
alias: 'Спальня: Отключение розетки при зарядке телефона Андрея ночью'
|
||
description: 'Отключение розетки для зарядки Google Pixel 8 PRO, чтобы предотвратить
|
||
перезарядку и перегрев устройства ночью.
|
||
|
||
'
|
||
mode: single
|
||
trigger:
|
||
- platform: numeric_state
|
||
entity_id: sensor.pixel_8_pro_battery_level
|
||
above: 99
|
||
for:
|
||
minutes: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: sensor.pixel_8_pro_battery_state
|
||
state: charging
|
||
- condition: time
|
||
after: 01:00:00
|
||
before: 07:00:00
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{{ states(''sensor.pixel_8_pro_battery_level'') not in [''unknown'',
|
||
''unavailable''] }}'
|
||
- condition: state
|
||
entity_id: switch.0x00158d0002530ba3
|
||
state: 'on'
|
||
action:
|
||
- service: switch.turn_off
|
||
target:
|
||
entity_id: switch.0x00158d0002530ba3
|
||
- service: system_log.write
|
||
data:
|
||
message: 'Розетка зарядки отключена ночью (уровень: {{ states(''sensor.pixel_8_pro_battery_level'')
|
||
}}%).'
|
||
level: info
|
||
- id: 9f1229c2-0ce2-4483-9953-1f6cdc6fa18e
|
||
alias: Уведомление о низкой температуре в спальне (усреднённое значение)
|
||
description: 'Уведомление, если температура в спальне ниже 20° и открыта дверь/окно.
|
||
|
||
'
|
||
mode: single
|
||
trigger:
|
||
- platform: numeric_state
|
||
entity_id: sensor.temperatura_v_spalne_sglazhennaia
|
||
below: 20
|
||
for:
|
||
minutes: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: binary_sensor.0x00158d00044d5d11_contact
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
state: 'on'
|
||
- condition: template
|
||
value_template: '{{ states(''sensor.temperatura_v_spalne_sglazhennaia'') not in
|
||
[''unknown'', ''unavailable''] }}'
|
||
- condition: state
|
||
entity_id: input_boolean.bedroom_th_notice
|
||
state: 'off'
|
||
action:
|
||
- variables:
|
||
message: Температура в спальне ниже 20°. Динозавры любят тепло! Закройте балкон
|
||
в спальне.
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
sequence:
|
||
- service: notify.master
|
||
data:
|
||
message: '{{ message }}'
|
||
- service: script.yandex_tts_temp_status
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.bedroom_th_notice
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.bedroom_th_notice_reset
|
||
data:
|
||
duration: 00:{{ states('input_number.low_th_notification_reset_period') | int
|
||
}}:00
|
||
- service: system_log.write
|
||
data:
|
||
message: Уведомление о низкой температуре в спальне отправлено ({{ states('sensor.temperatura_v_spalne_sglazhennaia')
|
||
}}°).
|
||
level: info
|
||
- id: fdf3d865-6bdb-4c9b-9acd-fa7f7dc432d6
|
||
alias: 'HELPER: Сброс уведомлений о температуре в спальне'
|
||
mode: single
|
||
trigger:
|
||
- platform: event
|
||
event_type: timer.finished
|
||
event_data:
|
||
entity_id: timer.bedroom_th_notice_reset
|
||
action:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.bedroom_th_notice
|
||
- service: system_log.write
|
||
data:
|
||
message: Флаг уведомления о температуре в спальне сброшен.
|
||
level: info
|
||
- id: fc57ec27-9c9d-489a-8f5f-050b489466f7
|
||
alias: 'Прихожая: Вкл/выкл света кнопкой'
|
||
description: Тоггл света по кнопке; после — старт/отмена таймера по факту.
|
||
mode: restart
|
||
trigger:
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: cfd464e1cbfa3da2ddd4f2109d74eb4e
|
||
type: action
|
||
subtype: single
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
action:
|
||
- type: toggle
|
||
device_id: 61c0ac07893316543e261176eb0cb5f9
|
||
entity_id: 89add52cab26b9b6bcad7e86fd6387ec
|
||
domain: light
|
||
- choose:
|
||
- conditions:
|
||
- condition: or
|
||
conditions:
|
||
- condition: state
|
||
entity_id: light.hallway_switch
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: light.gateway_light_04cf8c977cdd
|
||
state: 'on'
|
||
sequence:
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.timer_hallway
|
||
data:
|
||
duration: '{{ (states(''input_number.hallway_timer_duration'') | float(1.5)
|
||
* 60) | int }}'
|
||
default:
|
||
- service: timer.cancel
|
||
target:
|
||
entity_id: timer.timer_hallway
|
||
- service: system_log.write
|
||
data:
|
||
message: Свет в прихожей toggled по кнопке.
|
||
level: info
|
||
- id: 3c9a07a9-58ee-4287-87ee-734687c93bba
|
||
alias: 'Прихожая: Включение освещения при открытии двери'
|
||
description: Включает свет при устойчиво открытой двери.
|
||
mode: restart
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.hallway_door_contact
|
||
to: 'on'
|
||
for:
|
||
seconds: 5
|
||
condition:
|
||
- condition: state
|
||
entity_id: light.hallway_switch
|
||
state: 'off'
|
||
- condition: time
|
||
after: 08:30:00
|
||
before: '23:00:00'
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{{ states(''binary_sensor.hallway_door_contact'') not in [''unknown'',''unavailable'','''']
|
||
}}'
|
||
action:
|
||
- service: light.turn_on
|
||
target:
|
||
entity_id: light.hallway_switch
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.timer_hallway
|
||
data:
|
||
duration: '{{ (states(''input_number.hallway_timer_duration'') | float(1.5)
|
||
* 60) | int }}'
|
||
- service: system_log.write
|
||
data:
|
||
message: Свет в прихожей включён по двери.
|
||
level: info
|
||
- id: 7f815fb8-98f4-437a-96fc-06984d9a4a25
|
||
alias: 'Прихожая: Вкл света при движении и низкой освещенности'
|
||
description: Включает подсветку шлюза при движении и низкой освещённости.
|
||
mode: restart
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.hallway_motion_occupancy
|
||
to: 'on'
|
||
for:
|
||
seconds: 10
|
||
condition:
|
||
- condition: numeric_state
|
||
entity_id: sensor.illumination_04cf8c977cdd
|
||
below: 250
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{{ states(''binary_sensor.hallway_motion_occupancy'') not in
|
||
[''unknown'',''unavailable'',''''] }}'
|
||
action:
|
||
- service: light.turn_on
|
||
target:
|
||
entity_id: light.gateway_light_04cf8c977cdd
|
||
data:
|
||
brightness_pct: 7
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.timer_hallway
|
||
data:
|
||
duration: '{{ (states(''input_number.hallway_timer_duration'') | float(1.5)
|
||
* 60) | int }}'
|
||
- service: system_log.write
|
||
data:
|
||
message: Свет в прихожей включён по движению.
|
||
level: info
|
||
- id: 3b6e37de-3b10-4201-afad-221dbe4cd4a0
|
||
alias: 'Прихожая: Запуск таймера при отсутствии движения'
|
||
description: Стартует таймер, когда движение прекратилось.
|
||
mode: restart
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.hallway_motion_occupancy
|
||
to: 'off'
|
||
for:
|
||
seconds: 10
|
||
condition:
|
||
- condition: or
|
||
conditions:
|
||
- condition: state
|
||
entity_id: light.hallway_switch
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: light.gateway_light_04cf8c977cdd
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.bathroom_cleaning_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
action:
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.timer_hallway
|
||
data:
|
||
duration: '{{ (states(''input_number.hallway_timer_duration'') | float(1.5)
|
||
* 60) | int }}'
|
||
- service: system_log.write
|
||
data:
|
||
message: Таймер прихожей запущен (отсутствие движения).
|
||
level: info
|
||
- id: 479b917d-e4c2-4149-97e7-d12779b9f3ce
|
||
alias: 'Прихожая: Перезапуск таймера при обнаружении движения'
|
||
description: Продлевает освещение при новом движении.
|
||
mode: restart
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.hallway_motion_occupancy
|
||
to: 'on'
|
||
for:
|
||
seconds: 5
|
||
condition:
|
||
- condition: or
|
||
conditions:
|
||
- condition: state
|
||
entity_id: light.hallway_switch
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: light.gateway_light_04cf8c977cdd
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
action:
|
||
- service: timer.cancel
|
||
target:
|
||
entity_id: timer.timer_hallway
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.timer_hallway
|
||
data:
|
||
duration: '{{ (states(''input_number.hallway_timer_duration'') | float(1.5)
|
||
* 60) | int }}'
|
||
- service: system_log.write
|
||
data:
|
||
message: Таймер прихожей перезапущен (движение).
|
||
level: info
|
||
- id: 7f6bdbae-a73b-4509-8db8-43f71a3525ca
|
||
alias: 'Прихожая: Выключение света по таймеру'
|
||
description: Выключает освещение по окончании таймера (кроме режима уборки).
|
||
mode: single
|
||
trigger:
|
||
- platform: event
|
||
event_type: timer.finished
|
||
event_data:
|
||
entity_id: timer.timer_hallway
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.bathroom_cleaning_mode
|
||
state: 'off'
|
||
action:
|
||
- service: light.turn_off
|
||
target:
|
||
entity_id:
|
||
- light.hallway_switch
|
||
- light.gateway_light_04cf8c977cdd
|
||
- service: system_log.write
|
||
data:
|
||
message: Свет в прихожей выключен по таймеру.
|
||
level: info
|
||
- id: first-door-home-automation
|
||
alias: 'Прихожая: Включение света при первом открытии двери после прихода домой'
|
||
description: Если человек только пришёл (менее 10 минут), первое открытие двери
|
||
включает свет.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.hallway_door_contact
|
||
to: 'on'
|
||
for:
|
||
seconds: 5
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.hallway_first_door_open
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
- condition: template
|
||
value_template: '{{ (as_timestamp(now()) - as_timestamp(states.person.master.last_changed))
|
||
< 600 }}'
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{{ states(''binary_sensor.hallway_door_contact'') not in [''unknown'',''unavailable'','''']
|
||
}}'
|
||
action:
|
||
- service: light.turn_on
|
||
target:
|
||
entity_id: light.hallway_switch
|
||
- service: light.turn_on
|
||
target:
|
||
entity_id: light.gateway_light_04cf8c977cdd
|
||
data:
|
||
brightness_pct: 100
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.hallway_first_door_open
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.timer_hallway
|
||
data:
|
||
duration: '{{ (states(''input_number.hallway_timer_duration'') | float(1.5)
|
||
* 60) | int }}'
|
||
- service: system_log.write
|
||
data:
|
||
message: Свет в прихожей включён при первом входе.
|
||
level: info
|
||
- id: reset-first-door-flag
|
||
alias: 'Прихожая: Сброс флага первого открытия двери'
|
||
description: Сбрасывает флаг при уходе (not_home).
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: person.master
|
||
to: not_home
|
||
action:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.hallway_first_door_open
|
||
- service: system_log.write
|
||
data:
|
||
message: Флаг первого открытия двери сброшен (ушёл из дома).
|
||
level: info
|
||
- id: 37a7b942-71ea-456e-8f9e-1718c8c34a8d
|
||
alias: 'Уведомление. Яндекс: Звонок в дверь'
|
||
description: Алиса произносит фразу и мигает светом при нажатии кнопки.
|
||
mode: restart
|
||
trigger:
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: d2c3001cdc59660c456de45aec09da91
|
||
type: action
|
||
subtype: single
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
state: 'on'
|
||
action:
|
||
- variables:
|
||
was_on_led: '{{ is_state(''light.working_room_led'', ''on'') }}'
|
||
- service: script.yandex_tts_click_outdoor_button
|
||
- repeat:
|
||
count: '{{ states(''input_number.hallway_blink_count'') | int }}'
|
||
sequence:
|
||
- service: light.turn_on
|
||
target:
|
||
entity_id:
|
||
- light.gateway_light_04cf8c977cdd
|
||
- light.working_room_led
|
||
- delay: 00:00:01
|
||
- service: light.turn_off
|
||
target:
|
||
entity_id:
|
||
- light.gateway_light_04cf8c977cdd
|
||
- light.working_room_led
|
||
- delay: 00:00:01
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ was_on_led }}'
|
||
sequence:
|
||
- service: light.turn_on
|
||
target:
|
||
entity_id: light.working_room_led
|
||
default:
|
||
- service: light.turn_off
|
||
target:
|
||
entity_id: light.working_room_led
|
||
- service: system_log.write
|
||
data:
|
||
message: Обработан звонок в дверь (мигание выполнено).
|
||
level: info
|
||
- id: 26345165-2c00-489c-af7b-c4b92110c937
|
||
alias: Уведомление. Входную кнопку пытаются снять
|
||
description: TTS + Telegram при встряхивании кнопки.
|
||
mode: single
|
||
trigger:
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: d2c3001cdc59660c456de45aec09da91
|
||
type: action
|
||
subtype: shake
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
action:
|
||
- service: script.yandex_tts_shaking_outdoor_button
|
||
- service: notify.master
|
||
data:
|
||
message: ⚠️ Внимание! Входную кнопку пытаются снять 🛑
|
||
- service: system_log.write
|
||
data:
|
||
message: Обнаружена попытка снятия входной кнопки.
|
||
level: warning
|
||
- id: b29835d5-9911-47ec-8630-2adda70be854
|
||
alias: 'Кухня: Переключение освещения выключателями'
|
||
description: 'Управление основным светом и подсветкой фартука через кухонный выключатель
|
||
(правая клавиша) и сценический выключатель (1_single / 2_single).
|
||
|
||
'
|
||
mode: restart
|
||
trigger:
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: cc6ef89720abb376a24e910e13f37902
|
||
type: action
|
||
subtype: single_right
|
||
id: kitchen_switch_right
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: 719cda594198c3eafa3817b9230f2afa
|
||
type: action
|
||
subtype: 1_single
|
||
id: scenic_1_single
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: 719cda594198c3eafa3817b9230f2afa
|
||
type: action
|
||
subtype: 2_single
|
||
id: scenic_2_single
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
action:
|
||
- choose:
|
||
- conditions:
|
||
- condition: trigger
|
||
id: kitchen_switch_right
|
||
sequence:
|
||
- type: toggle
|
||
device_id: cc6ef89720abb376a24e910e13f37902
|
||
entity_id: 6ecc35aae49d8307be87809073a32233
|
||
domain: light
|
||
- conditions:
|
||
- condition: trigger
|
||
id: scenic_1_single
|
||
sequence:
|
||
- service: light.toggle
|
||
target:
|
||
entity_id: light.kitchen_fartuh
|
||
- conditions:
|
||
- condition: trigger
|
||
id: scenic_2_single
|
||
sequence:
|
||
- service: light.toggle
|
||
target:
|
||
entity_id: light.kitchen_main_light
|
||
- id: dc8af8f7-c0f5-4244-867b-00fc546039ba
|
||
alias: 'Кухня: Предупреждение о необходимости включения вытяжки (гистерезис)'
|
||
description: 'При включении binary_sensor.kitchen_need_ventilation (off→on) отправляем
|
||
уведомление и выставляем флаг kitchen_fan_cool_down, чтобы не повторяться.
|
||
|
||
'
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.kitchen_need_ventilation
|
||
from: 'off'
|
||
to: 'on'
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.kitchen_fan_cool_down
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: timer.kitchen_notification_cooldown_timer
|
||
state: idle
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
action:
|
||
- service: script.yandex_tts_kitchen_fan_alert
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.kitchen_fan_cool_down
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.kitchen_notification_cooldown_timer
|
||
data:
|
||
duration: '{{ (states(''input_number.kitchen_notification_cooldown_min'') |
|
||
float(30) * 60) | int }}'
|
||
- id: 8b7c3a73-7d74-4e6f-b1d5-4a9c1e3a9c12
|
||
alias: 'Кухня: Сброс предупреждения о необходимости вытяжки (гистерезис)'
|
||
description: Когда условия нормализовались (off), сбрасываем флаг.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.kitchen_need_ventilation
|
||
from: 'on'
|
||
to: 'off'
|
||
condition: []
|
||
action:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.kitchen_fan_cool_down
|
||
- id: 10f4f44c-a559-4281-9a1b-18aac1fd845b
|
||
alias: 'Кухня: Сброс флага вытяжки при старте'
|
||
mode: single
|
||
trigger:
|
||
- platform: homeassistant
|
||
event: start
|
||
condition:
|
||
- condition: state
|
||
entity_id: binary_sensor.kitchen_need_ventilation
|
||
state: 'off'
|
||
action:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.kitchen_fan_cool_down
|
||
- id: e2d5d614-46cf-4706-9bfe-7a17cd81f0c1
|
||
alias: 'Кухня: Автоматическое включение вытяжки'
|
||
description: Включает вытяжку, когда need_ventilation устойчиво on 1 минуту.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.kitchen_need_ventilation
|
||
from: 'off'
|
||
to: 'on'
|
||
for:
|
||
minutes: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: switch.sonoff_10024c81be
|
||
state: 'off'
|
||
action:
|
||
- service: switch.turn_on
|
||
target:
|
||
entity_id: switch.sonoff_10024c81be
|
||
- id: d2986069-fb9c-4425-afc7-1b17f96cfff3
|
||
alias: 'Кухня: Запуск таймера задержки выключения вытяжки'
|
||
description: Стартует таймер, когда условия нормализовались.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.kitchen_need_ventilation
|
||
from: 'on'
|
||
to: 'off'
|
||
condition:
|
||
- condition: state
|
||
entity_id: switch.sonoff_10024c81be
|
||
state: 'on'
|
||
action:
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.kitchen_fan_delay_timer
|
||
data:
|
||
duration: '{{ (states(''input_number.kitchen_fan_delay_min'') | float(1) * 60)
|
||
| int }}'
|
||
- id: 95fecbf7-3ac8-4b4a-a7a8-a857a307be68
|
||
alias: 'Кухня: Выключение вытяжки по таймеру'
|
||
description: Выключает вытяжку по окончании таймера, если условия нормальны.
|
||
mode: single
|
||
trigger:
|
||
- platform: event
|
||
event_type: timer.finished
|
||
event_data:
|
||
entity_id: timer.kitchen_fan_delay_timer
|
||
condition:
|
||
- condition: state
|
||
entity_id: binary_sensor.kitchen_need_ventilation
|
||
state: 'off'
|
||
action:
|
||
- service: switch.turn_off
|
||
target:
|
||
entity_id: switch.sonoff_10024c81be
|
||
- id: b44e93fc-7746-4ff5-8846-2d350fecb813
|
||
alias: Уведомление о необходимости проветривания (усреднённое значение)
|
||
description: CO2 выше жёсткого порога — уведомить (TTS/Telegram), проставить флаг.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.livingroom_ventilation_need
|
||
to: 'on'
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.co2_voice_notification_sensor
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
action:
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
sequence:
|
||
- service: script.yandex_tts_co2_alert
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
sequence:
|
||
- service: notify.master
|
||
data:
|
||
message: Уровень CO2 превышает норму. Рекомендуется проветрить гостиную.
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.co2_voice_notification_sensor
|
||
- id: 31a294d7-4c2d-4289-a8b0-04f2cea38553
|
||
alias: Уведомление о завершении проветривания (усреднённое значение)
|
||
description: CO2 устойчиво ниже мягкого порога — уведомить (TTS/Telegram), проставить
|
||
флаг.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.livingroom_ventilation_status
|
||
from: 'off'
|
||
to: 'on'
|
||
for:
|
||
minutes: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.co2_text_notification_sensor
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
action:
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
sequence:
|
||
- service: script.yandex_tts_co2_normal
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
sequence:
|
||
- service: notify.master
|
||
data:
|
||
message: Проветривание завершено. Уровень CO2 в норме.
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.co2_text_notification_sensor
|
||
- id: 469fe5d8-4b48-40bb-b967-0d09a83ee4f0
|
||
alias: 'HELPER: Сброс уведомлений СО2'
|
||
mode: restart
|
||
trigger:
|
||
- platform: state
|
||
entity_id:
|
||
- input_boolean.co2_voice_notification_sensor
|
||
- input_boolean.co2_text_notification_sensor
|
||
to: 'on'
|
||
action:
|
||
- delay: 00:{{ states('input_number.co2_notification_reset_period') | int }}:00
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id:
|
||
- input_boolean.co2_voice_notification_sensor
|
||
- input_boolean.co2_text_notification_sensor
|
||
- id: 9fff2de3-f169-4fda-8a8a-91966fc51f13
|
||
alias: 'Гостиная: переключение бра (кнопка 4, одиночное нажатие)'
|
||
mode: restart
|
||
trigger:
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: 719cda594198c3eafa3817b9230f2afa
|
||
type: action
|
||
subtype: 4_single
|
||
condition: []
|
||
action:
|
||
- service: light.toggle
|
||
target:
|
||
entity_id: light.livingroom_scone_dimmer
|
||
- id: 54ea7c3d-a37d-4ce4-80ff-f2da00a450c2
|
||
alias: 'Гостиная: переключение люстры (кнопка 3, одиночное нажатие)'
|
||
mode: restart
|
||
trigger:
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: 719cda594198c3eafa3817b9230f2afa
|
||
type: action
|
||
subtype: 3_single
|
||
condition: []
|
||
action:
|
||
- service: light.toggle
|
||
target:
|
||
entity_id: light.livingroom_main_switch_left
|
||
- id: 916eb0c3-eee6-409d-9ce2-4dc00c9f7051
|
||
alias: 'Гостиная: переключение правого света (кнопка 4, двойное нажатие)'
|
||
mode: restart
|
||
trigger:
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: 719cda594198c3eafa3817b9230f2afa
|
||
type: action
|
||
subtype: 4_double
|
||
condition: []
|
||
action:
|
||
- service: light.toggle
|
||
target:
|
||
entity_id: light.livingroom_main_switch_right
|
||
- id: f4e42442-155e-4d0a-87c2-3f21fd72025d
|
||
alias: 'Гостиная: Климат, отключить устройства при открытии двери'
|
||
description: Через 1 минуту открытой двери выключить климат/очиститель/увлажнитель,
|
||
запомнив их состояние.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.doors_in_kitchen_livingroom
|
||
to: 'on'
|
||
for:
|
||
minutes: 1
|
||
condition: []
|
||
action:
|
||
- choose:
|
||
- conditions:
|
||
- condition: template
|
||
value_template: '{{ not is_state(''climate.konditsioner'', ''off'') }}'
|
||
- condition: state
|
||
entity_id: input_boolean.winter_mode
|
||
state: 'off'
|
||
sequence:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.door_open_climate_pre_state
|
||
- service: climate.turn_off
|
||
target:
|
||
entity_id: climate.konditsioner
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: switch.zhimi_mb3_a5d3_switch_status
|
||
state: 'on'
|
||
sequence:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.door_open_fan_pre_state
|
||
- service: switch.turn_off
|
||
target:
|
||
entity_id: switch.zhimi_mb3_a5d3_switch_status
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: switch.evolution_hf_878
|
||
state: 'on'
|
||
sequence:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.door_open_humidifier_pre_state
|
||
- service: switch.turn_off
|
||
target:
|
||
entity_id: switch.evolution_hf_878
|
||
- id: 0347cae6-1b2f-436a-a54c-792feafa9620
|
||
alias: 'Гостиная: Климат, восстановление состояния устройств'
|
||
description: При закрытии двери восстановить устройства, если они были выключены
|
||
автоматикой.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.doors_in_kitchen_livingroom
|
||
to: 'off'
|
||
condition: []
|
||
action:
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.door_open_climate_pre_state
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.winter_mode
|
||
state: 'off'
|
||
sequence:
|
||
- service: climate.turn_on
|
||
target:
|
||
entity_id: climate.konditsioner
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.door_open_fan_pre_state
|
||
state: 'on'
|
||
sequence:
|
||
- service: switch.turn_on
|
||
target:
|
||
entity_id: switch.zhimi_mb3_a5d3_switch_status
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.door_open_humidifier_pre_state
|
||
state: 'on'
|
||
sequence:
|
||
- service: switch.turn_on
|
||
target:
|
||
entity_id: switch.evolution_hf_878
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id:
|
||
- input_boolean.door_open_climate_pre_state
|
||
- input_boolean.door_open_fan_pre_state
|
||
- input_boolean.door_open_humidifier_pre_state
|
||
- id: b9867c28-be9f-425e-9fee-0aea777d04c0
|
||
alias: 'HELPER: Защита — не включать кондиционер при активном Зимнем режиме'
|
||
description: Если включён зимний режим, любое включение кондиционера тут же отменяется.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: climate.konditsioner
|
||
from: 'off'
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.winter_mode
|
||
state: 'on'
|
||
action:
|
||
- service: climate.turn_off
|
||
target:
|
||
entity_id: climate.konditsioner
|
||
- service: notify.master
|
||
data:
|
||
message: 'Кондиционер принудительно отключён: включён Зимний режим.'
|
||
- service: script.yandex_tts_kondicioner_warning
|
||
- id: 4d19ce98-16f7-41ea-afcf-34ffb4e64b4a
|
||
alias: 'Уведомление. Телеграм: Необходимо заменить фильтр'
|
||
description: Если ресурс фильтра <10% в течение 1 мин — уведомить и пометить.
|
||
mode: single
|
||
trigger:
|
||
- platform: numeric_state
|
||
entity_id: sensor.konditsioner_filter_remaining_life
|
||
below: 10
|
||
for:
|
||
minutes: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.filter_replace_notified
|
||
state: 'off'
|
||
- condition: time
|
||
after: 08:00:00
|
||
before: '20:00:00'
|
||
action:
|
||
- service: notify.master
|
||
data:
|
||
message: Необходимо заменить фильтр в кондиционере
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.filter_replace_notified
|
||
- id: da15cbba-b4f0-42e5-8bcd-5e9affe17073
|
||
alias: 'HELPER: Сброс уведомления о замене фильтра'
|
||
description: Если ресурс фильтра снова >10% (1 мин), сбросить флаг.
|
||
mode: single
|
||
trigger:
|
||
- platform: numeric_state
|
||
entity_id: sensor.konditsioner_filter_remaining_life
|
||
above: 10
|
||
for:
|
||
minutes: 1
|
||
condition: []
|
||
action:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.filter_replace_notified
|
||
- id: 12858001-138d-4238-97f9-e5a501c6fe18
|
||
alias: 'Уведомление: Розетка недоступна (электричество отключено)'
|
||
description: Уведомляет, если розетка стала недоступной (ИБП/электричество).
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id:
|
||
- switch.my_multi_outlet_left
|
||
- switch.my_multi_outlet_right
|
||
to: unavailable
|
||
for:
|
||
minutes: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
state: 'on'
|
||
action:
|
||
- service: notify.master
|
||
data:
|
||
message: '⚠️ Внимание! Розетка {{ trigger.entity_id }} недоступна. Возможно,
|
||
отключено электричество или проблемы с ИБП.
|
||
|
||
'
|
||
- service: system_log.write
|
||
data:
|
||
message: Розетка {{ trigger.entity_id }} недоступна — уведомление отправлено.
|
||
level: warning
|
||
- id: server_room_fan_control
|
||
alias: 'Контроль температуры серверной: управление вентилятором'
|
||
description: High — включаем вентилятор; Off — запускаем подтверждение низкой температуры.
|
||
mode: restart
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.server_temp_high
|
||
from: 'off'
|
||
to: 'on'
|
||
id: high
|
||
- platform: state
|
||
entity_id: binary_sensor.server_temp_high
|
||
from: 'on'
|
||
to: 'off'
|
||
id: low
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{{ states(''sensor.0xa4c13861a18df7c8_temperature'') not in [''unknown'',''unavailable'']
|
||
}}
|
||
|
||
'
|
||
action:
|
||
- choose:
|
||
- conditions:
|
||
- condition: trigger
|
||
id: high
|
||
sequence:
|
||
- service: timer.cancel
|
||
target:
|
||
entity_id:
|
||
- timer.server_temp_off_persist
|
||
- timer.server_fan_delay
|
||
- service: fan.turn_on
|
||
target:
|
||
entity_id: fan.server_fan
|
||
- service: system_log.write
|
||
data:
|
||
message: 'Вентилятор сервера включён (темп: {{ states(''sensor.0xa4c13861a18df7c8_temperature'')
|
||
}}°).'
|
||
level: info
|
||
- conditions:
|
||
- condition: trigger
|
||
id: low
|
||
- condition: state
|
||
entity_id: fan.server_fan
|
||
state: 'on'
|
||
sequence:
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.server_temp_off_persist
|
||
data:
|
||
duration: '{{ (states(''input_number.server_temp_off_persist_min'') | float(30)
|
||
* 60) | int }}'
|
||
- service: system_log.write
|
||
data:
|
||
message: Запущен таймер подтверждения низкой температуры сервера.
|
||
level: info
|
||
- id: server_temp_off_persist_finished
|
||
alias: 'Сервер: стабильная низкая температура — задержка выключения вентилятора'
|
||
description: После подтверждённо низкой температуры запускаем задержку выключения
|
||
вентилятора.
|
||
mode: single
|
||
trigger:
|
||
- platform: event
|
||
event_type: timer.finished
|
||
event_data:
|
||
entity_id: timer.server_temp_off_persist
|
||
condition:
|
||
- condition: state
|
||
entity_id: binary_sensor.server_temp_high
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: fan.server_fan
|
||
state: 'on'
|
||
action:
|
||
- service: timer.start
|
||
target:
|
||
entity_id: timer.server_fan_delay
|
||
data:
|
||
duration: '{{ (states(''input_number.server_fan_delay_min'') | float(5) * 60)
|
||
| int }}'
|
||
- service: system_log.write
|
||
data:
|
||
message: Запущен таймер задержки выключения вентилятора сервера.
|
||
level: info
|
||
- id: server_fan_delay_off
|
||
alias: Выключение вентилятора сервера по таймеру
|
||
description: Выключает вентилятор после таймера, если температура всё ещё низкая.
|
||
mode: single
|
||
trigger:
|
||
- platform: event
|
||
event_type: timer.finished
|
||
event_data:
|
||
entity_id: timer.server_fan_delay
|
||
condition:
|
||
- condition: state
|
||
entity_id: binary_sensor.server_temp_high
|
||
state: 'off'
|
||
action:
|
||
- service: fan.turn_off
|
||
target:
|
||
entity_id: fan.server_fan
|
||
- service: system_log.write
|
||
data:
|
||
message: 'Вентилятор сервера выключен по таймеру (темп: {{ states(''sensor.0xa4c13861a18df7c8_temperature'')
|
||
}}°).'
|
||
level: info
|
||
- id: 29873ab9-335c-4c39-9898-b01b5a482606
|
||
alias: 'Кабинет: Вкл/выкл подсветки рабочей зоны кнопкой'
|
||
description: 'Одиночное нажатие физической кнопки переключает (toggle) подсветку
|
||
рабочего стола.
|
||
|
||
'
|
||
mode: restart
|
||
trigger:
|
||
- platform: device
|
||
domain: mqtt
|
||
device_id: 8067572bca7252311fc2ce6152f90f34
|
||
type: action
|
||
subtype: single
|
||
discovery_id: 0x00158d0003cffd82 action_single
|
||
condition: []
|
||
action:
|
||
- type: toggle
|
||
device_id: 3a9919ab25ad577158f751a70c35f8e2
|
||
entity_id: light.working_room_led
|
||
domain: light
|
||
- id: abe6206a-a428-4b31-928f-789c38355279
|
||
alias: Уведомление о низкой температуре в мастерской (усреднённое значение)
|
||
mode: single
|
||
trigger:
|
||
- platform: numeric_state
|
||
entity_id: sensor.srednee_znachenie_temperatury_v_masterskoi_2
|
||
below: 20
|
||
for:
|
||
minutes: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: binary_sensor.masterskaia_balkon_contact
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.workroom_th_notice
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: "{{ states('sensor.srednee_znachenie_temperatury_v_masterskoi_2')\
|
||
\ not in ['unknown','unavailable'] and\n states('binary_sensor.masterskaia_balkon_contact')\
|
||
\ not in ['unknown','unavailable'] }}\n"
|
||
action:
|
||
- variables:
|
||
telegram_message: Температура в мастерской ниже 20°. Это мастерская, а не холодильник!
|
||
Закройте дверь.
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
sequence:
|
||
- service: media_player.play_media
|
||
target:
|
||
entity_id: media_player.yandex_station_ff98f0294437799304d0788d
|
||
data:
|
||
media_content_id: 'Внимание! Температура в мастерской ниже двадцати градусов.
|
||
Закройте дверь!
|
||
|
||
'
|
||
media_content_type: text
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
sequence:
|
||
- service: notify.master
|
||
data:
|
||
message: '{{ telegram_message }}'
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.workroom_th_notice
|
||
- service: system_log.write
|
||
data:
|
||
message: Отправлено уведомление о низкой температуре в мастерской (<20°C).
|
||
level: info
|
||
- id: 9bdeb719-0792-4176-8451-367273fdbb4c
|
||
alias: 'HELPER: Сброс уведомлений о температуре в мастерской'
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: input_boolean.workroom_th_notice
|
||
to: 'on'
|
||
action:
|
||
- delay: 00:{{ states('input_number.low_th_notification_reset_period') | int }}:00
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.workroom_th_notice
|
||
- id: set_telegram_allowed_users_on_start
|
||
alias: Set Telegram Allowed Users on Start
|
||
initial_state: true
|
||
triggers:
|
||
- platform: homeassistant
|
||
event: start
|
||
actions:
|
||
- service: input_text.set_value
|
||
target:
|
||
entity_id: input_text.telegram_allowed_users
|
||
data:
|
||
value: secret telegram_allowed_users_list
|
||
- id: telegram_bot_start
|
||
alias: Telegram Bot Start (Приветствие)
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /start
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
parse_mode: html
|
||
message: <b>Добро пожаловать в умный дом</b>
|
||
- service: script.send_main_menu
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- service: system_log.write
|
||
data:
|
||
message: 'Telegram бот запущен (user: {{ trigger.event.data.user_id }})'
|
||
level: info
|
||
- id: telegram_bot_main_menu
|
||
alias: Telegram Bot Main Menu
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /main_menu
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.send_main_menu
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_menu_back
|
||
alias: Telegram Bot Menu Back
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /menu_back
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.delete_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
- service: script.send_main_menu
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_livingroom_control
|
||
alias: Telegram Bot Living Room Menu
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /livingroom_control
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.delete_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
- service: script.send_livingroom_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_workroom_control
|
||
alias: Telegram Bot Workroom Menu
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /workroom_control
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.delete_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
- service: script.send_workroom_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_bedroom_control
|
||
alias: Telegram Bot Bedroom Menu
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /bedroom_control
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.delete_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
- service: script.send_bedroom_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_kitchen_control
|
||
alias: Telegram Bot Kitchen Menu
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /kitchen_control
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.delete_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
- service: script.send_kitchen_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_bathroom_control
|
||
alias: Telegram Bot Bathroom Menu
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /bathroom_control
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.delete_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
- service: script.send_bathroom_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_hallway_control
|
||
alias: Telegram Bot Hallway Menu
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /hallway_control
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.delete_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
- service: script.send_hallway_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_system_control
|
||
alias: Telegram Bot System Control
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /system_control
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.delete_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
- service: script.send_system_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_toggle_livingroom_main_switch_left
|
||
alias: Telegram Bot Toggle Livingroom Main Switch Left
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_livingroom_main_switch_left
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.livingroom_main_switch_left
|
||
domain: light
|
||
menu_script: script.send_livingroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_livingroom_main_switch_right
|
||
alias: Telegram Bot Toggle Livingroom Main Switch Right
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_livingroom_main_switch_right
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.livingroom_main_switch_right
|
||
domain: light
|
||
menu_script: script.send_livingroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_livingroom_scone_dimmer
|
||
alias: Telegram Bot Toggle Livingroom Scone Dimmer
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_livingroom_scone_dimmer
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.livingroom_scone_dimmer
|
||
domain: light
|
||
menu_script: script.send_livingroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_livingroom_socket_corner_r
|
||
alias: Telegram Bot Toggle Livingroom Socket Corner R
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_livingroom_socket_corner_r
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: switch.livingroom_socket_corner_r
|
||
domain: switch
|
||
menu_script: script.send_livingroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_livingroom_socket_l
|
||
alias: Telegram Bot Toggle Livingroom Socket L
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_livingroom_socket_l
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: switch.livingroom_socket_l
|
||
domain: switch
|
||
menu_script: script.send_livingroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_livingroom_socket_r
|
||
alias: Telegram Bot Toggle Livingroom Socket R
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_livingroom_socket_r
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: switch.livingroom_socket_r
|
||
domain: switch
|
||
menu_script: script.send_livingroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_workroom_light
|
||
alias: Telegram Bot Toggle Workroom Light
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_workroom_light
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.workroom_switch
|
||
domain: light
|
||
menu_script: script.send_workroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_workroom_led
|
||
alias: Telegram Bot Toggle Workroom LED
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_workroom_led
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.working_room_led
|
||
domain: light
|
||
menu_script: script.send_workroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_workroom_plug
|
||
alias: Telegram Bot Toggle Workroom Plug
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_workroom_plug
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: switch.smart_plug_in_unit_vykliuchatel
|
||
domain: switch
|
||
menu_script: script.send_workroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_bedroom_light
|
||
alias: Telegram Bot Toggle Bedroom Light
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_bedroom_light
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.bedroom_switch_main
|
||
domain: light
|
||
menu_script: script.send_bedroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_bedroom_scone_t
|
||
alias: Telegram Bot Toggle Bedroom Tatiana's Scone
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_bedroom_scone_t
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.bedroom_left_switch_right
|
||
domain: light
|
||
menu_script: script.send_bedroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_bedroom_scone_a_small
|
||
alias: Telegram Bot Toggle Bedroom Andrei's Scone Small
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_bedroom_scone_a_small
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.bedroom_right_switch_left
|
||
domain: light
|
||
menu_script: script.send_bedroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_bedroom_scone_a_big
|
||
alias: Telegram Bot Toggle Bedroom Andrei's Scone Big
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_bedroom_scone_a_big
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.bedroom_right_switch_right
|
||
domain: light
|
||
menu_script: script.send_bedroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_bedroom_plug_left
|
||
alias: Telegram Bot Toggle Bedroom Plug Left
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_bedroom_plug_left
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: switch.0x00158d0002530bd9
|
||
domain: switch
|
||
menu_script: script.send_bedroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_bedroom_plug_right
|
||
alias: Telegram Bot Toggle Bedroom Plug Right
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_bedroom_plug_right
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: switch.0x00158d0002530ba3
|
||
domain: switch
|
||
menu_script: script.send_bedroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_kitchen_main_light
|
||
alias: Telegram Bot Toggle Kitchen Main Light
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_kitchen_main_light
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.kitchen_main_light
|
||
domain: light
|
||
menu_script: script.send_kitchen_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_kitchen_fartuh
|
||
alias: Telegram Bot Toggle Kitchen Fartuh
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_kitchen_fartuh
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: switch.kitchen_fartuh
|
||
domain: switch
|
||
menu_script: script.send_kitchen_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_bathroom_light
|
||
alias: Telegram Bot Toggle Bathroom Light
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_bathroom_light
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.light_bathroom
|
||
domain: light
|
||
menu_script: script.send_bathroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_bathroom_fan
|
||
alias: Telegram Bot Toggle Bathroom Fan
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_bathroom_fan
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: fan.bathroom_relay_l1
|
||
domain: fan
|
||
menu_script: script.send_bathroom_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_hallway_light
|
||
alias: Telegram Bot Toggle Hallway Light
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_hallway_light
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.hallway_switch
|
||
domain: light
|
||
menu_script: script.send_hallway_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_hallway_gateway_light
|
||
alias: Telegram Bot Toggle Hallway Gateway Light
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_hallway_gateway_light
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.gateway_light_04cf8c977cdd
|
||
domain: light
|
||
menu_script: script.send_hallway_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_router_socket
|
||
alias: Telegram Bot Toggle Router Socket
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_router_socket
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: switch.my_multi_outlet_left
|
||
domain: switch
|
||
menu_script: script.send_system_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_minipc_socket
|
||
alias: Telegram Bot Toggle MiniPC Socket
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_minipc_socket
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: switch.my_multi_outlet_right
|
||
domain: switch
|
||
menu_script: script.send_system_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_bathroom_power
|
||
alias: Telegram Bot Toggle Bathroom Power
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_bathroom_power
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: light.bathroom_main
|
||
domain: light
|
||
menu_script: script.send_system_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_silent_mode
|
||
alias: Telegram Bot Toggle Silent Mode
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_silent_mode
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: input_boolean.silent_mode
|
||
domain: input_boolean
|
||
menu_script: script.send_system_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_toggle_force_cctv_mode
|
||
alias: Telegram Bot Toggle Force CCTV Off Mode
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /toggle_force_cctv_mode
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: script.toggle_device
|
||
data:
|
||
entity: input_boolean.force_camera_off
|
||
domain: input_boolean
|
||
menu_script: script.send_system_status
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
user_id: '{{ trigger.event.data.user_id }}'
|
||
- id: telegram_bot_confirm_reboot
|
||
alias: Telegram Bot Confirm Reboot
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /confirm_reboot
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
parse_mode: html
|
||
message: <b>⚠️ Подтвердите перезагрузку системы</b>
|
||
inline_keyboard: "{{ [\n [ [\"✅ Подтвердить\", \"/force_reboot\"] ],\n \
|
||
\ [ [\"❌ Отмена\", \"/system_control\"] ]\n ] | tojson }}\n"
|
||
- service: system_log.write
|
||
data:
|
||
message: 'Запрос на подтверждение reboot (user: {{ trigger.event.data.user_id
|
||
}})'
|
||
level: warning
|
||
- id: telegram_bot_force_reboot
|
||
alias: Telegram Bot Force Reboot
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /force_reboot
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
parse_mode: html
|
||
message: <b>⚠️ Система будет перезагружена через 5 секунд</b>
|
||
- delay:
|
||
seconds: 5
|
||
- service: homeassistant.restart
|
||
- service: system_log.write
|
||
data:
|
||
message: 'Система перезагружена через Telegram (user: {{ trigger.event.data.user_id
|
||
}})'
|
||
level: warning
|
||
- id: telegram_bot_pve_status_refresh
|
||
alias: Telegram Bot PVE Status Refresh
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /pve_status_refresh
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: telegram_bot.delete_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_reboot_haos12
|
||
alias: Telegram Bot Reboot HAOS12
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /reboot_haos12
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.qemu_haos12_3_100_reboot
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_start_mariadb
|
||
alias: Telegram Bot Start LXC MariaDB
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /start_mariadb
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_mariadb_101_start
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_stop_mariadb
|
||
alias: Telegram Bot Stop LXC MariaDB
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /stop_mariadb
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_mariadb_101_stop
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_reboot_mariadb
|
||
alias: Telegram Bot Reboot LXC MariaDB
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /reboot_mariadb
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_mariadb_101_reboot
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_start_jackett
|
||
alias: Telegram Bot Start LXC Jackett
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /start_jackett
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_jackett_102_start
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_stop_jackett
|
||
alias: Telegram Bot Stop LXC Jackett
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /stop_jackett
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_jackett_102_stop
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_reboot_jackett
|
||
alias: Telegram Bot Reboot LXC Jackett
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /reboot_jackett
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_jackett_102_reboot
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_start_jellyfin
|
||
alias: Telegram Bot Start LXC Jellyfin
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /start_jellyfin
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_jellyfin_103_start
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_stop_jellyfin
|
||
alias: Telegram Bot Stop LXC Jellyfin
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /stop_jellyfin
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_jellyfin_103_stop
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_reboot_jellyfin
|
||
alias: Telegram Bot Reboot LXC Jellyfin
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /reboot_jellyfin
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_jellyfin_103_reboot
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_start_deluge
|
||
alias: Telegram Bot Start LXC Deluge
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /start_deluge
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_deluge_104_start
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_stop_deluge
|
||
alias: Telegram Bot Stop LXC Deluge
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /stop_deluge
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_deluge_104_stop
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_reboot_deluge
|
||
alias: Telegram Bot Reboot LXC Deluge
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /reboot_deluge
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_deluge_104_reboot
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_start_torrserver
|
||
alias: Telegram Bot Start LXC TorrServer
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /start_torrserver
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_debian_105_start
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_stop_torrserver
|
||
alias: Telegram Bot Stop LXC TorrServer
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /stop_torrserver
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_debian_105_stop
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_reboot_torrserver
|
||
alias: Telegram Bot Reboot LXC TorrServer
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /reboot_torrserver
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_debian_105_reboot
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_start_minimserver
|
||
alias: Telegram Bot Start LXC Minim Server
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /start_minimserver
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_minim_107_start
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_stop_minimserver
|
||
alias: Telegram Bot Stop LXC Minim Server
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /stop_minimserver
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_minim_107_stop
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: telegram_bot_reboot_minimserver
|
||
alias: Telegram Bot Reboot LXC Minim Server
|
||
initial_state: true
|
||
triggers:
|
||
- platform: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /reboot_minimserver
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
actions:
|
||
- service: button.press
|
||
target:
|
||
entity_id: button.lxc_minim_107_reboot
|
||
- delay:
|
||
seconds: 5
|
||
- service: script.send_pve_status
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
- id: 064cbd85-8d52-40ac-98bd-98164ad1434c
|
||
alias: 'HELPER: Сохранение/восстановление состояния стиральной машины при рестарте
|
||
HA'
|
||
mode: single
|
||
trigger:
|
||
- platform: homeassistant
|
||
event: shutdown
|
||
id: shutdown
|
||
- platform: homeassistant
|
||
event: start
|
||
id: start
|
||
action:
|
||
- choose:
|
||
- conditions:
|
||
- condition: trigger
|
||
id: shutdown
|
||
sequence:
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: binary_sensor.washing_machine_active
|
||
state: 'on'
|
||
sequence:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.washing_machine_pre_restart_state
|
||
default:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.washing_machine_pre_restart_state
|
||
- conditions:
|
||
- condition: trigger
|
||
id: start
|
||
sequence:
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.washing_machine_pre_restart_state
|
||
state: 'on'
|
||
sequence:
|
||
- service: system_log.write
|
||
data:
|
||
message: 'System start: стиральная машина была активна до перезагрузки.'
|
||
level: warning
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id:
|
||
- input_boolean.washing_machine_running
|
||
- input_boolean.washing_machine_pre_restart_state
|
||
- id: 04a14878-99d3-4030-a17d-bfa3c75b1f9b
|
||
alias: 'HELPER: Стиральная машина: Управление статусом (старт/окончание)'
|
||
description: Включает running при >5 Вт; выключает при <5 Вт (2 мин), если цикл
|
||
длился не меньше минимума.
|
||
mode: restart
|
||
trigger:
|
||
- platform: numeric_state
|
||
entity_id: sensor.bathroom_washing_machine_power
|
||
above: 5
|
||
id: start
|
||
- platform: numeric_state
|
||
entity_id: sensor.bathroom_washing_machine_power
|
||
below: 5
|
||
for:
|
||
minutes: 2
|
||
id: finish
|
||
condition:
|
||
- condition: template
|
||
value_template: '{{ states(''sensor.bathroom_washing_machine_power'') not in [''unknown'',
|
||
''unavailable''] }}
|
||
|
||
'
|
||
action:
|
||
- choose:
|
||
- conditions:
|
||
- condition: trigger
|
||
id: start
|
||
sequence:
|
||
- service: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.washing_machine_running
|
||
- service: input_datetime.set_datetime
|
||
target:
|
||
entity_id: input_datetime.washing_machine_started_at
|
||
data:
|
||
datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'
|
||
- service: system_log.write
|
||
data:
|
||
message: Стиральная машина запущена.
|
||
level: info
|
||
- conditions:
|
||
- condition: trigger
|
||
id: finish
|
||
- condition: state
|
||
entity_id: input_boolean.washing_machine_running
|
||
state: 'on'
|
||
- condition: template
|
||
value_template: '{% set started = as_timestamp(states(''input_datetime.washing_machine_started_at''))
|
||
%} {% set min_sec = (states(''input_number.wm_min_cycle_min'') | float(10)
|
||
* 60) | int %} {{ started is number and (now().timestamp() - started) >=
|
||
min_sec }}
|
||
|
||
'
|
||
sequence:
|
||
- service: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.washing_machine_running
|
||
- service: system_log.write
|
||
data:
|
||
message: Стиральная машина завершена.
|
||
level: info
|
||
default:
|
||
- choose:
|
||
- conditions:
|
||
- condition: trigger
|
||
id: finish
|
||
- condition: state
|
||
entity_id: input_boolean.washing_machine_running
|
||
state: 'on'
|
||
sequence:
|
||
- service: system_log.write
|
||
data:
|
||
message: Низкая мощность обнаружена, но цикл < минимального времени —
|
||
игнорируем окончание.
|
||
level: info
|
||
- id: d1e78a7d-56c3-4d4e-b2a4-8a23f1a62a45
|
||
alias: 'Уведомление: Стирка завершена (TTS + Telegram)'
|
||
description: При finished=on отправляет TTS и Telegram, если не startup/silent и
|
||
цикл длился достаточно.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.washing_machine_finished
|
||
to: 'on'
|
||
for:
|
||
minutes: 2
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.washing_machine_running
|
||
state: 'off'
|
||
- condition: template
|
||
value_template: '{% set started = as_timestamp(states(''input_datetime.washing_machine_started_at''))
|
||
%} {% set min_sec = (states(''input_number.wm_min_cycle_min'') | float(10) *
|
||
60) | int %} {{ started is number and (now().timestamp() - started) >= min_sec
|
||
}}
|
||
|
||
'
|
||
action:
|
||
- service: script.yandex_tts_washing_machine_finished
|
||
- service: notify.master
|
||
data:
|
||
message: 🏠 Стирка закончена! 🧼
|
||
- service: system_log.write
|
||
data:
|
||
message: Уведомление о завершении стирки отправлено.
|
||
level: info
|
||
- id: washing_machine_reminder_no_motion
|
||
alias: 'Уведомление: Напоминание о стирке при отсутствии движения'
|
||
description: Через 15 мин после finished=on, если нет движения и дверь закрыта —
|
||
напомнить через TTS.
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.washing_machine_finished
|
||
to: 'on'
|
||
for:
|
||
minutes: 15
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: binary_sensor.someone_is_home
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: binary_sensor.bathroom_motions
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: binary_sensor.bathroom_open_door
|
||
state: 'off'
|
||
action:
|
||
- service: script.yandex_tts_washing_machine_reminder
|
||
- service: system_log.write
|
||
data:
|
||
message: Напоминание о стирке отправлено.
|
||
level: info
|
||
- id: 2f26dfda-2840-424a-a840-8c4acda8eaf6
|
||
alias: 'Уведомление. Яндекс: Приветствие'
|
||
description: Отключение камеры, включение света в прихожей и доклад о климате
|
||
mode: single
|
||
trigger:
|
||
- platform: event
|
||
event_type: yandex_speaker
|
||
event_data:
|
||
value: С возвращением, дорогой мне человек! Я скучала без тебя!
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
action:
|
||
- service: light.turn_on
|
||
target:
|
||
entity_id: light.light_bathroom
|
||
- delay:
|
||
seconds: 4
|
||
- service: script.yandex_tts_ppm_status
|
||
- delay:
|
||
seconds: 6
|
||
- service: script.yandex_tts_temp_status
|
||
- delay:
|
||
seconds: 3
|
||
- service: script.yandex_tts_hum_status
|
||
- id: 661464a3-ab6d-438e-847b-f2b6ddfee59a
|
||
alias: 'Уведомление. Яндекс: Прощание'
|
||
description: Выключает весь свет, включает камеры и произносит прощальное сообщение
|
||
через Яндекс.
|
||
mode: single
|
||
trigger:
|
||
- platform: event
|
||
event_type: yandex_speaker
|
||
event_data:
|
||
value: Я буду скучать! Возвращайся быстрее
|
||
action:
|
||
- delay: 00:00:04
|
||
- service: script.yandex_tts_door_status
|
||
- service: light.turn_off
|
||
target:
|
||
entity_id: light.all_lights
|
||
- service: switch.turn_on
|
||
target:
|
||
entity_id: group.cameras
|
||
- choose:
|
||
- conditions:
|
||
- condition: state
|
||
entity_id: person.master
|
||
state: home
|
||
sequence:
|
||
- service: notify.master
|
||
data:
|
||
message: Свет в квартире выключен! Приятной дороги!
|
||
- id: a8c5eb07-9381-46d5-bc65-0f52dd7079a8
|
||
alias: 'Уведомление. Яндекс: Температура ниже установленного уровня'
|
||
mode: single
|
||
trigger:
|
||
- platform: state
|
||
entity_id: binary_sensor.temperature_below_20
|
||
to: 'on'
|
||
for:
|
||
minutes: 1
|
||
condition:
|
||
- condition: state
|
||
entity_id: input_boolean.system_startup_phase
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: input_boolean.silent_mode
|
||
state: 'off'
|
||
action:
|
||
- service: script.yandex_tts_door_status
|