5742 lines
185 KiB
YAML
5742 lines
185 KiB
YAML
- alias: Humidity in humidor too low
|
||
id: 4ccbd0aa-829a-45d3-abe7-33ae2552215b
|
||
triggers:
|
||
trigger: numeric_state
|
||
entity_id: sensor.atc_3d13_humidity
|
||
below: 65
|
||
for:
|
||
minutes: 30
|
||
actions:
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: Влажность в хьюмидоре ниже 65% (текущая {{ states("sensor.atc_3d13_humidity")
|
||
}}%)
|
||
- alias: Humidity in humidor too high
|
||
id: f6158c69-c088-4258-a623-6c2ee3c2cf72
|
||
triggers:
|
||
trigger: numeric_state
|
||
entity_id: sensor.atc_3d13_humidity
|
||
above: 80
|
||
for:
|
||
minutes: 30
|
||
actions:
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: Влажность в хьюмидоре выше 80% (текущая {{ states("sensor.atc_3d13_humidity")
|
||
}}%)
|
||
- alias: Temperature in humidor too low
|
||
id: 0d95f393-ab18-4aef-8eb9-9bf5165d6638
|
||
triggers:
|
||
trigger: numeric_state
|
||
entity_id: sensor.atc_3d13_temperature
|
||
below: 20
|
||
for:
|
||
minutes: 30
|
||
actions:
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: Температура в хьюмидоре ниже 20°C (текущая {{ states("sensor.atc_3d13_temperature")
|
||
}}°C)
|
||
- alias: Temperature in humidor too high
|
||
id: dcfce935-f705-4ae5-be45-ffb780b3f290
|
||
triggers:
|
||
trigger: numeric_state
|
||
entity_id: sensor.atc_3d13_temperature
|
||
above: 25
|
||
for:
|
||
minutes: 30
|
||
actions:
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: Температура в хьюмидоре выше 25°C (текущая {{ states("sensor.atc_3d13_temperature")
|
||
}}°C)
|
||
- alias: PowerOff all media when nobody at home
|
||
id: 0e2312c7-3cab-413a-aefb-20ff5802c718
|
||
triggers:
|
||
trigger: state
|
||
entity_id: group.family_persons
|
||
to: not_home
|
||
for:
|
||
minutes: 5
|
||
conditions:
|
||
- or:
|
||
- condition: state
|
||
entity_id: group.all_tv
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: group.all_chromecasts
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id:
|
||
- media_player.yandex_station_lite_detskaia
|
||
- media_player.yandex_station_mini2_gostinaia
|
||
- media_player.yandex_station_mini2_spalnia
|
||
- media_player.yandex_station_lite_prikhozhaya
|
||
state: playing
|
||
- condition: state
|
||
entity_id: group.all_xbox
|
||
state: 'on'
|
||
actions:
|
||
- action: homeassistant.turn_off
|
||
target:
|
||
entity_id: group.all_tv
|
||
- action: media_player.media_stop
|
||
target:
|
||
entity_id:
|
||
- group.all_chromecasts
|
||
- action: media_player.turn_off
|
||
target:
|
||
entity_id:
|
||
- group.all_yandex_stations
|
||
- group.all_xbox
|
||
- alias: Home Presence Alert
|
||
id: 12b0184c-bb8b-436a-887a-733d0ddac126
|
||
mode: parallel
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- person.alexander
|
||
- person.irina
|
||
- person.tatiana
|
||
- person.olga
|
||
- person.egor
|
||
- person.kirill
|
||
conditions:
|
||
- and:
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state = trigger.from_state.state }}'
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: '{{ trigger.to_state.attributes.friendly_name }} {% if trigger.to_state.state
|
||
== ''home'' %}дома {% elif trigger.to_state.state == ''Дача'' %}на даче {%
|
||
else %}скорее всего вне дома. {% endif %}
|
||
|
||
'
|
||
- alias: Entrance Door - Opened
|
||
id: 067c832a-9626-4f61-8d19-444d6156e889
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.0x158d00031c790f_contact
|
||
from: 'off'
|
||
to: 'on'
|
||
actions:
|
||
action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Открыта входная дверь
|
||
- alias: Entrance Door - Closed
|
||
id: c6df423a-a1ec-41fb-b600-3874ffef758b
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.0x158d00031c790f_contact
|
||
from: 'on'
|
||
to: 'off'
|
||
actions:
|
||
action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Входная дверь закрыта.
|
||
- alias: Torrent Completed [notify to group system]
|
||
id: fe45c917-f489-4c38-a3a1-c66e5fedb07f
|
||
triggers:
|
||
trigger: event
|
||
event_type: transmission_downloaded_torrent
|
||
actions:
|
||
action: notify.telegram_group_system
|
||
data:
|
||
message: Загрузка torrent-файла завершена
|
||
- alias: Полнолуние [notify to group system]
|
||
id: d698bdcc-4ce9-4954-a118-8a1f29cf327e
|
||
triggers:
|
||
trigger: state
|
||
entity_id: sensor.moon
|
||
to: full_moon
|
||
actions:
|
||
action: notify.telegram_group_system
|
||
data:
|
||
message: Сегодня полнолуние
|
||
- alias: Gas Alert
|
||
id: 0ca74008-65a2-4ed1-b860-e27e57b216f2
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.0x00158d000413b210_gas
|
||
from: 'off'
|
||
to: 'on'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: 'Сработал датчик *газа* на кухне.
|
||
|
||
Откройте окна и перекройте подачу газа (за холодильником).
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Отключить датчик:/poweroff_gas_sensor
|
||
- alias: Gas Alert - Telegram control - poweroff_gas_sensor
|
||
id: 3254a184-a04f-4b31-bbe9-1a00e403f134
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /poweroff_gas_sensor
|
||
actions:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.blitzwolf_shp13_02_3ad702fe_on_off
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
title: '*Внимание*'
|
||
message: 'Сработал датчик *газа* на кухне.
|
||
|
||
Датчик *газа* отключен
|
||
|
||
'
|
||
- alias: Gas Alert - Sensor Powered Off More Than 30 Min
|
||
id: 3e69fa5f-34f2-4e5e-86e2-467aad2420b6
|
||
triggers:
|
||
trigger: state
|
||
entity_id: switch.blitzwolf_shp13_02_3ad702fe_on_off
|
||
to: 'off'
|
||
for: 00:30:00
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: 'Питание датчика *газа* отключено более 30 минут
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Включить датчик:/poweron_gas_sensor
|
||
- alias: Gas Alert - Telegram control - poweroff_gas_sensor
|
||
id: 50892fe7-741c-4b4d-a71c-a498be52d6b7
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /poweron_gas_sensor
|
||
actions:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.blitzwolf_shp13_02_3ad702fe_on_off
|
||
- action: telegram_bot.answer_callback_query
|
||
data_template:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
title: '*Внимание*'
|
||
message: 'Питание датчика *газа* отключено более 30 минут
|
||
|
||
Датчик *газа* включен
|
||
|
||
'
|
||
- alias: Boiler - Low Temperature Alert
|
||
id: fe98880b-2fcd-4b6f-9ded-adc174b9b958
|
||
triggers:
|
||
- trigger: numeric_state
|
||
entity_id: sensor.boiler_water_temp
|
||
below: 50
|
||
- trigger: numeric_state
|
||
entity_id: sensor.boiler_water_temp
|
||
below: 40
|
||
- trigger: numeric_state
|
||
entity_id: sensor.boiler_water_temp
|
||
below: 30
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ (trigger.to_state.state | int) = 0 }}'
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
title: '*Внимание*'
|
||
message: 'Температура воды в бойлере *{{ trigger.to_state.state }}*°C
|
||
|
||
'
|
||
- alias: Kettle - Boil Finished Notification
|
||
id: c5eaa742-7ea5-4c0b-8d43-d3ce69232a3e
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.kettle_status
|
||
from: 'on'
|
||
to: 'off'
|
||
conditions: '{{ states(''input_boolean.ha_shutdown'') == ''off'' }}'
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Чайник *вскипел*
|
||
- alias: Washing Machine - Wash Finished Notification
|
||
id: eed153ad-dca8-464d-8cc5-b30421eec1a1
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.washer_status
|
||
from: 'on'
|
||
to: 'off'
|
||
conditions: '{{ states(''input_boolean.ha_shutdown'') == ''off'' }}'
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
title: 'Стиральная машина:'
|
||
message: Стирка *закончена*, не забудьте достать белье.
|
||
- alias: Dryer Machine - Drying Finished Notification
|
||
id: e572fd6c-06d2-4c34-a218-4b709734c6e0
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.dryer_status
|
||
from: 'on'
|
||
to: 'off'
|
||
conditions: '{{ states(''input_boolean.ha_shutdown'') == ''off'' }}'
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
title: 'Сушильная машина:'
|
||
message: Сушка *закончена*, не забудьте достать белье.
|
||
- alias: Dishwasher - Dishwashing Finished Notification
|
||
id: 9ef4d500-e688-4b70-b565-43ebb754bfe2
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.dishwasher_status
|
||
from: 'on'
|
||
to: 'off'
|
||
conditions: '{{ states(''input_boolean.ha_shutdown'') == ''off'' }}'
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
title: 'Посудомоечная машина:'
|
||
message: Программа *закончена*, посуда вымыта.
|
||
- alias: Yandex Station SW Updated
|
||
id: 3f22e8f0-6f31-49c1-bca1-ce19184c5184
|
||
mode: queued
|
||
max: 10
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- sensor.yandex_station_lite_detskaia_sw_version
|
||
- sensor.yandex_station_lite_prikhozhaya_sw_version
|
||
- sensor.yandex_station_mini2_gostinaia_sw_version
|
||
- sensor.yandex_station_mini2_spalnia_sw_version
|
||
conditions:
|
||
- '{{ trigger.to_state.state = trigger.from_state.state }}'
|
||
- '{% set ignore = [''unknown'', ''unavailable'', ''none'', None, null, '''', ''null'']
|
||
%} {{ trigger.to_state.state not in ignore and trigger.from_state.state not in
|
||
ignore }}
|
||
|
||
'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
message: '_Yandex Station:_ Изменилась версия прошивки в
|
||
|
||
{%- if ''detskaia'' in trigger.entity_id %} *Детской*.
|
||
|
||
{%- elif ''gostinaia'' in trigger.entity_id %} *Гостиной*.
|
||
|
||
{%- elif ''spalnia'' in trigger.entity_id %} *Спальне*.
|
||
|
||
{%- elif ''prikhozhaya'' in trigger.entity_id %} *Прихожей*.
|
||
|
||
{%- endif %}
|
||
|
||
Было: {{ trigger.from_state.state }}
|
||
|
||
Стало: {{ trigger.to_state.state }}
|
||
|
||
'
|
||
- alias: 'HA: Mount NFS Share from NAS01 [/nmt/nas]'
|
||
id: eb3ef8ea-e19a-4b1e-b7ff-482089a346b5
|
||
triggers:
|
||
- trigger: homeassistant
|
||
event: start
|
||
actions:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.mount_mnt_nas
|
||
- alias: 'HA: Create Daily Backup'
|
||
id: acac055e-ea1e-41cd-9f46-62e7a8c006aa
|
||
initial_state: true
|
||
triggers:
|
||
- trigger: time
|
||
at: 01:00:00
|
||
actions:
|
||
- action: auto_backup.backup_full
|
||
data:
|
||
name: Daily Backup {{ now().strftime('%Y-%m-%d') }}
|
||
keep_days: 7
|
||
- alias: 'HASS: ERRORs in System Log - Counter'
|
||
id: 3b8230a5-49d5-437b-8bd9-d3f72f95425f
|
||
triggers:
|
||
trigger: event
|
||
event_type: system_log_event
|
||
event_data:
|
||
level: ERROR
|
||
mode: parallel
|
||
max: 50
|
||
actions:
|
||
- action: counter.increment
|
||
target:
|
||
entity_id: counter.syslog_errors
|
||
- alias: 'HASS: WARNINGs in System Log - Counter'
|
||
id: acdf3489-b611-445c-bd24-2efc9c431124
|
||
triggers:
|
||
trigger: event
|
||
event_type: system_log_event
|
||
event_data:
|
||
level: WARNING
|
||
mode: parallel
|
||
max: 50
|
||
actions:
|
||
- action: counter.increment
|
||
target:
|
||
entity_id: counter.syslog_warnings
|
||
- alias: 'HASS: Create Group of Battery Devices'
|
||
id: 823d8378-6723-4e71-93ce-29c59946347a
|
||
triggers:
|
||
- trigger: homeassistant
|
||
event: start
|
||
- trigger: time_pattern
|
||
hours: /2
|
||
actions:
|
||
- action: group.set
|
||
data:
|
||
object_id: battery_devices
|
||
entities: "{%- \n for state in states.sensor \n if is_state_attr(state.entity_id,\
|
||
\ 'device_class', 'battery') and\n (state.entity_id.endswith(\"_battery\"\
|
||
) or state.entity_id.endswith(\"_power\"))\n%} {{ state.entity_id }}{%- if\
|
||
\ not loop.last -%}, {%- endif -%} {%- endfor %}"
|
||
- alias: Fix for reload automations
|
||
id: 4c7a9752-b7d2-4c41-acf6-7d175f6b9d39
|
||
triggers:
|
||
- trigger: event
|
||
event_type: call_service
|
||
event_data:
|
||
domain: automation
|
||
service: reload
|
||
- trigger: event
|
||
event_type: automation_reloaded
|
||
actions:
|
||
- action: "{% if trigger.event.event_type == 'call_service' -%}\n automation.turn_off\n\
|
||
{% else -%}\n automation.turn_on\n{% endif -%}"
|
||
target:
|
||
entity_id: automation.device_needs_attention_notify_to_group_system
|
||
- alias: Update HA DB SQL sensors
|
||
id: e41348f5-2915-4a51-8d88-e5f00e7c0b67
|
||
triggers:
|
||
- trigger: time_pattern
|
||
hours: /1
|
||
minutes: '22'
|
||
actions:
|
||
- action: homeassistant.update_entity
|
||
target:
|
||
entity_id:
|
||
- sensor.hass_db_events_rows_count
|
||
- sensor.hass_db_states_rows_count
|
||
- sensor.hass_db_statistics_rows_count
|
||
- sensor.hass_db_total_rows_count
|
||
- sensor.hass_db_size
|
||
- alias: Update MES sensors
|
||
id: 7f460de3-11dc-4e23-886c-a14b7db8bfeb
|
||
triggers:
|
||
- trigger: time_pattern
|
||
minutes: '33'
|
||
conditions:
|
||
- condition: time
|
||
after: 07:00:00
|
||
before: '22:50:00'
|
||
actions:
|
||
- action: homeassistant.update_entity
|
||
target:
|
||
entity_id:
|
||
- sensor.mes_55384_014_37_meter_44259893
|
||
- alias: Update Ping sensors for TV
|
||
id: a164b9f1-bd13-465e-a76b-7831cdfc63d9
|
||
triggers:
|
||
- trigger: time_pattern
|
||
seconds: '10'
|
||
actions:
|
||
- action: homeassistant.update_entity
|
||
target:
|
||
entity_id: binary_sensor.samsungtv_40c5100
|
||
- alias: Restart Stuck Add-on Z2M-2
|
||
id: 0617529b-bc60-48c0-8954-6936aa95ef50
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.z2m_2_stuck
|
||
from: 'off'
|
||
to: 'on'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: sensor.addons_mostuitto_state
|
||
state: started
|
||
actions:
|
||
- parallel:
|
||
- action: hassio.addon_restart
|
||
data:
|
||
addon: 4b41db2d_zigbee2mqtt
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
title: <b>Внимание</b>
|
||
message: <b>Z2M-2</b> похоже завис, перезапускаем...
|
||
- alias: 'HASS: Login Failed [notify to group system]'
|
||
id: 142e502b-3e63-49e3-b790-9150f155dc6d
|
||
mode: queued
|
||
max: 5
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: persistent_notification.http_login
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state = off }}'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
disable_web_page_preview: true
|
||
message: '*Внимание*
|
||
|
||
Неудачная попытка входа, ошибка авторизации
|
||
|
||
Источник: {{ state_attr(''persistent_notification.http_login'',''message'')
|
||
| regex_findall_index(''from (.*)\. '') }}
|
||
|
||
_http://whatismyipaddress.com/ip/{{ state_attr(''persistent_notification.http_login'',''message'')
|
||
| regex_findall_index(''\((.*)\)'') }}_
|
||
|
||
'
|
||
- action: persistent_notification.dismiss
|
||
data:
|
||
notification_id: http_login
|
||
- alias: 'HASS: IP Banned [notify to group system]'
|
||
id: ba2318c5-5c2e-4575-aa13-02f53063793d
|
||
mode: queued
|
||
max: 5
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: persistent_notification.ip_ban
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
disable_web_page_preview: true
|
||
message: '*Внимание*
|
||
|
||
Заблокирован IP: {{ state_attr(''persistent_notification.ip_ban'', ''message'').split(''Too
|
||
many login attempts from '')[1] }}
|
||
|
||
_http://whatismyipaddress.com/ip/{{ state_attr(''persistent_notification.ip_ban'',
|
||
''message'').split(''Too many login attempts from '')[1] }}_
|
||
|
||
'
|
||
- action: persistent_notification.dismiss
|
||
data:
|
||
notification_id: ip_ban
|
||
- alias: 'HASS: Home Assistant Start'
|
||
id: 60f94d65-93d1-49e5-94d7-ca58471d02c4
|
||
triggers:
|
||
- trigger: homeassistant
|
||
event: start
|
||
actions:
|
||
- action: homeassistant.update_entity
|
||
target:
|
||
entity_id: sensor.errors_in_system_log_command_line
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: sensor.errors_in_system_log_command_line
|
||
timeout: 00:00:01
|
||
- action: homeassistant.update_entity
|
||
target:
|
||
entity_id: sensor.warnings_in_system_log_command_line
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: sensor.warnings_in_system_log_command_line
|
||
timeout: 00:00:01
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: '_INFO:_ Home Assistant *запущен* за {{ states(''sensor.start_time'')
|
||
}} сек.
|
||
|
||
Ошибок: *{{ states(''sensor.errors_in_system_log_command_line'') }}*, Предупреждений:
|
||
*{{ states(''sensor.warnings_in_system_log_command_line'') }}*
|
||
|
||
'
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.hass_errors_counter_set_at_startup
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.hass_warnings_counter_set_at_startup
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.auto_reboot_by_errors_after_boot
|
||
- alias: 'HASS: Home Assistant Shutdown'
|
||
id: 44bdbc77-2894-4c80-9739-6c690bde13f9
|
||
triggers:
|
||
trigger: homeassistant
|
||
event: shutdown
|
||
actions:
|
||
- action: input_boolean.turn_on
|
||
data:
|
||
entity_id: input_boolean.ha_shutdown
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: _INFO:_ Home Assistant *остановлен*.
|
||
- alias: 'HASS: ERRORs in System Log [notify to group system]'
|
||
id: e4140626-d5b1-4a6c-abe1-f99ae0547f0b
|
||
initial_state: false
|
||
triggers:
|
||
trigger: event
|
||
event_type: system_log_event
|
||
event_data:
|
||
level: ERROR
|
||
actions:
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: _{{ trigger.event.data.level }}:_ {{ trigger.event.data.message }}
|
||
- alias: 'HASS: WARNINGs in System Log [notify to group system]'
|
||
id: 42541570-874a-46a9-86d0-0db433aaec5b
|
||
initial_state: false
|
||
triggers:
|
||
trigger: event
|
||
event_type: system_log_event
|
||
event_data:
|
||
level: WARNING
|
||
actions:
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: _{{ trigger.event.data.level }}:_ {{ trigger.event.data.message }}
|
||
- alias: 'HASS: System Config Errors [notify to group system]'
|
||
id: 3770bcbf-435a-43b2-bfde-b04711e32b61
|
||
triggers:
|
||
- trigger: event
|
||
event_type: call_service
|
||
event_data:
|
||
domain: persistent_notification
|
||
service: create
|
||
conditions:
|
||
- or:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.service_data.notification_id == ''homeassistant.check_config''
|
||
}}'
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.service_data.notification_id == ''invalid_config''
|
||
}}'
|
||
actions:
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: '*Внимание, конфигурация содержит ошибки*
|
||
|
||
{% if trigger.event.data.service_data.notification_id == ''homeassistant.check_config''
|
||
-%}
|
||
|
||
Перезапуск HA отменён, подробности в логах.
|
||
|
||
{% elif trigger.event.data.service_data.notification_id == ''invalid_config''
|
||
-%}
|
||
|
||
{{ trigger.event.data.service_data.message }}
|
||
|
||
{% endif %}
|
||
|
||
'
|
||
- action: persistent_notification.dismiss
|
||
data:
|
||
notification_id: '{{ trigger.event.data.service_data.notification_id }}'
|
||
- alias: 'HASS: ERRORs in Automations [notify to group system]'
|
||
id: 67d49afb-cac6-45e2-99b0-0ad5904d84b2
|
||
mode: queued
|
||
triggers:
|
||
- trigger: event
|
||
event_type: system_log_event
|
||
event_data:
|
||
level: ERROR
|
||
conditions:
|
||
- condition: template
|
||
value_template: "{{ \n trigger.event.data.message | regex_search('Error while\
|
||
\ executing automation') or\n trigger.event.data.message | regex_search('Error\
|
||
\ executing script')\n}}"
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
message: "<i>INFO:</i> Ошибка выполнения автоматизации: \n{{ trigger.event.data.message\
|
||
\ }}.\n"
|
||
- alias: 'HASS: Critical Error [notify to group system]'
|
||
id: d70721b8-e0f2-415a-b917-331781a463ee
|
||
mode: queued
|
||
triggers:
|
||
- trigger: event
|
||
event_type: system_log_event
|
||
event_data:
|
||
level: FATAL
|
||
- trigger: event
|
||
event_type: system_log_event
|
||
event_data:
|
||
level: CRITICAL
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
message: 'Критическая ошибка системы:
|
||
|
||
{{ trigger.event.data.message }}
|
||
|
||
'
|
||
- alias: 'HA: Update Entities Notifications'
|
||
id: d69b4310-532c-4cda-9a77-3434e6319fef
|
||
mode: queued
|
||
max: 50
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: event
|
||
event_type: state_changed
|
||
conditions:
|
||
- '{{ trigger.event.data.entity_id.startswith(''update.'') }}'
|
||
- '{{ trigger.event.data.old_state is not none and trigger.event.data.new_state
|
||
is not none }}'
|
||
- or:
|
||
- condition: template
|
||
value_template: "{% set ignore = ['unknown', 'unavailable', 'none', None, null,\
|
||
\ ''] %}\n {{ \n trigger.event.data.new_state.state == 'on' and\n (version(trigger.event.data.new_state.attributes.latest_version)\
|
||
\ = version(trigger.event.data.old_state.attributes.latest_version) or\n \
|
||
\ version(trigger.event.data.new_state.attributes.latest_version) > version(trigger.event.data.old_state.attributes.latest_version))\
|
||
\ and\n trigger.event.data.new_state.attributes.latest_version not in ignore\
|
||
\ and\n trigger.event.data.new_state.attributes.latest_version is not none\n\
|
||
\ }}\n"
|
||
- condition: template
|
||
value_template: "{% set ignore = ['unknown', 'unavailable', 'none', None, null,\
|
||
\ ''] %}\n {{ \n trigger.event.data.old_state.state == 'on' and trigger.event.data.new_state.state\
|
||
\ == 'off' and\n (version(trigger.event.data.new_state.attributes.installed_version)\
|
||
\ = version(trigger.event.data.old_state.attributes.installed_version) or\n\
|
||
\ version(trigger.event.data.new_state.attributes.installed_version) >\
|
||
\ version(trigger.event.data.old_state.attributes.installed_version)) and\n\
|
||
\ trigger.event.data.new_state.attributes.installed_version not in ignore\
|
||
\ and\n trigger.event.data.new_state.attributes.installed_version is not\
|
||
\ none\n }}\n"
|
||
actions:
|
||
- variables:
|
||
latest_version: '{{ trigger.event.data.new_state.attributes.latest_version }}'
|
||
installed_version: '{{ state_attr(trigger.event.data.entity_id, ''installed_version'')
|
||
}}'
|
||
old_installed_version: '{{ trigger.event.data.old_state.attributes.installed_version
|
||
}}'
|
||
friendlyname: '{{- trigger.event.data.new_state.name | regex_replace(''( Update$|
|
||
Firmware$| Обновление прошивки$)'', '''', True) -}}'
|
||
- if:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.new_state.attributes.installed_version
|
||
= trigger.event.data.old_state.attributes.installed_version }}'
|
||
then:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
message: '<i>INFO:</i> <b>{{ friendlyname }}</b> - обновлен (<i>{{ old_installed_version
|
||
}}</i> -> <i>{{ latest_version }}</i>).
|
||
|
||
'
|
||
else:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
message: '<i>INFO:</i> <b>{{ friendlyname }}</b> - доступно обновление (<i>{{
|
||
installed_version }}</i> -> <i>{{ latest_version }}</i>).
|
||
|
||
'
|
||
- alias: Device Needs Attention [notify to group system]
|
||
id: 89bb378c-13b5-4051-bd08-3f226dbc8834
|
||
mode: queued
|
||
max: 30
|
||
triggers:
|
||
- trigger: event
|
||
event_type: state_changed
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ states(''input_boolean.ha_shutdown'') == ''off'' }}'
|
||
- condition: template
|
||
value_template: '{{ states(''sensor.ha_uptime'') > ''1'' }}'
|
||
- condition: template
|
||
value_template: "{{ not trigger.event.data.entity_id | regex_search\n (\n '^group.battery_devices$|'\n\
|
||
\ '^binary_sensor.lamp_status_|'\n '^sensor.lamp_status_|'\n '^sensor.mirobot_1s_|'\n\
|
||
\ '^sensor.xiaomi_vacuum_cleaner_|'\n '^switch.smartir_|'\n '^sensor.openweathermap_|'\n\
|
||
\ '.*\\.smartmi_humidifier_\\d{2}_\\w+|'\n '^sensor\\.tplink_smartplug_01_|'\n\
|
||
\ '^sensor\\.gosund_sp111_\\d{2}_|'\n '^(switch|button)\\.gosund_sp111_\\\
|
||
d{2}_restart|'\n '^sensor\\..*_ble|'\n '^(binary_sensor|switch)\\.domofon_|'\n\
|
||
\ '^(binary_sensor|sensor|light)\\.sonoff_basic_|'\n '^(binary_sensor|sensor)\\\
|
||
.sonoff_mini_r2_|'\n '^(switch|button)\\.(esp32_miscale2|esp32_bt_proxy)_\\\
|
||
d{2}_restart.*|'\n '^sensor\\.xiaomi_mi_scale_2_.*|'\n '^number\\..*_(min|max)_weight|'\n\
|
||
\ '^button\\..*_identify|'\n '^sensor\\..*_(weight_current|current_weight)|'\n\
|
||
\ '^sensor\\..*_(impedance_current|current_impedance)|'\n '^media_player\\\
|
||
.plex_.*|'\n '^(binary_sensor|sensor|switch|button)\\.reolinkcam_(01|02)_.*|'\n\
|
||
\ '.*ed5e33eb_0ca3_4263_a681_a68b1045a5e6.*|'\n '^sensor\\.oneplus_8t_ibeacon_.*|'\n\
|
||
\ '^binary_sensor\\..*_oneplus_8t_presence$|'\n '^binary_sensor\\..*_holy_iot_.*_presence$|'\n\
|
||
\ '^binary_sensor\\..*_nut_gray_1_presence$|'\n '^binary_sensor\\..*_amazfit_gtr_4_presence$|'\n\
|
||
\ '^.*\\.nas01_.*|'\n '^vacuum\\.xiaomi_vacuum_cleaner$|'\n '^sensor\\.esp32_bt_proxy_\\\
|
||
d{2}_rssi$|'\n '^sensor\\..*_estimated_distance$|'\n '^(sensor|number|switch|button|binary_sensor)\\\
|
||
.galaxy_tab_a_8_0_2019_.*$|'\n '^camera\\.reolinkcam_01_rtsp.*$|'\n '^(sensor|binary_sensor|button|switch)\\\
|
||
.shellyem_.*|'\n '^sensor\\.ch_main_energy_.*|'\n '^sensor\\..*_geocoded_location$|'\n\
|
||
\ '^sensor\\.double_take_.*|'\n '^sensor\\.processor_use$|'\n '^binary_sensor\\\
|
||
.avb0r$|'\n '^sensor\\.dacha_nearest_.*|'\n '^sensor\\.dacha_.*_di.*|'\n \
|
||
\ '^(media_player|remote)\\.xbox_ch_01|'\n '^(media_player|remote)\\.xbox_v_gostinoi|'\n\
|
||
\ '^sensor\\..*_sonoff_pow_r3_0._power_factor$|'\n 'sensor\\.ch_lte_modem_.*|'\n\
|
||
\ 'sensor\\.ch_(water|septic)_pump_run_time_.*|'\n '.*\\.rch_.*'\n )\n}}"
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.new_state.state = trigger.event.data.old_state.state
|
||
}}'
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.new_state.state in [''unknown'', ''unavailable'']
|
||
}}'
|
||
actions:
|
||
- condition: template
|
||
value_template: '{{ states(''input_boolean.ha_shutdown'') == ''off'' }}'
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
disable_notification: true
|
||
message: '<i>INFO</i>: Объект {{ trigger.event.data.entity_id }} сменил статус
|
||
на {{ trigger.event.data.new_state.state }}.
|
||
|
||
'
|
||
- alias: Low Battery Alert [notify to group system]
|
||
id: 6d87e0a2-8a6b-4b20-bd28-900af1620584
|
||
mode: queued
|
||
max: 30
|
||
triggers:
|
||
- trigger: event
|
||
event_type: state_changed
|
||
conditions:
|
||
- condition: template
|
||
value_template: "{{ not trigger.event.data.entity_id | regex_search\n (\n '^sensor\\\
|
||
.galaxy_tab_a_8_0_2019_battery'\n )\n}}"
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.entity_id in (expand(''group.battery_devices'')
|
||
| map(attribute=''entity_id'')) }}'
|
||
- condition: template
|
||
value_template: '{{ not trigger.event.data.new_state.state in [''unknown'', ''unavailable'']
|
||
}}'
|
||
- condition: template
|
||
value_template: '{{ (trigger.event.data.new_state.state | int) < (states(''input_number.low_battery_alert_threshold'')
|
||
| int) }}'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
title: <b>Внимание, низкий заряд батареи</b>
|
||
message: '{{ trigger.event.data.new_state.attributes.friendly_name }}: {{ trigger.event.data.new_state.state
|
||
}} %
|
||
|
||
'
|
||
- alias: New Network Device Notification
|
||
id: 7e5b4f9a-eb87-487f-8e1a-4b980de13734
|
||
mode: parallel
|
||
triggers:
|
||
trigger: event
|
||
event_type: device_tracker_new_device
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
title: <b>Найдено новое устройство в сети</b>
|
||
message: 'MAC: {{ trigger.event.data.mac }}
|
||
|
||
'
|
||
- alias: Auto Backup Completed [notify to group system]
|
||
id: fef0c4de-e2ba-419b-b49e-ff39449e6481
|
||
triggers:
|
||
trigger: event
|
||
event_type: auto_backup.backup_successful
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
message: '<i>INFO:</i> Создание резервной копии завершилось успешно.
|
||
|
||
Имя: {{ trigger.event.data.name }}
|
||
|
||
'
|
||
- alias: Auto Backup Failure [notify to group system]
|
||
id: 24f2bb2c-3e2c-47b5-ba9a-a92f0f5bf63a
|
||
triggers:
|
||
trigger: event
|
||
event_type: auto_backup.backup_failed
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
title: <b>Внимание</b>
|
||
message: 'Создание резервной копии завершилось ошибкой.
|
||
|
||
Имя: {{ trigger.event.data.name }}
|
||
|
||
Ошибка: {{ trigger.event.data.error }}
|
||
|
||
'
|
||
- alias: Telegram Bot - Mirror text
|
||
id: d35faec4-c949-4358-8aff-00e11b560444
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_text
|
||
actions:
|
||
action: notify.telegram_group_system
|
||
data:
|
||
message: '*{{ trigger.event.data.from_first }} {{ trigger.event.data.from_last
|
||
}} [{{ trigger.event.data.user_id }}] пишет:*
|
||
|
||
{{ trigger.event.data.text }}
|
||
|
||
'
|
||
- alias: Telegram Bot - Start
|
||
id: d50c7e2c-9f67-40f2-9495-41ba1140c9b5
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /start
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /start@HAutoBot
|
||
actions:
|
||
action: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.user_id }}'
|
||
message: Привет! Помощь - /help
|
||
- alias: Telegram Bot - Help
|
||
id: 1e265eea-3d26-4a04-8402-f25a828f841d
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /help
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /help@HAutoBot
|
||
actions:
|
||
action: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.user_id }}'
|
||
parse_mode: html
|
||
message: 'Доступные комманды:
|
||
|
||
/status - Текущий статус устройств
|
||
|
||
/whoishome - Кто дома?
|
||
|
||
/weather - Погода дома
|
||
|
||
/weather_ch - Погода на даче
|
||
|
||
/ping - Проверить доступность сервиса HASS
|
||
|
||
'
|
||
- alias: Telegram Bot - Ping
|
||
id: 936c648b-18b6-4636-a941-cc3f3361fdd0
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /ping
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /ping@HAutoBot
|
||
actions:
|
||
action: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.user_id }}'
|
||
message: 'Pong! _{{ now().strftime("%d.%m.%Y %H:%M:%S") }}_
|
||
|
||
Current version: {{ states(''sensor.current_version'') }}
|
||
|
||
DB Size: {{ states(''sensor.hass_db_size'') }} {{ state_attr(''sensor.hass_db_size'',''unit_of_measurement'')
|
||
}}
|
||
|
||
Uptime: {{ states(''sensor.ha_uptime'') }} min.
|
||
|
||
'
|
||
- alias: Telegram Bot - Who is home?
|
||
id: f3af5ecc-3eb8-4542-8207-97f90b6f5abf
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /whoishome
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /whoishome@HAutoBot
|
||
actions:
|
||
action: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message: 'Сейчас дома:
|
||
|
||
{%- set entites = expand(''group.family_persons'') %}{% for prs in entites
|
||
%}{% if prs.state == "home" %}
|
||
|
||
{{ prs.attributes.friendly_name }}{% endif %}{% endfor %}
|
||
|
||
{% if is_state("group.family_persons", "not_home") %}Никого нет{% endif %}
|
||
|
||
'
|
||
- alias: Telegram Bot - Weather
|
||
id: b0b0a539-14fb-440c-b57c-269460961819
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /weather
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /weather@HAutoBot
|
||
actions:
|
||
- action: telegram_bot.send_photo
|
||
data:
|
||
target: '{{ trigger.event.data.user_id }}'
|
||
file: /config/www/weather_icons/{{ states("weather.danilovskii") }}.webp
|
||
caption: 'Температура {{ states(''sensor.danilovskii_temperature'') }}°C
|
||
|
||
Ощущается как {{ states(''sensor.danilovskii_feels_like_temperature'') }}°C
|
||
|
||
Влажность {{ states(''sensor.danilovskii_humidity'') }}%
|
||
|
||
Давление {{ states(''sensor.danilovskii_pressure'') }} hPa ({{ states(''sensor.openweathermap_moskva_danilovskii_pressure_mmhg'')
|
||
}} mmHg)
|
||
|
||
'
|
||
- alias: Telegram Bot - Weather Country House
|
||
id: c5ac3f4b-80b8-479f-96bf-45274aeba2ec
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /weather_ch
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /weather_ch@HAutoBot
|
||
actions:
|
||
- action: telegram_bot.send_photo
|
||
data:
|
||
target: '{{ trigger.event.data.user_id }}'
|
||
file: /config/www/weather_icons/{{ states("weather.nivki_2") }}.webp
|
||
caption: 'Температура {{ states(''sensor.nivki_2_temperature'') }}°C
|
||
|
||
Ощущается как {{ states(''sensor.nivki_2_feels_like_temperature'') }}°C
|
||
|
||
Влажность {{ states(''sensor.nivki_2_humidity'') }}%
|
||
|
||
Давление {{ states(''sensor.nivki_2_pressure'') }} hPa ({{ states(''sensor.openweathermap_stupino_nivki_2_pressure_mmhg'')
|
||
}} mmHg)
|
||
|
||
'
|
||
- alias: Telegram Bot - Status
|
||
id: 51572bf5-4960-4034-b09a-17d202c07c18
|
||
triggers:
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /status
|
||
- trigger: event
|
||
event_type: telegram_command
|
||
event_data:
|
||
command: /status@HAutoBot
|
||
actions:
|
||
action: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.user_id }}'
|
||
message: '*Климат*
|
||
|
||
Гостинная: *{{ states(''sensor.temperature_in_livingroom'') }}°C*, {{ states(''sensor.humidity_in_livingroom'')
|
||
}}%
|
||
|
||
Детская: *{{ states(''sensor.temperature_in_nursery'') }}°C*, {{ states(''sensor.humidity_in_nursery'')
|
||
}}%
|
||
|
||
Спальня: *{{ states(''sensor.temperature_in_bedroom'') }}°C*, {{ states(''sensor.humidity_in_bedroom'')
|
||
}}%
|
||
|
||
Ванная: *{{ states(''sensor.temperature_in_bathroom'') }}°C*, {{ states(''sensor.humidity_in_bathroom'')
|
||
}}%
|
||
|
||
Туалет: *{{ states(''sensor.temperature_in_toilet'') }}°C*, {{ states(''sensor.humidity_in_toilet'')
|
||
}}%
|
||
|
||
Кладовая: *{{ states(''sensor.temperature_in_storeroom'') }}°C*, {{ states(''sensor.humidity_in_storeroom'')
|
||
}}%
|
||
|
||
|
||
*Статус устройств*
|
||
|
||
`-= Датчики протечки =-`
|
||
|
||
Нептун (кладовая, туалет, ванна, кухня): *{{ states(''binary_sensor.neptun_water_leakage'')
|
||
}}*
|
||
|
||
Aqara кладовая: *{{ states(''binary_sensor.0x158d000400e77d_moisture'') }}*
|
||
|
||
Aqara под ванной (слева): *{{ states(''binary_sensor.0x158d0004030d84_moisture'')
|
||
}}*
|
||
|
||
Aqara справа от ванной: *{{ states(''binary_sensor.lumi_lumi_sensor_wleak_aq1_ias_zone'')
|
||
}}*
|
||
|
||
`-= Вытяжка =-`
|
||
|
||
Ванная: *{{ states(''binary_sensor.bathroom_extractor_fan'') }}*
|
||
|
||
Туалет: *{{ states(''binary_sensor.toilet_extractor_fan'') }}*
|
||
|
||
`-= Кондиционеры =-`
|
||
|
||
Детская: *{{ states(''binary_sensor.0x158d00039cf974_contact'') }}*
|
||
|
||
Гостинная: *{{ states(''binary_sensor.0x158d0003d54725_contact'') }}*
|
||
|
||
Спальня: *{{ states(''binary_sensor.0x158d0004073b67_contact'') }}*
|
||
|
||
`-= Крупная бытовая техника =-`
|
||
|
||
Водонагреватель: *{{ states(''binary_sensor.boiler_status'') }}* ({{ states(''sensor.tplink_smartplug_01_current_consumption'')
|
||
}} W)
|
||
|
||
Стиральная машина: *{{ states(''binary_sensor.washer_status'') }}* ({{ states(''sensor.tplink_smartplug_02_current_consumption'')
|
||
}} W)
|
||
|
||
Сушильная машина: *{{ states(''binary_sensor.dryer_status'') }}* ({{ states(''sensor.gosund_sp111_09_watt'')
|
||
}} W)
|
||
|
||
Посудомоечная машина: *{{ states(''binary_sensor.dishwasher_status'') }}*
|
||
({{ states(''sensor.gosund_sp111_06_watt'') }} W)
|
||
|
||
Холодильник: *{{ states(''binary_sensor.fridge_status'') }}* ({{ states(''sensor.gosund_sp111_04_watt'')
|
||
}} W)
|
||
|
||
Духовой шкаф: *{{ states(''binary_sensor.oven_status'') }}* ({{ states(''sensor.gosund_sp111_10_watt'')
|
||
}} W)
|
||
|
||
`-= Свет =-`
|
||
|
||
Споты в прихожей: *{{ states(''light.sonoff_1000f2f14a'') }}*
|
||
|
||
Споты в коридоре: *{{ states(''light.sonoff_1000f2a500'') }}*
|
||
|
||
Люстра в детской: *{{ states(''light.ikea_e27_detskaia'') }}*
|
||
|
||
Подсветка окна в детской: *{{ states(''light.detskaia_podsvetka_na_okne'')
|
||
}}*
|
||
|
||
Лампа на столе в детской слева: *{{ states(''light.ikea_e14_level_light_color_on_off'')
|
||
}}*
|
||
|
||
Лампа на столе в детской справа: *{{ states(''light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light'')
|
||
}}*
|
||
|
||
Люстра в гостиной: *{{ states(''light.sonoff_1000f3035d'') }}*
|
||
|
||
Споты в гостиной: *{{ states(''light.sonoff_1000f30a9e'') }}*
|
||
|
||
Бра в гостиной: *{{ states(''light.sonoff_1000ab3c28'') }}*
|
||
|
||
Подсветка онка в гостиной: *{{ states(''light.gostinaia_podsvetka_na_okne'')
|
||
}}*
|
||
|
||
Лампа на столе в гостиной: *{{ states(''light.ikea_e27_level_light_color_on_off'')
|
||
}}*
|
||
|
||
Споты на кухне: *{{ states(''light.sonoff_1000b72483'') }}*
|
||
|
||
Подсветка кухни: *{{ states(''light.kukhnia_lenta'') }}*
|
||
|
||
Люстра на кухне: *{{ states(''light.ikea_e27_kukhnia'') }}*
|
||
|
||
Споты в Ванной: *{{ states(''light.sonoff_zbmini_04_on_off'') }}*
|
||
|
||
Споты в Туалете: *{{ states(''light.sonoff_zbmini_03_on_off'') }}*
|
||
|
||
Люстра в кладовой: *{{ states(''light.sonoff_1000b6831b'') }}*
|
||
|
||
Люстра в спальне: *{{ states(''light.sonoff_1001053235'') }}*
|
||
|
||
Бра в спальне - лево: *{{ states(''light.sonoff_01minizb_47ef08fe_on_off'')
|
||
}}*
|
||
|
||
Бра в спальне - право: *{{ states(''light.sonoff_1001045426'') }}*
|
||
|
||
Лампа на столе в спальне: *{{ states(''light.spalnia_stol'') }}*
|
||
|
||
`-= Шторы =-`
|
||
|
||
Кухня - левая: *{{ states(''cover.tze200_rddyvrci_ts0601_5c2fbdfe_window_covering'')
|
||
}}*
|
||
|
||
Кухня - правая: *{{ states(''cover.tze200_rddyvrci_ts0601_df30bdfe_window_covering'')
|
||
}}*
|
||
|
||
`-= Розетки =-`
|
||
|
||
Розетка Xiaomi WiFi Plug 01: *{{ states(''switch.mi_smartplugwifi_01'') }}*
|
||
|
||
`-= ТВ =-`
|
||
|
||
Спальня: *{{ states(''media_player.ue43ru7470'') }}*
|
||
|
||
Гостинная: *{{ states(''media_player.ue46es5507'') }}*
|
||
|
||
Кухня: *{{ states(''media_player.ue32es5500'') }}*
|
||
|
||
Детская: *{{ states(''binary_sensor.samsungtv_40c5100'') }}*
|
||
|
||
`-= Chromecast =-`
|
||
|
||
Гостинная: *{{ states(''media_player.gostinaia'') }}*
|
||
|
||
Детская: *{{ states(''media_player.detskaia'') }}*
|
||
|
||
`-= Yandex =-`
|
||
|
||
Прихожая: *{{ states(''media_player.yandex_station_lite_prikhozhaya'') }}*
|
||
|
||
Детская: *{{ states(''media_player.yandex_station_lite_detskaia'') }}*
|
||
|
||
Гостинная: *{{ states(''media_player.yandex_station_mini2_gostinaia'') }}*
|
||
|
||
Спалья: *{{ states(''media_player.yandex_station_mini2_spalnia'') }}*
|
||
|
||
`-= Разное =-`
|
||
|
||
Входная дверь: *{{ states(''sensor.entrance_door_status'') }}*
|
||
|
||
Датчик газа: *{{ states(''binary_sensor.0x00158d000413b210_gas'') }}*
|
||
|
||
Датчик газа (питание): *{{ states(''switch.blitzwolf_shp13_02_3ad702fe_on_off'')
|
||
}}*
|
||
|
||
Mi Robot: *{{ states(''vacuum.xiaomi_vacuum_cleaner'') }}*
|
||
|
||
Transmission Status: *{{ states(''sensor.transmission_status'') }}*
|
||
|
||
Plex Users: *{{ states(''sensor.plex_plexonubuntu'') }}*
|
||
|
||
'
|
||
- alias: 'Alice: Lumos'
|
||
id: 1385db9f-772d-474e-b9bc-237c073ba44a
|
||
mode: restart
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Люмос
|
||
room: Гостиная
|
||
id: Living_Room_Lumos
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Люмос максима
|
||
room: Гостиная
|
||
id: Living_Room_Lumos_Maxima
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Нокс
|
||
room: Гостиная
|
||
id: Living_Room_Nox
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Люмос
|
||
room: Детская
|
||
id: Nursery_Lumos
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Люмос максима
|
||
room: Детская
|
||
id: Nursery_Lumos_Maxima
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Нокс
|
||
room: Детская
|
||
id: Nursery_Nox
|
||
actions:
|
||
choose:
|
||
- alias: Nursery Lumos
|
||
conditions:
|
||
- condition: trigger
|
||
id: Nursery_Lumos
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.ikea_e27_detskaia
|
||
- alias: Nursery Lumos Maxima
|
||
conditions:
|
||
- condition: trigger
|
||
id: Nursery_Lumos_Maxima
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
area_id: 24758c6268dd46168d35620719b05ed0
|
||
- alias: Nursery Nox
|
||
conditions:
|
||
- condition: trigger
|
||
id: Nursery_Nox
|
||
sequence:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.ikea_e27_detskaia
|
||
- alias: Living Room Lumos
|
||
conditions:
|
||
- condition: trigger
|
||
id: Living_Room_Lumos
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_1000f30a9e
|
||
- alias: Living Room Lumos Maxima
|
||
conditions:
|
||
- condition: trigger
|
||
id: Living_Room_Lumos_Maxima
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
area_id: 38de229de4ae4b9c9aebbb4973528a2f
|
||
- alias: Living Room Nox
|
||
conditions:
|
||
- condition: trigger
|
||
id: Living_Room_Nox
|
||
sequence:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_1000f30a9e
|
||
- alias: Mirror Yandex Station input_select Name to ID
|
||
id: 1ec5424e-f770-486c-b4cf-ed29e65dcb36
|
||
triggers:
|
||
trigger: state
|
||
entity_id: input_select.yandex_station_target_name
|
||
actions:
|
||
- action: input_text.set_value
|
||
target:
|
||
entity_id: input_text.yandex_station_target_id
|
||
data:
|
||
value: "{% if trigger.to_state.state == 'Детская' %}\n media_player.yandex_station_lite_detskaia\n\
|
||
{% elif trigger.to_state.state == 'Гостиная' %}\n media_player.yandex_station_mini2_gostinaia\n\
|
||
{% elif trigger.to_state.state == 'Спальня' %}\n media_player.yandex_station_mini2_spalnia\n\
|
||
{% elif trigger.to_state.state == 'Прихожая' %}\n media_player.yandex_station_lite_prikhozhaya\n\
|
||
{% endif %}\n"
|
||
- alias: 'Auto Reboot: Reset Automatic Reboot Counter'
|
||
id: 950840e8-8ef1-4984-8996-6ddee1f56cb7
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: sensor.ha_uptime
|
||
to: '10'
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ (states(''counter.auto_reboot'') | int) > 0 }}'
|
||
actions:
|
||
- action: counter.set_value
|
||
target:
|
||
entity_id: counter.auto_reboot
|
||
data:
|
||
value: '0'
|
||
- alias: 'Auto Reboot: Telegram Control - Cancel Auto Reboot'
|
||
id: 5524cadd-7b96-41f8-b489-90782e17af80
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /cancel_auto_reboot
|
||
actions:
|
||
- action: script.turn_off
|
||
target:
|
||
entity_id: script.auto_reboot_by_errors_after_boot
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
title: '*Внимание*'
|
||
message: Автоматическая перезагрузка Home Assistant *отменена*
|
||
- alias: Forgotten car key - Alex
|
||
id: abdaa9e1-cfbc-4c00-b22c-db82f01cd214
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.amazfit_gtr_4_presence
|
||
from: 'on'
|
||
to: 'off'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: binary_sensor.holy_iot_white_1_presence
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: binary_sensor.holy_iot_black_1_presence
|
||
state: 'off'
|
||
actions:
|
||
- wait_template: '{{ is_state(''binary_sensor.holy_iot_white_1_presence'', ''off'')
|
||
}}'
|
||
timeout: 00:00:30
|
||
- if:
|
||
- '{{ not wait.completed }}'
|
||
then:
|
||
- parallel:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_stall_id
|
||
parse_mode: html
|
||
title: <b>Внимание</b>
|
||
message: Возможно, ты забыл ключ от машины
|
||
- action: notify.mobile_app_kb2003
|
||
data:
|
||
title: Ключ от машины
|
||
message: Возможно, ты забыл ключ от машины...
|
||
data:
|
||
ttl: 0
|
||
priority: high
|
||
channel: alarm_stream
|
||
importance: max
|
||
color: red
|
||
clickAction: entityId:binary_sensor.holy_iot_white_1_presence
|
||
- alias: Forgotten school pass reminder - Egor
|
||
id: 0a72e0b9-d7f2-41b9-90b3-5d1a601de887
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.0x158d00031c790f_contact
|
||
from: 'on'
|
||
to: 'off'
|
||
conditions:
|
||
- condition: time
|
||
after: 07:30:00
|
||
before: 08:30:00
|
||
- condition: state
|
||
entity_id: binary_sensor.workday_sensor
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: calendar.semia_alexander_borisov_school_vacation_egor
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: binary_sensor.holy_iot_green_1_presence
|
||
state: 'on'
|
||
actions:
|
||
- wait_template: '{{ is_state(''binary_sensor.holy_iot_green_1_presence'', ''off'')
|
||
}}'
|
||
timeout: 00:00:30
|
||
- if:
|
||
- '{{ not wait.completed }}'
|
||
then:
|
||
- parallel:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
parse_mode: html
|
||
title: <b>Внимание</b>
|
||
message: Возможно, Егор забыл пропуск в школу...
|
||
- action: notify.mobile_app_kb2003
|
||
data:
|
||
title: Пропуск в школу
|
||
message: Возможно, Егор забыл пропуск в школу...
|
||
data:
|
||
ttl: 0
|
||
priority: high
|
||
channel: alarm_stream
|
||
importance: max
|
||
color: red
|
||
clickAction: entityId:binary_sensor.holy_iot_green_1_presence
|
||
- action: media_player.play_media
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_prikhozhaya
|
||
data:
|
||
media_content_id: Внимание, возможно, Егор забыл пропуск в школу
|
||
media_content_type: text
|
||
extra:
|
||
volume_level: 0.7
|
||
- alias: Catch Possible Frigate FFmpeg Errors
|
||
id: ad6c6761-94ba-4edb-b744-b844c5f0d2d6
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.frigate_reolinkcam_02_ffmpeg_problem
|
||
from: 'off'
|
||
to: 'on'
|
||
actions:
|
||
- parallel:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
title: '*Frigate Warning*'
|
||
message: 'Возможна проблема с камерой Reolink 02,
|
||
|
||
будет выполнена попытка перезагрузки Frigate.
|
||
|
||
'
|
||
- action: shell_command.restart_frigate_srv01
|
||
- alias: Движение в детской
|
||
id: 6166ef07-c478-44e3-a226-24d7737d6646
|
||
initial_state: false
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.0x158d00044cea8e_motion
|
||
from: 'off'
|
||
to: 'on'
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: 'В *Детской* обнаружено движение:'
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Camera Snapshot 1
|
||
data:
|
||
photo:
|
||
- url: secret dafangcam_03_snapshot_url
|
||
- delay:
|
||
seconds: 1
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Camera Snapshot 2
|
||
data:
|
||
photo:
|
||
- url: secret dafangcam_03_snapshot_url
|
||
- delay:
|
||
seconds: 1
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Camera Snapshot 3
|
||
data:
|
||
photo:
|
||
- url: secret dafangcam_03_snapshot_url
|
||
- alias: Вкл контроль движения в детской
|
||
id: f46ce78b-11b1-42e9-b217-34ed6eabb7bb
|
||
triggers:
|
||
trigger: time
|
||
at: '23:30:00'
|
||
actions:
|
||
- action: automation.turn_on
|
||
target:
|
||
entity_id: automation.dvizhenie_v_detskoi
|
||
- alias: Выкл контроль движения в детской
|
||
id: 0ffb0c86-cd64-4990-9571-da1799709488
|
||
triggers:
|
||
trigger: time
|
||
at: 07:00:00
|
||
actions:
|
||
- action: automation.turn_off
|
||
target:
|
||
entity_id: automation.dvizhenie_v_detskoi
|
||
- alias: Вход в квартиру
|
||
id: 47a5b56e-5c41-4ae6-a3c2-25984c67b1b5
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.0x158d00031c790f_contact
|
||
from: 'off'
|
||
to: 'on'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: binary_sensor.0x158d000309920a_motion
|
||
state: 'off'
|
||
actions:
|
||
- delay:
|
||
seconds: 3
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Camera Snapshot 1
|
||
data:
|
||
photo:
|
||
- url: secret dafangcam_02_snapshot_url
|
||
- delay:
|
||
seconds: 1
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Camera Snapshot 2
|
||
data:
|
||
photo:
|
||
- url: secret dafangcam_02_snapshot_url
|
||
- delay:
|
||
seconds: 2
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Camera Snapshot 3
|
||
data:
|
||
photo:
|
||
- url: secret dafangcam_02_snapshot_url
|
||
- delay:
|
||
seconds: 3
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: Camera Snapshot 4
|
||
data:
|
||
photo:
|
||
- url: secret dafangcam_02_snapshot_url
|
||
- alias: DafangCam-02 Turn Off Night Mode by Light
|
||
id: ff6813b7-a4a7-4682-bacb-c28290e43f88
|
||
triggers:
|
||
trigger: state
|
||
entity_id: light.sonoff_1000f2f14a
|
||
to: 'on'
|
||
actions:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.dafangcam02_night_mode
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.dafangcam02_ir_filter
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.dafangcam02_ir_led
|
||
- alias: Staircase - Person detected
|
||
id: 56d572c7-3750-4988-8294-aa241a4f4b31
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.reolinkcam_01_person_occupancy
|
||
from: 'off'
|
||
to: 'on'
|
||
actions:
|
||
- parallel:
|
||
- sequence:
|
||
- delay:
|
||
seconds: 1
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_staircase
|
||
message: '{{ now().strftime(''%d.%m.%Y, %H:%M:%S'') }}
|
||
|
||
Обнаружен человек на лестничной клетке:
|
||
|
||
'
|
||
- action: telegram_bot.send_photo
|
||
data:
|
||
target: secret tlg_group_staircase
|
||
url: secret reolinkcam_01_snapshot_url
|
||
verify_ssl: false
|
||
- sequence:
|
||
- action: telegram_bot.send_video
|
||
data:
|
||
target: secret tlg_group_staircase
|
||
url: secret go2rtc_reolinkcam_01_mp4_7s
|
||
- alias: Staircase - Send recorded video
|
||
id: 692afba6-c94d-477f-9ac4-d064643898ce
|
||
triggers:
|
||
trigger: event
|
||
event_type: folder_watcher
|
||
event_data:
|
||
event_type: deleted
|
||
file: staircase_movement.mp4.tmp
|
||
actions:
|
||
- action: telegram_bot.send_video
|
||
data:
|
||
target: secret tlg_group_staircase
|
||
file: /config/video/staircase_movement.mp4
|
||
caption: secret look_at_cam_reolinkcam_01
|
||
timeout: 180
|
||
- alias: Staircase - Motion detected - Frigate
|
||
id: 1550b036-824f-47d8-9dcf-674b475c5060
|
||
mode: single
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: mqtt
|
||
topic: frigate_srv01/events
|
||
payload: reolinkcam_01
|
||
value_template: '{{ value_json[''after''][''camera''] }}'
|
||
variables:
|
||
id: '{{ trigger.payload_json[''after''][''id''] }}'
|
||
camera: '{{ trigger.payload_json[''after''][''camera''] }}'
|
||
target_chat: secret tlg_group_staircase
|
||
type: '{{ trigger.payload_json[''type''] }}'
|
||
base_url: secret external_url
|
||
conditions:
|
||
- '{{ type = ''end'' }}'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: '{{ target_chat }}'
|
||
message: '{{ now().strftime(''%d.%m.%Y, %H:%M:%S'') }}
|
||
|
||
Обнаружено движение на лестничной клетке,
|
||
|
||
(ID: {{ id }}):
|
||
|
||
'
|
||
- action: telegram_bot.send_photo
|
||
data:
|
||
target: '{{ target_chat }}'
|
||
url: '{{base_url}}/api/frigate/notifications/{{id}}/snapshot.jpg'
|
||
- repeat:
|
||
sequence:
|
||
- wait_for_trigger:
|
||
- trigger: mqtt
|
||
topic: frigate_srv01/events
|
||
payload: '{{ id }}'
|
||
value_template: '{{ value_json[''after''][''id''] }}'
|
||
timeout:
|
||
minutes: 2
|
||
continue_on_timeout: false
|
||
- condition: template
|
||
value_template: '{{ wait.trigger.payload_json[''type''] == ''end'' }}'
|
||
- action: telegram_bot.send_video
|
||
data:
|
||
target: '{{ target_chat }}'
|
||
url: '{{base_url}}/api/frigate/notifications/{{id}}/{{camera}}/clip.mp4'
|
||
until: '{{ wait.trigger.payload_json[''type''] == ''end'' }}'
|
||
- alias: Homecoming Greeting
|
||
id: 8431232f-319a-4184-94e9-bc070403eec4
|
||
mode: queued
|
||
max: 5
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: sensor.double_take_alexander_b
|
||
to: dafangcam_02
|
||
id: alex
|
||
- trigger: state
|
||
entity_id: sensor.double_take_irina_b
|
||
to: dafangcam_02
|
||
id: irina
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ (as_timestamp(now()) - as_timestamp(as_local(states[''binary_sensor.0x158d00031c790f_contact''].last_changed)))
|
||
< 90 }}'
|
||
actions:
|
||
- choose:
|
||
- conditions:
|
||
- '{{ trigger.id == ''alex'' }}'
|
||
- '{{ is_state(''person.alexander'', ''home'') }}'
|
||
- '{{ (as_timestamp(now()) - as_timestamp(as_local(states.person.alexander.last_changed)))
|
||
< 600 }}'
|
||
sequence:
|
||
- action: script.homecoming_greeting
|
||
data:
|
||
pers_name: Александр
|
||
match_filename: '{{ trigger.to_state.attributes.match.filename }}'
|
||
- conditions:
|
||
- '{{ trigger.id == ''irina'' }}'
|
||
- '{{ is_state(''person.irina'', ''home'') }}'
|
||
- '{{ (as_timestamp(now()) - as_timestamp(as_local(states.person.irina.last_changed)))
|
||
< 600 }}'
|
||
sequence:
|
||
- action: script.homecoming_greeting
|
||
data:
|
||
pers_name: Ирина
|
||
match_filename: '{{ trigger.to_state.attributes.match.filename }}'
|
||
- alias: Country House CCTV - Toggle Camera
|
||
id: 97f7f60b-61c2-482b-894a-c12704418075
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.coutry_house_presence
|
||
actions:
|
||
choose:
|
||
- alias: Presence Sensor To On
|
||
conditions: '{{ trigger.to_state.state == ''on'' }}'
|
||
sequence:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.frigate_srv01_reolinkcam_02
|
||
- alias: Presence Sensor To Off
|
||
conditions: '{{ trigger.to_state.state == ''off'' }}'
|
||
sequence:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.frigate_srv01_reolinkcam_02
|
||
- alias: Country House CCTV - Person detected
|
||
id: a0d9386b-ecf4-46f1-92d8-6ad1a777d1d9
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.reolinkcam_02_person_occupancy
|
||
from: 'off'
|
||
to: 'on'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: binary_sensor.coutry_house_presence
|
||
state: 'off'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_country_house
|
||
message: '{{ now().strftime(''%d.%m.%Y, %H:%M:%S'') }}
|
||
|
||
На даче обнаружен человек:
|
||
|
||
'
|
||
- action: telegram_bot.send_photo
|
||
data:
|
||
target: secret tlg_group_country_house
|
||
url: secret reolinkcam_02_snapshot_url
|
||
caption: secret look_at_cam_reolinkcam_02
|
||
timeout: 60
|
||
- alias: CH Set current cost per kWh
|
||
id: 28450e89-7fdf-459d-bcbd-9e3ea9377de7
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: sensor.country_house_enegry_cost_mes_t1
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
conditions:
|
||
- '{{ trigger.to_state.state | is_number() }}'
|
||
actions:
|
||
- action: input_number.set_value
|
||
target:
|
||
entity_id: input_number.country_house_enegry_cost_current
|
||
data:
|
||
value: '{{ trigger.to_state.state | float(0) }}'
|
||
- alias: CH Set Main Energy Meter values for predict
|
||
id: 3570493e-c074-4d88-b8ce-a196cb1a60a6
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- input_number.country_house_enegry_meter_value
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
actions:
|
||
- action: input_number.set_value
|
||
target:
|
||
entity_id: input_number.country_house_enegry_meter_predicted_value
|
||
data:
|
||
value: '{{ trigger.to_state.state | float(0) }}'
|
||
- alias: CH Predict energy meter readings
|
||
id: 36df2266-8486-42de-b42d-d7b956c24e40
|
||
triggers:
|
||
- trigger: time
|
||
at: '23:59:55'
|
||
actions:
|
||
- action: input_number.set_value
|
||
target:
|
||
entity_id: input_number.country_house_enegry_meter_predicted_value
|
||
data:
|
||
value: '{{ ((states(''input_number.country_house_enegry_meter_predicted_value'')
|
||
| float(0)) + (states(''sensor.rch_ch_main_energy_daily_total'') | float(0)))
|
||
| round(2) }}'
|
||
- alias: CH Push Energy Meter reading
|
||
id: d20af113-a06c-4eec-a1a0-0a8a4f8f6fa9
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- sensor.ch_energy_meter_value_saved_for_transfer
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
conditions:
|
||
- '{{ (now().strftime(''%d'') | int(0)) == (states(''input_number.country_house_enegry_meter_value_transfer_day'')
|
||
| int(0)) }}'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_country_house
|
||
title: '*Электроэнергия:*'
|
||
message: 'Зафиксировано новое значение кВт⋅ч для передачи в МЭС.
|
||
|
||
Предыдущее: {{ trigger.from_state.state }}
|
||
|
||
Текущее: {{ trigger.to_state.state }}
|
||
|
||
Расход: {{ (trigger.to_state.state | int(0)) - (trigger.from_state.state |
|
||
int(0)) }} кВт⋅ч
|
||
|
||
Примерная сумма счета: {{ (((trigger.to_state.state | float(0)) - (trigger.from_state.state
|
||
| float(0))) * (states(''input_number.country_house_enegry_cost_current'')
|
||
| float(0))) | round(1) }} руб.
|
||
|
||
'
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.ch_push_energy_readings_to_mes
|
||
- alias: CH Energy Meter readings accepted notification
|
||
id: 99ae89c3-a865-4c3b-841c-729bbbc4b447
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- binary_sensor.mes_55384_014_37_meter_44259893_readings_accepted
|
||
to: 'on'
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_country_house
|
||
title: '*Электроэнергия:*'
|
||
message: Переданные показания учтены в МЭС ({{ states('sensor.mes_55384_014_37_meter_44259893_zone_t1_period_indication')
|
||
}} кВт⋅ч).
|
||
- alias: Дача Водяной Насос - Telegram Control - Включение
|
||
id: c4ff5d52-df3b-4e02-a8ef-f4a11323dcb4
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /water_pump_on
|
||
actions:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.rch_sonoff_pow_r3_02
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_replymarkup
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
inline_keyboard: []
|
||
- alias: Wait for switch.rch_sonoff_pow_r3_02
|
||
wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: switch.rch_sonoff_pow_r3_02
|
||
from: 'off'
|
||
to: 'on'
|
||
timeout: 00:00:10
|
||
continue_on_timeout: false
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message: Насос включен.
|
||
- alias: Дача - Telegram Control - Turn On Away Mode
|
||
id: 86da4969-92fa-49c9-aba3-23ab804e7194
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /ch_turn_on_away_mode
|
||
actions:
|
||
- action: scene.turn_on
|
||
target:
|
||
entity_id: scene.rch_ch_away
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_replymarkup
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
inline_keyboard: []
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_country_house
|
||
message: Включен Away Mode
|
||
- alias: Central Heating State Notification
|
||
id: a50dc6a0-b2d1-45d9-bab8-7fc62e43fb05
|
||
mode: queued
|
||
max: 10
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.central_heating_nursery
|
||
id: nursery
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
- trigger: state
|
||
entity_id: binary_sensor.central_heating_livingroom
|
||
id: livingroom
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
- trigger: state
|
||
entity_id: binary_sensor.central_heating_kitchen
|
||
id: kitchen
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
- trigger: state
|
||
entity_id: binary_sensor.central_heating_bedroom
|
||
id: bedroom
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
conditions: '{{ states(''sensor.ha_uptime'') = ''0'' }}'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: '{%- if trigger.id == "nursery" %}{% set room = "детской" %}{% set
|
||
temp = states(''sensor.lumi_lumi_weather_824e9807_temperature'') %}
|
||
|
||
{%- elif trigger.id == "livingroom" %}{% set room = "гостиной" %}{% set temp
|
||
= states(''sensor.lumi_lumi_weather_bf387507_temperature'') %}
|
||
|
||
{%- elif trigger.id == "kitchen" %}{% set room = "кухне" %}{% set temp = states(''sensor.lumi_lumi_weather_4dad5507_temperature'')
|
||
%}
|
||
|
||
{%- elif trigger.id == "bedroom" %}{% set room = "спальне" %}{% set temp =
|
||
states(''sensor.lumi_lumi_weather_temperature'') %}
|
||
|
||
{%- endif %}
|
||
|
||
Отопление в {{ room }} {% if trigger.to_state.state == ''on'' %}*включено*{%else%}*выключено*{%endif%}.
|
||
|
||
Температура в районе трубы отопления {{ temp }}°C.
|
||
|
||
'
|
||
- alias: Thermo alert [Nursery]
|
||
id: bb3a7df3-3e20-4ebe-8b49-bc9ba69ad2b6
|
||
triggers:
|
||
- trigger: template
|
||
value_template: '{{ (states(''sensor.temperature_in_nursery'') | float(0)) < 22
|
||
}}'
|
||
for:
|
||
minutes: 5
|
||
- trigger: template
|
||
value_template: '{{ (states(''sensor.temperature_in_nursery'') | float(0)) > 25
|
||
}}'
|
||
for:
|
||
minutes: 5
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: 'В *Детской* {% if (trigger.to_state.state | float(0)) > 23 -%} жарко,
|
||
{% elif (trigger.to_state.state | float(0)) < 23 -%} холодно, {% endif -%}
|
||
температура: *{{ trigger.to_state.state }}°C*'
|
||
- alias: Thermo alert [Living Room]
|
||
id: 0e135e8d-3ad5-40cb-9d8f-9ab3df6b91bd
|
||
triggers:
|
||
- trigger: template
|
||
value_template: '{{ (states(''sensor.temperature_in_livingroom'') | float(0))
|
||
< 22 }}'
|
||
for:
|
||
minutes: 5
|
||
- trigger: template
|
||
value_template: '{{ (states(''sensor.temperature_in_livingroom'') | float(0))
|
||
> 25 }}'
|
||
for:
|
||
minutes: 5
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: 'В *Гостиной* {% if (trigger.to_state.state | float(0)) > 23 -%} жарко,
|
||
{% elif (trigger.to_state.state | float(0)) < 23 -%} холодно, {% endif -%}
|
||
температура: *{{ trigger.to_state.state }}°C*'
|
||
- alias: Thermo alert [Bedroom]
|
||
id: 524b5b92-0f5d-4429-88d2-9903ec325389
|
||
triggers:
|
||
- trigger: template
|
||
value_template: '{{ (states(''sensor.temperature_in_bedroom'') | float(0)) < 21
|
||
}}'
|
||
for:
|
||
minutes: 5
|
||
- trigger: template
|
||
value_template: '{{ (states(''sensor.temperature_in_bedroom'') | float(0)) > 24.5
|
||
}}'
|
||
for:
|
||
minutes: 5
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: 'В *Спальне* {% if (trigger.to_state.state | float(0)) > 23 -%} жарко,
|
||
{% elif (trigger.to_state.state | float(0)) < 23 -%} холодно, {% endif -%}
|
||
температура: *{{ trigger.to_state.state }}°C*'
|
||
- alias: AC - long running [8h]
|
||
id: 09f64418-db04-4327-a714-57d9ea39d1ed
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- binary_sensor.0x158d00039cf974_contact
|
||
- binary_sensor.0x158d0003d54725_contact
|
||
- binary_sensor.0x158d0004073b67_contact
|
||
from: 'off'
|
||
to: 'on'
|
||
for:
|
||
hours: 8
|
||
actions:
|
||
action: notify.telegram_group_flat_1
|
||
data:
|
||
message: 'Внимание, *{{ trigger.to_state.attributes.friendly_name.replace(''Геркон
|
||
'','''').replace('' on_off'','''') }}* работает больше 8 часов.
|
||
|
||
'
|
||
- alias: AC - long running [16h]
|
||
id: 970eef7a-4b66-4186-88ff-a0542c13c10a
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- binary_sensor.0x158d00039cf974_contact
|
||
- binary_sensor.0x158d0003d54725_contact
|
||
- binary_sensor.0x158d0004073b67_contact
|
||
from: 'off'
|
||
to: 'on'
|
||
for:
|
||
hours: 16
|
||
actions:
|
||
action: notify.telegram_group_flat_1
|
||
data:
|
||
message: 'Внимание, *{{ trigger.to_state.attributes.friendly_name.replace(''Геркон
|
||
'','''').replace('' on_off'','''') }}* работает больше *16* часов.
|
||
|
||
'
|
||
- alias: AC - long running [24h]
|
||
id: 106513d8-941c-4bfe-8f42-1fe9c95a77de
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- binary_sensor.0x158d00039cf974_contact
|
||
- binary_sensor.0x158d0003d54725_contact
|
||
- binary_sensor.0x158d0004073b67_contact
|
||
from: 'off'
|
||
to: 'on'
|
||
for:
|
||
hours: 24
|
||
actions:
|
||
action: notify.telegram_group_flat_1
|
||
data:
|
||
message: 'Внимание, *{{ trigger.to_state.attributes.friendly_name.replace(''Геркон
|
||
'','''').replace('' on_off'','''') }}* работает больше *24* часов.
|
||
|
||
'
|
||
- alias: Carbon dioxide alert
|
||
id: 5c2a3b8f-9bc7-4c73-a0b7-62f53e2d8d4a
|
||
mode: queued
|
||
max: 10
|
||
triggers:
|
||
- trigger: template
|
||
value_template: '{{ (states(''sensor.co2_in_nursery'') | int(0)) >= 1000 }}'
|
||
for:
|
||
minutes: 10
|
||
- trigger: template
|
||
value_template: '{{ (states(''sensor.co2_in_livingroom'') | int(0)) >= 1000 }}'
|
||
for:
|
||
minutes: 10
|
||
- trigger: template
|
||
value_template: '{{ (states(''sensor.co2_in_bedroom'') | int(0)) >= 1000 }}'
|
||
for:
|
||
minutes: 10
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: "Повышенное содержание углекислого газа в \n{%- if 'nursery' in trigger.entity_id\
|
||
\ %} *Детской*\n{%- elif 'livingroom' in trigger.entity_id %} *Гостиной*\n\
|
||
{%- elif 'bedroom' in trigger.entity_id %} *Спальне*\n{%- endif %} (*{{ states(trigger.entity_id)\
|
||
\ }}* ppm).\nНеобходимо проветрить комнату."
|
||
- alias: Domofon - Opened by Button Notification
|
||
id: cb5e25c1-dcb7-4b75-a6c4-6b12eb84f86b
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.domofon_button
|
||
to: 'on'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: binary_sensor.domofon_incoming_call
|
||
state: 'on'
|
||
actions:
|
||
action: notify.telegram_group_flat_1
|
||
data:
|
||
message: '_Домофон_: открыт кнопкой'
|
||
- alias: Domofon - Incoming Call Notification
|
||
id: 741a9858-1687-4b2d-8afd-73373e8cc8ba
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.domofon_incoming_call
|
||
to: 'on'
|
||
actions:
|
||
- parallel:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: '_Домофон_: входящий звонок... {% if is_state(''switch.domofon_automatically_open'',
|
||
''on'') or is_state(''switch.domofon_automatically_open_once'', ''on'')
|
||
%}(*откроется автоматически*){% endif %}'
|
||
data:
|
||
inline_keyboard:
|
||
- '{{ ''-'' if is_state(''switch.domofon_automatically_open'', ''on'') or
|
||
is_state(''switch.domofon_automatically_open_once'', ''on'') else ''Открыть:/domofon_open,
|
||
Отклонить:/domofon_reject'' }}'
|
||
- sequence:
|
||
- condition: '{{ is_state(''switch.domofon_automatically_open_once'', ''off'')
|
||
}}'
|
||
- action: script.domofon_alice_notify
|
||
- alias: Domofon - Alice Intent control
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Открой домофон
|
||
id: open
|
||
actions:
|
||
choose:
|
||
- alias: Open Door
|
||
conditions:
|
||
- condition: trigger
|
||
id: open
|
||
sequence:
|
||
- action: esphome.domofon_accept_call
|
||
- alias: Domofon - Telegram Control - domofon_open
|
||
id: 99d5c580-c382-48b3-bd2d-f6eb00b62c31
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /domofon_open
|
||
actions:
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: '{{ ''Открываю...'' if is_state(''binary_sensor.domofon_incoming_call'',
|
||
''on'') else ''Нет входящего звонка'' }}'
|
||
- action: esphome.domofon_accept_call
|
||
- action: telegram_bot.edit_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
message: '_Домофон_: входящий звонок...
|
||
|
||
{{ ''Домофон *открыт*'' if is_state(''binary_sensor.domofon_incoming_call'',
|
||
''on'') else '''' }}
|
||
|
||
'
|
||
- alias: Domofon - Telegram Control - domofon_reject
|
||
id: a50fb75b-0083-4866-8496-bdd013332a88
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /domofon_reject
|
||
actions:
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: '{{ ''Отклоняю...'' if is_state(''binary_sensor.domofon_incoming_call'',
|
||
''on'') else ''Нет входящего звонка'' }}'
|
||
- action: esphome.domofon_reject_call
|
||
- action: telegram_bot.edit_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
message: '_Домофон_: входящий звонок...
|
||
|
||
{{ ''Звонок *сброшен*'' if is_state(''binary_sensor.domofon_incoming_call'',
|
||
''on'') else '''' }}
|
||
|
||
'
|
||
- alias: Domofon - Mute and UnMute by Time
|
||
id: 97a74c5f-6a9f-4af6-9f8e-2a7fcd0a5070
|
||
triggers:
|
||
- platform: time
|
||
at: '21:00:00'
|
||
- platform: time
|
||
at: 08:00:00
|
||
actions:
|
||
- action: "{% if trigger.now.hour == 21 -%}\n switch.turn_on\n{% elif trigger.now.hour\
|
||
\ == 8 -%}\n switch.turn_off\n{% endif %}"
|
||
data:
|
||
entity_id: switch.domofon_mute_sound
|
||
- alias: Domofon - ESP Board Lost Connection
|
||
id: 6cac01e7-945c-4f37-8b2d-d75e03107d76
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.domofon_status
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ states(''input_boolean.ha_shutdown'') == ''off'' }}'
|
||
- condition: template
|
||
value_template: '{{ states(''sensor.ha_uptime'') > ''1'' }}'
|
||
actions:
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: "*Внимание*\n{% if trigger.to_state.state == 'off' -%}\n _Домофон_:\
|
||
\ потеряно подключение к HA.\n{% elif trigger.to_state.state == 'on' -%}\n\
|
||
\ _Домофон_: восстановлено подключение к HA\n{% endif %}\n"
|
||
- alias: Domofon - Open Once for Couriers
|
||
id: c916925d-cd33-4f30-882b-4049e52acf12
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- sensor.kb2003_last_notification
|
||
- sensor.2109119dg_last_notification
|
||
condition:
|
||
- or:
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state | regex_search(''Курьер .* будет
|
||
у вас в течение .*'') }}'
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state | regex_search(''В течение .* курьер
|
||
.* будет у вас'') }}'
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state | regex_search(''Курьер в пути. .*'')
|
||
}}'
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state | regex_search(''Курьер забрал заказ
|
||
и везёт его к вам'') }}'
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state | regex_search(''Везёт заказ из Маркет
|
||
Express'') }}'
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state | regex_search(''Уже спешит к вам'')
|
||
}}'
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state | regex_search(''Будет через *.'')
|
||
}}'
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state | regex_search(''Скоро заказ будет
|
||
у вас'') }}'
|
||
- condition: template
|
||
value_template: '{{ trigger.to_state.state | regex_search(''И уже спешит доставить
|
||
его вам'') }}'
|
||
actions:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.domofon_automatically_open_once
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
message: '_Домофон_: Курьер уже в пути, домофон откроется автоматически.'
|
||
inline_keyboard:
|
||
- Отключить звук:/domofon_mute_once
|
||
- alias: Domofon - Telegram Control - domofon_mute_once
|
||
id: 97093f78-f059-4918-b451-ca50f698a49d
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /domofon_mute_once
|
||
actions:
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.domofon_mute_sound_once
|
||
- action: telegram_bot.edit_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
message: '_Домофон_: Курьер уже в пути, домофон откроется автоматически.
|
||
|
||
Звонок домофона *отключен* (однократно).
|
||
|
||
'
|
||
- alias: Domofon - Open Once at Enter to Home Zone
|
||
id: 40d4a1f6-576c-438a-b20f-ba161d9bd3ee
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: zone
|
||
entity_id:
|
||
- person.alexander
|
||
- person.irina
|
||
zone: zone.domofon
|
||
event: enter
|
||
actions:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.domofon_automatically_open_once
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.domofon_mute_sound_once
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: '_Домофон_: включен режим однократного авто-открытия.'
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: binary_sensor.0x158d00031c790f_contact
|
||
to: 'on'
|
||
timeout: 00:10:00
|
||
- choose:
|
||
- conditions: '{{ is_state(''switch.domofon_automatically_open_once'', ''on'')
|
||
}}'
|
||
sequence:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.domofon_automatically_open_once
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.domofon_mute_sound_once
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: '_Домофон_: отключен режим однократного авто-открытия.'
|
||
- alias: Doorbell Ringing
|
||
id: 420fe43c-f00d-46b6-a787-032b0c58bd47
|
||
mode: single
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.doorbell_ringing
|
||
to: 'on'
|
||
actions:
|
||
- choose:
|
||
- alias: Mute On
|
||
conditions: '{{ is_state(''input_boolean.doorbell_mute'', ''on'') }}'
|
||
sequence:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.galaxy_tab_a_8_0_2019_screen
|
||
- action: button.press
|
||
target:
|
||
entity_id: button.galaxy_tab_a_8_0_2019_load_start_url
|
||
- action: telegram_bot.send_photo
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
url: secret reolinkcam_01_snapshot_url
|
||
verify_ssl: false
|
||
caption: '*Внимание*, в дверь звонят _(звонок отключен)_'
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
message: secret look_at_cam_reolinkcam_01
|
||
- action: media_player.play_media
|
||
target:
|
||
entity_id: media_player.yandex_station_mini2_gostinaia
|
||
data:
|
||
media_content_id: Внимание, в дверь звонят
|
||
media_content_type: text
|
||
extra:
|
||
volume_level: '{% set time = now().hour %}{% if time >= 21 or time < 9
|
||
%}0.5{% else %}0.7{% endif %}'
|
||
- alias: Mute Off
|
||
conditions: "{{\n is_state('input_boolean.doorbell_mute', 'off') and\n is_state('switch.sonoff_mini_r2_01_doorbell','off')\n\
|
||
}}\n"
|
||
sequence:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.sonoff_mini_r2_01_doorbell
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.galaxy_tab_a_8_0_2019_screen
|
||
- action: button.press
|
||
target:
|
||
entity_id: button.galaxy_tab_a_8_0_2019_load_start_url
|
||
- action: telegram_bot.send_photo
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
url: secret reolinkcam_01_snapshot_url
|
||
verify_ssl: false
|
||
caption: '*Внимание*, в дверь звонят'
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
message: secret look_at_cam_reolinkcam_01
|
||
- alias: Doorbell - Mute and UnMute by Time
|
||
id: 325f3e23-39b1-47f5-a415-e5da5e4845e3
|
||
triggers:
|
||
- trigger: time
|
||
at: '21:00:00'
|
||
id: turn_on
|
||
- trigger: time
|
||
at: 08:00:00
|
||
id: turn_off
|
||
actions:
|
||
choose:
|
||
- alias: Mute On
|
||
conditions:
|
||
- condition: trigger
|
||
id: turn_on
|
||
sequence:
|
||
- action: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.doorbell_mute
|
||
- alias: Mute Off
|
||
conditions:
|
||
- condition: trigger
|
||
id: turn_off
|
||
sequence:
|
||
- action: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.doorbell_mute
|
||
- alias: Energy - Apartment - Set Start Time of Tariffs
|
||
id: 7dc9e636-2951-407e-b50f-31d6b0b22961
|
||
triggers:
|
||
- trigger: time_pattern
|
||
hours: /1
|
||
minutes: '15'
|
||
conditions: '{{ not states(''sensor.mes_07762_153_47_account'') in (''unavailable'')
|
||
}}'
|
||
actions:
|
||
- action: input_datetime.set_datetime
|
||
target:
|
||
entity_id: input_datetime.apartment_enegry_start_time_peak_1
|
||
data:
|
||
time: '{% set time = (state_attr(''sensor.mes_07762_153_47_account'', ''zone_t1_description'')
|
||
| regex_findall_index(''^(\d+-\d+)'')).replace(''-'','':'') -%} {% if (time.split('':'')[0]
|
||
| int) < 10 %}0{{ time }}:00{% else %}{{ time }}:00{% endif %}
|
||
|
||
'
|
||
- action: input_datetime.set_datetime
|
||
target:
|
||
entity_id: input_datetime.apartment_enegry_start_time_peak_2
|
||
data:
|
||
time: '{% set time = (state_attr(''sensor.mes_07762_153_47_account'', ''zone_t1_description'')
|
||
| regex_findall_index('',.(\d+-\d+)'')).replace(''-'','':'') -%} {% if (time.split('':'')[0]
|
||
| int) < 10 -%}0{{ time }}:00{%- else -%}{{ time }}:00{% endif %}
|
||
|
||
'
|
||
- action: input_datetime.set_datetime
|
||
target:
|
||
entity_id: input_datetime.apartment_enegry_start_time_halfpeak_1
|
||
data:
|
||
time: '{% set time = (state_attr(''sensor.mes_07762_153_47_account'', ''zone_t3_description'')
|
||
| regex_findall_index(''^(\d+-\d+)'')).replace(''-'','':'') -%} {% if (time.split('':'')[0]
|
||
| int) < 10 %}0{{ time }}:00{% else %}{{ time }}:00{% endif %}
|
||
|
||
'
|
||
- action: input_datetime.set_datetime
|
||
target:
|
||
entity_id: input_datetime.apartment_enegry_start_time_halfpeak_2
|
||
data:
|
||
time: '{% set time = (state_attr(''sensor.mes_07762_153_47_account'', ''zone_t3_description'')
|
||
| regex_findall_index('',.(\d+-\d+)'')).replace(''-'','':'') -%} {% if (time.split('':'')[0]
|
||
| int) < 10 -%}0{{ time }}:00{%- else -%}{{ time }}:00{% endif %}
|
||
|
||
'
|
||
- action: input_datetime.set_datetime
|
||
target:
|
||
entity_id: input_datetime.apartment_enegry_start_time_night
|
||
data:
|
||
time: '{% set time = (state_attr(''sensor.mes_07762_153_47_account'', ''zone_t2_description'')
|
||
| regex_findall_index(''^(\d+-\d+)'')).replace(''-'','':'') -%} {% if (time.split('':'')[0]
|
||
| int) < 10 %}0{{ time }}:00{% else %}{{ time }}:00{% endif %}
|
||
|
||
'
|
||
- alias: Energy - Apartment - Set Current Tariff
|
||
id: 0266f51b-5a79-4c13-b925-f50952cc49ed
|
||
triggers:
|
||
- trigger: time
|
||
at:
|
||
- input_datetime.apartment_enegry_start_time_peak_1
|
||
- input_datetime.apartment_enegry_start_time_peak_2
|
||
id: peak
|
||
- trigger: time
|
||
at:
|
||
- input_datetime.apartment_enegry_start_time_halfpeak_1
|
||
- input_datetime.apartment_enegry_start_time_halfpeak_2
|
||
id: halfpeak
|
||
- trigger: time
|
||
at: input_datetime.apartment_enegry_start_time_night
|
||
id: night
|
||
actions:
|
||
choose:
|
||
- alias: Set Peak Tariff
|
||
conditions:
|
||
- condition: trigger
|
||
id: peak
|
||
sequence:
|
||
- action: input_number.set_value
|
||
target:
|
||
entity_id: input_number.apartment_enegry_cost_current
|
||
data:
|
||
value: '{{ states(''sensor.apartment_enegry_cost_peak'') | float(0) }}'
|
||
- action: select.select_option
|
||
target:
|
||
entity_id: group.all_energy_utility_meters
|
||
data:
|
||
option: peak
|
||
- alias: Set Halfpeak Tariff
|
||
conditions:
|
||
- condition: trigger
|
||
id: halfpeak
|
||
sequence:
|
||
- action: input_number.set_value
|
||
target:
|
||
entity_id: input_number.apartment_enegry_cost_current
|
||
data:
|
||
value: '{{ states(''sensor.apartment_enegry_cost_halfpeak'') | float(0)
|
||
}}'
|
||
- action: select.select_option
|
||
target:
|
||
entity_id: group.all_energy_utility_meters
|
||
data:
|
||
option: halfpeak
|
||
- alias: Set Night Tariff
|
||
conditions:
|
||
- condition: trigger
|
||
id: night
|
||
sequence:
|
||
- action: input_number.set_value
|
||
target:
|
||
entity_id: input_number.apartment_enegry_cost_current
|
||
data:
|
||
value: '{{ states(''sensor.apartment_enegry_cost_night'') | float(0) }}'
|
||
- action: select.select_option
|
||
target:
|
||
entity_id: group.all_energy_utility_meters
|
||
data:
|
||
option: night
|
||
- alias: RSS feed notifications
|
||
id: 7acc6aec-3319-44e8-bf1c-dc36109f1b89
|
||
mode: queued
|
||
max: 100
|
||
triggers:
|
||
trigger: event
|
||
event_type: feedreader
|
||
actions:
|
||
- choose:
|
||
- alias: Home Assistant News and Blog Posts
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ trigger.event.data.link | regex_search(''www.home-assistant.io'')
|
||
and (states(''sensor.ha_uptime'') | int) > 1 }}
|
||
|
||
'
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
disable_web_page_preview: true
|
||
parse_mode: html
|
||
title: '<i>INFO</i>:'
|
||
message: 'Новое пост на www.home-assistant.io:
|
||
|
||
<b>{{ trigger.event.data.title }}</b>
|
||
|
||
{{ trigger.event.data.link }}
|
||
|
||
'
|
||
- alias: Home Assistant Alerts
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ trigger.event.data.link | regex_search(''alerts.home-assistant.io'')
|
||
}}
|
||
|
||
'
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
disable_web_page_preview: true
|
||
parse_mode: html
|
||
title: <b>Внимание</b>
|
||
message: 'Новое сообщение на alerts.home-assistant.io:
|
||
|
||
<b>{{ trigger.event.data.title }}</b>
|
||
|
||
{{ trigger.event.data.link }}
|
||
|
||
'
|
||
- alias: MCHS Moscow Alerts
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ trigger.event.data.link | regex_search(''moscow.mchs.gov.ru'')
|
||
}}
|
||
|
||
'
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
title: <b>Внимание</b>
|
||
message: 'Новое оповещение от МЧС (Москва):
|
||
|
||
<b>{{ trigger.event.data.title }}</b>
|
||
|
||
{{ trigger.event.data.link }}'
|
||
- alias: GitHub HA Repo - Push config
|
||
id: 816f1400-5e51-4e5c-bc3a-f07e1e4202dd
|
||
mode: queued
|
||
max: 5
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: input_button.git_commint_and_push
|
||
id: button
|
||
- trigger: event
|
||
event_type: timer.finished
|
||
event_data:
|
||
entity_id: timer.git_time_to_push
|
||
id: timer_finished
|
||
- trigger: state
|
||
entity_id: input_boolean.git_autocommit
|
||
from: 'off'
|
||
to: 'on'
|
||
id: enable
|
||
- trigger: state
|
||
entity_id: sensor.git_number_of_modified_files
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
id: files
|
||
actions:
|
||
choose:
|
||
- conditions: '{{ trigger.id == ''button'' }}'
|
||
sequence:
|
||
- action: shell_command.git_commint_and_push
|
||
- action: homeassistant.update_entity
|
||
target:
|
||
entity_id: sensor.git_number_of_modified_files
|
||
- conditions: '{{ trigger.id == ''enable'' }}'
|
||
sequence:
|
||
- if:
|
||
- '{{ (states(''sensor.git_number_of_modified_files'') | int(0)) > 0 }}'
|
||
then:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.git_time_to_push
|
||
- conditions: '{{ trigger.id == ''timer_finished'' }}'
|
||
sequence:
|
||
- if:
|
||
- '{{ is_state(''input_boolean.git_autocommit'', ''on'') }}'
|
||
then:
|
||
- action: shell_command.git_commint_and_push
|
||
- action: homeassistant.update_entity
|
||
target:
|
||
entity_id: sensor.git_number_of_modified_files
|
||
else:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.git_time_to_push
|
||
- conditions: '{{ trigger.id == ''files'' }}'
|
||
sequence:
|
||
choose:
|
||
- conditions: '{{ (trigger.to_state.state | int(0)) == 0 }}'
|
||
sequence:
|
||
- action: timer.cancel
|
||
target:
|
||
entity_id: timer.git_time_to_push
|
||
- conditions: '{{ (trigger.to_state.state | int(0)) > (trigger.from_state.state
|
||
| int(0)) }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.git_time_to_push
|
||
- alias: GitHub HA Repo - Stars
|
||
id: b8a8f7d3-1875-4271-b576-1586f2ab425f
|
||
triggers:
|
||
- trigger: webhook
|
||
webhook_id: secret github_ha_repo_stars_webhook
|
||
local_only: false
|
||
allowed_methods:
|
||
- POST
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
parse_mode: html
|
||
disable_web_page_preview: true
|
||
title: '<b>GitHub HA Repo</b>:'
|
||
message: 'Star {{ trigger.json.action }}
|
||
|
||
https://github.com/avbor/HomeAssistantConfig/stargazers'
|
||
- alias: Smartmi Humidifier - Заданчивается вода
|
||
id: 992f84be-ee32-497c-833f-7ddc8eb574a4
|
||
triggers:
|
||
trigger: numeric_state
|
||
entity_id:
|
||
- sensor.smartmi_humidifier_01_detskaia_water_level
|
||
- sensor.smartmi_humidifier_02_spalnia_water_level
|
||
below: 15
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ (trigger.to_state.state | int) != 0 }}'
|
||
actions:
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: '{% if ''_01_'' in trigger.entity_id -%} *Smartmi Humidifier 01* (Детская):
|
||
заканчивается вода (осталось *{{ trigger.to_state.state }}*%)! {% elif ''_02_''
|
||
in trigger.entity_id -%} *Smartmi Humidifier 02* (Спальня): заканчивается
|
||
вода (осталось *{{ trigger.to_state.state }}*%)! {% endif -%}'
|
||
- alias: Smartmi Humidifier - Выключение по остатку воды
|
||
id: 41f9fd8c-50e9-43d3-8f1a-777705683f72
|
||
triggers:
|
||
trigger: numeric_state
|
||
entity_id:
|
||
- sensor.smartmi_humidifier_01_detskaia_water_level
|
||
- sensor.smartmi_humidifier_02_spalnia_water_level
|
||
below: 10
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ (trigger.to_state.state | int) != 0 }}'
|
||
actions:
|
||
- action: humidifier.turn_off
|
||
target:
|
||
entity_id: '{% if ''_01_'' in trigger.entity_id -%} humidifier.smartmi_humidifier_01_detskaia
|
||
{% elif ''_02_'' in trigger.entity_id -%} humidifier.smartmi_humidifier_02_spalnia
|
||
{% endif -%}'
|
||
- action: notify.telegram_group_system
|
||
data:
|
||
message: '{% if ''_01_'' in trigger.entity_id -%} *Smartmi Humidifier 01* (Детская):
|
||
выключен (остаток воды *{{ trigger.to_state.state }}*%)! {% elif ''_02_''
|
||
in trigger.entity_id -%} *Smartmi Humidifier 02* (Спальня): выключен (остаток
|
||
воды *{{ trigger.to_state.state }}*%)! {% endif -%}'
|
||
- alias: Smartmi Humidifier 01 - Выбор режима
|
||
id: dd7a9cd6-0161-4af7-9dce-3359e27dfb7c
|
||
triggers:
|
||
trigger: state
|
||
entity_id: input_select.smartmi_humidifier_01_detskaia_mode
|
||
actions:
|
||
action: script.set_smartmi_humidifier_mode
|
||
data:
|
||
humidifier_entity: humidifier.smartmi_humidifier_01_detskaia
|
||
humidifier_mode: '{{ trigger.to_state.state }}'
|
||
- alias: Smartmi Humidifier 01 - Mode Revers Sync
|
||
id: 8d2b93ea-d103-42e7-90bb-8ee4ca5c0648
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: sensor.smartmi_humidifier_01_detskaia_mode
|
||
to:
|
||
- Auto
|
||
- Silent
|
||
- Medium
|
||
- High
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
actions:
|
||
- if:
|
||
- '{{ states(''sensor.smartmi_humidifier_01_detskaia_mode'') != states(''input_select.smartmi_humidifier_01_detskaia_mode'')
|
||
}}'
|
||
then:
|
||
- action: input_select.select_option
|
||
target:
|
||
entity_id: input_select.smartmi_humidifier_01_detskaia_mode
|
||
data:
|
||
option: '{{ states(''sensor.smartmi_humidifier_01_detskaia_mode'') }}'
|
||
- alias: Увлажнение детской - Старт [время]
|
||
id: cb8d8af5-8a41-4ed8-a1c1-05b4a823fcdd
|
||
triggers:
|
||
trigger: time
|
||
at: '20:00:00'
|
||
conditions:
|
||
- condition: state
|
||
entity_id: humidifier.smartmi_humidifier_01_detskaia
|
||
state: 'off'
|
||
- condition: numeric_state
|
||
entity_id: sensor.humidity_in_nursery
|
||
below: input_number.target_humidity_01_detskaia
|
||
- condition: numeric_state
|
||
entity_id: sensor.smartmi_humidifier_01_detskaia_water_level
|
||
above: 25
|
||
actions:
|
||
action: humidifier.turn_on
|
||
target:
|
||
entity_id: humidifier.smartmi_humidifier_01_detskaia
|
||
- alias: Увлажнение детской - Стоп [время]
|
||
id: e2a3cd54-5f73-4e8c-b110-483c2f6be654
|
||
triggers:
|
||
trigger: time
|
||
at: 07:00:00
|
||
conditions:
|
||
- condition: state
|
||
entity_id: humidifier.smartmi_humidifier_01_detskaia
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: input_boolean.smartmi_humidifier_01_detskaia_autocontrol
|
||
state: 'off'
|
||
actions:
|
||
action: humidifier.turn_off
|
||
target:
|
||
entity_id: humidifier.smartmi_humidifier_01_detskaia
|
||
- alias: Увлажнение детской - Старт [Влажность]
|
||
id: c948d3e9-40c8-48f8-a8d8-dba65319d61b
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- sensor.humidity_in_nursery
|
||
- input_number.target_humidity_01_detskaia
|
||
- input_boolean.smartmi_humidifier_01_detskaia_autocontrol
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.smartmi_humidifier_01_detskaia_autocontrol
|
||
state: 'on'
|
||
- condition: template
|
||
value_template: '{{ (states(''sensor.humidity_in_nursery'') | round(0)) < (states(''input_number.target_humidity_01_detskaia'')
|
||
| int) }}
|
||
|
||
'
|
||
- condition: state
|
||
entity_id: humidifier.smartmi_humidifier_01_detskaia
|
||
state: 'off'
|
||
- condition: numeric_state
|
||
entity_id: sensor.smartmi_humidifier_01_detskaia_water_level
|
||
above: 15
|
||
actions:
|
||
- action: humidifier.turn_on
|
||
target:
|
||
entity_id: humidifier.smartmi_humidifier_01_detskaia
|
||
- alias: Увлажнение детской - Стоп [Влажность]
|
||
id: ce34b5e0-d1d9-45b0-8a66-65eb392383ec
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- sensor.humidity_in_nursery
|
||
- input_number.target_humidity_01_detskaia
|
||
- input_boolean.smartmi_humidifier_01_detskaia_autocontrol
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.smartmi_humidifier_01_detskaia_autocontrol
|
||
state: 'on'
|
||
- condition: template
|
||
value_template: '{{ (states(''sensor.humidity_in_nursery'') | round(0)) >= (states(''input_number.target_humidity_01_detskaia'')
|
||
| int) }}
|
||
|
||
'
|
||
- condition: state
|
||
entity_id: humidifier.smartmi_humidifier_01_detskaia
|
||
state: 'on'
|
||
actions:
|
||
- action: humidifier.turn_off
|
||
target:
|
||
entity_id: humidifier.smartmi_humidifier_01_detskaia
|
||
- alias: Smartmi Humidifier 02 - Выбор режима
|
||
id: 23a943a3-9594-4392-bdb4-468eccc9a50b
|
||
triggers:
|
||
trigger: state
|
||
entity_id: input_select.smartmi_humidifier_02_spalnia_mode
|
||
actions:
|
||
action: script.set_smartmi_humidifier_mode
|
||
data:
|
||
humidifier_entity: humidifier.smartmi_humidifier_02_spalnia
|
||
humidifier_mode: '{{ trigger.to_state.state }}'
|
||
- alias: Smartmi Humidifier 02 - Mode Revers Sync
|
||
id: 501ee548-817e-4210-af88-dcbbd2d4d2de
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: sensor.smartmi_humidifier_02_spalnia_mode
|
||
to:
|
||
- Auto
|
||
- Silent
|
||
- Medium
|
||
- High
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
actions:
|
||
- if:
|
||
- '{{ states(''sensor.smartmi_humidifier_02_spalnia_mode'') != states(''input_select.smartmi_humidifier_02_spalnia_mode'')
|
||
}}'
|
||
then:
|
||
- action: input_select.select_option
|
||
target:
|
||
entity_id: input_select.smartmi_humidifier_02_spalnia_mode
|
||
data:
|
||
option: '{{ states(''sensor.smartmi_humidifier_02_spalnia_mode'') }}'
|
||
- alias: Увлажнение спальни - Старт [Влажность]
|
||
id: a9f8c4d8-7b10-4128-8411-1aa68a330760
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- sensor.humidity_in_bedroom
|
||
- input_number.target_humidity_02_spalnia
|
||
- input_boolean.smartmi_humidifier_02_spalnia_autocontrol
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.smartmi_humidifier_02_spalnia_autocontrol
|
||
state: 'on'
|
||
- condition: template
|
||
value_template: '{{ (states(''sensor.humidity_in_bedroom'') | round(0)) < (states(''input_number.target_humidity_02_spalnia'')
|
||
| int) }}
|
||
|
||
'
|
||
- condition: state
|
||
entity_id: humidifier.smartmi_humidifier_02_spalnia
|
||
state: 'off'
|
||
- condition: numeric_state
|
||
entity_id: sensor.smartmi_humidifier_02_spalnia_water_level
|
||
above: 15
|
||
actions:
|
||
- action: humidifier.turn_on
|
||
target:
|
||
entity_id: humidifier.smartmi_humidifier_02_spalnia
|
||
- alias: Увлажнение спальни - Стоп [Влажность]
|
||
id: ec2f9de0-dacb-4a84-b0c9-0b5eb8e2b4f9
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- sensor.humidity_in_bedroom
|
||
- input_number.target_humidity_02_spalnia
|
||
- input_boolean.smartmi_humidifier_02_spalnia_autocontrol
|
||
conditions:
|
||
- condition: state
|
||
entity_id: input_boolean.smartmi_humidifier_02_spalnia_autocontrol
|
||
state: 'on'
|
||
- condition: template
|
||
value_template: '{{ (states(''sensor.humidity_in_bedroom'') | round(0)) >= (states(''input_number.target_humidity_02_spalnia'')
|
||
| int) }}
|
||
|
||
'
|
||
- condition: state
|
||
entity_id: humidifier.smartmi_humidifier_02_spalnia
|
||
state: 'on'
|
||
actions:
|
||
- action: humidifier.turn_off
|
||
target:
|
||
entity_id: humidifier.smartmi_humidifier_02_spalnia
|
||
- alias: Kitchen Covers Control by Light
|
||
id: 24f83b60-8392-4278-8725-6d1a33a0a483
|
||
triggers:
|
||
- trigger: numeric_state
|
||
entity_id: sensor.outdoor_illuminance
|
||
below: input_number.kitchen_covers_illuminance_threshold
|
||
for: 00:10:00
|
||
id: dark
|
||
- trigger: numeric_state
|
||
entity_id: sensor.outdoor_illuminance
|
||
above: input_number.kitchen_covers_illuminance_threshold
|
||
for: 00:10:00
|
||
id: lightly
|
||
conditions: '{{ is_state(''input_boolean.kitchen_covers_auto'', ''on'') }}'
|
||
actions:
|
||
choose:
|
||
- alias: Darkens (Close)
|
||
conditions:
|
||
- condition: trigger
|
||
id: dark
|
||
sequence:
|
||
- condition: '{{ states(''cover.kitchen_covers'') in [''open'', ''opening'']
|
||
}}'
|
||
- action: cover.close_cover
|
||
target:
|
||
entity_id: cover.kitchen_covers
|
||
- alias: Brightens (Open)
|
||
conditions:
|
||
- condition: trigger
|
||
id: lightly
|
||
sequence:
|
||
- condition: '{{ states(''cover.kitchen_covers'') in [''closed'', ''closing'']
|
||
}}'
|
||
- action: cover.open_cover
|
||
target:
|
||
entity_id: cover.kitchen_covers
|
||
- alias: Kitchen Covers Control by IKEA Switch
|
||
id: def20597-6652-43e3-836c-6a1e191967d3
|
||
mode: queued
|
||
max: 5
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 50:32:5f:ff:fe:70:d7:69
|
||
id: ikea_sw_5
|
||
actions:
|
||
choose:
|
||
- alias: 'command: on or move_with_on_off'
|
||
conditions: '{{ trigger.event.data.command in (''on'', ''move_with_on_off'')
|
||
}}'
|
||
sequence:
|
||
- action: cover.open_cover
|
||
target:
|
||
entity_id: cover.kitchen_covers
|
||
- alias: 'command: off or move'
|
||
conditions: '{{ trigger.event.data.command in (''off'', ''move'') }}'
|
||
sequence:
|
||
- action: cover.close_cover
|
||
target:
|
||
entity_id: cover.kitchen_covers
|
||
- alias: 'command: stop'
|
||
conditions: '{{ trigger.event.data.command == ''stop'' }}'
|
||
sequence:
|
||
- action: cover.stop_cover
|
||
target:
|
||
entity_id: cover.kitchen_covers
|
||
- alias: Свет в Ванной
|
||
id: 9a24416b-82b6-4fa8-81a7-ea6c71daa727
|
||
mode: queued
|
||
max: 10
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: timer.bathroom_presence
|
||
to: idle
|
||
id: timer_idle
|
||
- trigger: state
|
||
entity_id: binary_sensor.lumi_lumi_sensor_magnet_on_off
|
||
id: magnet
|
||
- trigger: state
|
||
entity_id: binary_sensor.trust_iaszone
|
||
to: 'on'
|
||
id: motion_on
|
||
- trigger: state
|
||
entity_id: binary_sensor.0xa4c138792ba1d268_presence
|
||
to: 'on'
|
||
id: presence_on
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:03:d1:77:62
|
||
command: click
|
||
id: click
|
||
actions:
|
||
choose:
|
||
- alias: Timer Idle
|
||
conditions:
|
||
- condition: trigger
|
||
id: timer_idle
|
||
sequence:
|
||
choose:
|
||
- alias: Presence On
|
||
conditions: '{{ states(''binary_sensor.0xa4c138792ba1d268_presence'') ==
|
||
''on'' }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.bathroom_presence
|
||
- alias: Motion On
|
||
conditions: '{{ states(''binary_sensor.trust_iaszone'') == ''on'' }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.bathroom_presence
|
||
- alias: Motion Off
|
||
conditions: '{{ states(''binary_sensor.trust_iaszone'') == ''off'' }}'
|
||
sequence:
|
||
choose:
|
||
- alias: Motion detected > 5 min ago
|
||
conditions: '{{ (as_timestamp(now()) - as_timestamp(states.binary_sensor.trust_iaszone.last_changed))
|
||
> 300 }}'
|
||
sequence:
|
||
- parallel:
|
||
- sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_04_on_off'', ''on'')
|
||
}}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_zbmini_04_on_off
|
||
- sequence:
|
||
- condition: '{{ is_state(''fan.bathroom_extractor'', ''on'') }}'
|
||
- condition: '{{ is_state(''binary_sensor.bathroom_high_humidity'',
|
||
''off'') }}'
|
||
- action: fan.turn_off
|
||
target:
|
||
entity_id: fan.bathroom_extractor
|
||
- alias: Motion detected <= 5 min ago
|
||
conditions: '{{ (as_timestamp(now()) - as_timestamp(states.binary_sensor.trust_iaszone.last_changed))
|
||
<= 300 }}'
|
||
sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_04_on_off'', ''on'')
|
||
}}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_zbmini_04_on_off
|
||
- delay:
|
||
seconds: 0.3
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_zbmini_04_on_off
|
||
- wait_template: '{{ is_state(''binary_sensor.trust_iaszone'', ''on'')
|
||
}}'
|
||
timeout: 00:01:00
|
||
- if:
|
||
- '{{ not wait.completed }}'
|
||
then:
|
||
- parallel:
|
||
- sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_04_on_off'', ''on'')
|
||
}}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_zbmini_04_on_off
|
||
- sequence:
|
||
- condition: '{{ is_state(''fan.bathroom_extractor'', ''on'')
|
||
}}'
|
||
- condition: '{{ is_state(''binary_sensor.bathroom_high_humidity'',
|
||
''off'') }}'
|
||
- action: fan.turn_off
|
||
target:
|
||
entity_id: fan.bathroom_extractor
|
||
- alias: Magnet
|
||
conditions:
|
||
- condition: trigger
|
||
id: magnet
|
||
sequence:
|
||
choose:
|
||
- alias: To On
|
||
conditions: '{{ trigger.from_state.state == ''off'' and trigger.to_state.state
|
||
== ''on'' }}'
|
||
sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_04_on_off'', ''off'') }}'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_zbmini_04_on_off
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.bathroom_presence
|
||
- alias: To Off
|
||
conditions: '{{ trigger.from_state.state == ''on'' and trigger.to_state.state
|
||
== ''off'' }}'
|
||
sequence:
|
||
- parallel:
|
||
- sequence:
|
||
- condition: '{{ is_state(''binary_sensor.trust_iaszone'', ''off'')
|
||
}}'
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_04_on_off'', ''on'')
|
||
}}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_zbmini_04_on_off
|
||
- sequence:
|
||
- condition: '{{ is_state(''fan.bathroom_extractor'', ''on'') }}'
|
||
- condition: '{{ is_state(''binary_sensor.bathroom_high_humidity'',
|
||
''off'') }}'
|
||
- condition: '{{ is_state(''binary_sensor.trust_iaszone'', ''off'')
|
||
}}'
|
||
- action: fan.turn_off
|
||
target:
|
||
entity_id: fan.bathroom_extractor
|
||
- alias: Presence
|
||
conditions:
|
||
- condition: trigger
|
||
id: presence_on
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.bathroom_presence
|
||
- alias: Motion
|
||
conditions:
|
||
- condition: trigger
|
||
id: motion_on
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.bathroom_presence
|
||
- parallel:
|
||
- sequence:
|
||
- condition: '{{ is_state(''fan.bathroom_extractor'', ''off'') }}'
|
||
- action: fan.turn_on
|
||
target:
|
||
entity_id: fan.bathroom_extractor
|
||
- sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_04_on_off'', ''off'') }}'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_zbmini_04_on_off
|
||
- alias: Button
|
||
conditions:
|
||
- condition: trigger
|
||
id: click
|
||
sequence:
|
||
choose:
|
||
- alias: Single click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''single'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
data:
|
||
entity_id: light.sonoff_zbmini_04_on_off
|
||
- delay: 00:00:02
|
||
- choose:
|
||
- alias: Light On
|
||
conditions: '{{ is_state(''light.sonoff_zbmini_04_on_off'', ''on'')
|
||
}}'
|
||
sequence:
|
||
- action: fan.turn_on
|
||
target:
|
||
entity_id: fan.bathroom_extractor
|
||
- alias: Light Off
|
||
conditions: '{{ is_state(''light.sonoff_zbmini_04_on_off'', ''off'')
|
||
}}'
|
||
sequence:
|
||
- condition: '{{ is_state(''binary_sensor.bathroom_high_humidity'',
|
||
''off'') }}'
|
||
- action: fan.turn_off
|
||
target:
|
||
entity_id: fan.bathroom_extractor
|
||
- alias: Double click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''double'' }}'
|
||
sequence:
|
||
- action: fan.toggle
|
||
target:
|
||
entity_id: fan.bathroom_extractor
|
||
- alias: Ванная - вытяжка
|
||
id: 9c4552b3-11ee-4364-bf40-2b142c5f97e6
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.bathroom_high_humidity
|
||
to: 'on'
|
||
for:
|
||
minutes: 3
|
||
id: high_humidity
|
||
- trigger: state
|
||
entity_id: binary_sensor.bathroom_high_humidity
|
||
to: 'off'
|
||
for:
|
||
minutes: 10
|
||
id: normal_humidity
|
||
actions:
|
||
choose:
|
||
- alias: High humidity
|
||
conditions:
|
||
- condition: trigger
|
||
id: high_humidity
|
||
sequence:
|
||
- condition: '{{ is_state(''fan.bathroom_extractor'', ''off'') }}'
|
||
- action: fan.turn_on
|
||
target:
|
||
entity_id: fan.bathroom_extractor
|
||
- alias: Normal humidity
|
||
conditions:
|
||
- condition: trigger
|
||
id: normal_humidity
|
||
sequence:
|
||
- condition: '{{ is_state(''fan.bathroom_extractor'', ''on'') }}'
|
||
- action: fan.turn_off
|
||
target:
|
||
entity_id: fan.bathroom_extractor
|
||
- alias: Кнопки IKEA в Спальне
|
||
id: ffd8dce9-55d7-449c-a5ed-280604c00930
|
||
triggers:
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 84:fd:27:ff:fe:90:a6:46
|
||
id: ikea_sw_1
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 84:fd:27:ff:fe:9e:e4:06
|
||
id: ikea_sw_2
|
||
actions:
|
||
choose:
|
||
- alias: 'command: on'
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''on'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.sonoff_1001053235
|
||
- alias: 'command: off'
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''off'' }}'
|
||
sequence:
|
||
choose:
|
||
- alias: If Group is On
|
||
conditions:
|
||
- condition: state
|
||
entity_id: group.light_spalnia_bra
|
||
state: 'on'
|
||
sequence:
|
||
- action: homeassistant.turn_off
|
||
target:
|
||
entity_id: group.light_spalnia_bra
|
||
- alias: If Group is Off
|
||
conditions:
|
||
- condition: state
|
||
entity_id: group.light_spalnia_bra
|
||
state: 'off'
|
||
sequence:
|
||
- action: homeassistant.turn_on
|
||
target:
|
||
entity_id: group.light_spalnia_bra
|
||
- alias: 'command: move_with_on_off'
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''move_with_on_off'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.spalnia_stol
|
||
- alias: 'command: move'
|
||
conditions:
|
||
- condition: template
|
||
value_template: '{{ trigger.event.data.command == ''move'' }}'
|
||
sequence:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: group.all_lamps
|
||
- alias: Sunrise Lighting (Bedroom)
|
||
id: 35fa00c7-72bd-4a5f-9bef-7bcf13a3bf49
|
||
triggers:
|
||
- trigger: time
|
||
at: input_datetime.sunrise_in_bedroom
|
||
condition:
|
||
- and:
|
||
- condition: state
|
||
entity_id: binary_sensor.workday_sensor
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: calendar.semia_alexander_borisov_vacation
|
||
state: 'off'
|
||
- condition: sun
|
||
before: sunrise
|
||
before_offset: 00:30:00
|
||
actions:
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.sunrise_in_bedroom_left
|
||
- alias: Wait for OnePlus presence at livingroom
|
||
wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: binary_sensor.living_room_oneplus_8t_presence
|
||
from: 'off'
|
||
to: 'on'
|
||
for: 00:03:00
|
||
timeout: 00:30:00
|
||
- parallel:
|
||
- if:
|
||
- '{{ is_state(''script.sunrise_in_bedroom_left'', ''on'') }}'
|
||
then:
|
||
- action: script.turn_off
|
||
target:
|
||
entity_id: script.sunrise_in_bedroom_left
|
||
- if:
|
||
- '{{ is_state(''light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2'',
|
||
''on'') }}'
|
||
then:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2
|
||
- alias: Turn Off All Light When Nobody at Home
|
||
id: b06cbc8a-6488-412b-8842-e6c72b004ff1
|
||
triggers:
|
||
trigger: state
|
||
entity_id: group.family_persons
|
||
to: not_home
|
||
for:
|
||
minutes: 5
|
||
conditions:
|
||
- condition: state
|
||
entity_id: group.all_lamps
|
||
state: 'on'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: 'Дома никого нет, но остался включенным свет:
|
||
|
||
{{ ((expand(''group.all_lamps'') | selectattr(''state'', ''eq'', ''on'') |
|
||
map(attribute=''name'') | list)) | replace("''","") | replace(", ", "\n")
|
||
}}
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Выключить свет:/turn_off_all_lamps
|
||
- alias: Light - Telegram Control - Turn Off All Lamps
|
||
id: a395b9eb-6a18-40bd-a7f4-6e3f133049ba
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /turn_off_all_lamps
|
||
actions:
|
||
- action: homeassistant.turn_off
|
||
target:
|
||
entity_id: group.all_lamps
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_replymarkup
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
inline_keyboard: []
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
message: Свет выключен.
|
||
- alias: Кнопка Xiaomi в Коридоре
|
||
id: 69f5d88e-f0b9-4f31-9951-fe9f7bd60906
|
||
mode: queued
|
||
max: 5
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:04:5a:11:53
|
||
command: click
|
||
id: click
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:04:5a:11:53
|
||
command: hold
|
||
id: hold
|
||
actions:
|
||
choose:
|
||
- alias: Action Click
|
||
conditions:
|
||
- condition: trigger
|
||
id: click
|
||
sequence:
|
||
choose:
|
||
- alias: Single click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''single'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.sonoff_1000f2a500
|
||
- alias: Double click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''double'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.sonoff_1000f2f14a
|
||
- alias: Action Hold
|
||
conditions:
|
||
- condition: trigger
|
||
id: hold
|
||
sequence:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id:
|
||
- group.light_detskaia
|
||
- group.light_prikhozhaya
|
||
- group.light_koridor
|
||
- group.light_gostinaia
|
||
- group.light_kukhnia
|
||
- group.light_kladovaya
|
||
- alias: Свет в Прихожей
|
||
id: b564ba72-9799-4438-b7c0-2a72a61a864c
|
||
mode: queued
|
||
max: 5
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: timer.hallway_light
|
||
id: timer
|
||
- trigger: state
|
||
entity_id: binary_sensor.0x158d00031c790f_contact
|
||
id: magnet
|
||
- trigger: state
|
||
entity_id: binary_sensor.0x158d000309920a_motion
|
||
id: motion
|
||
action:
|
||
choose:
|
||
- alias: Timer
|
||
conditions:
|
||
- condition: trigger
|
||
id: timer
|
||
sequence:
|
||
choose:
|
||
- alias: To Off
|
||
conditions: '{{ trigger.to_state.state == ''idle'' }}'
|
||
sequence:
|
||
choose:
|
||
- alias: Frigate Presence On
|
||
conditions: '{{ states(''binary_sensor.dafangcam_02_person_occupancy'')
|
||
== ''on'' }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.hallway_light
|
||
- alias: Motion On
|
||
conditions: '{{ states(''binary_sensor.0x158d000309920a_motion'') ==
|
||
''on'' }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.hallway_light
|
||
- alias: Motion Off
|
||
conditions: '{{ states(''binary_sensor.0x158d000309920a_motion'') ==
|
||
''off'' }}'
|
||
sequence:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_1000f2f14a
|
||
- alias: Magnet
|
||
conditions:
|
||
- condition: trigger
|
||
id: magnet
|
||
sequence:
|
||
choose:
|
||
- alias: To On
|
||
conditions: '{{ trigger.from_state.state == ''off'' and trigger.to_state.state
|
||
== ''on'' }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_1000f2f14a
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.hallway_light
|
||
- alias: Motion
|
||
conditions:
|
||
- condition: trigger
|
||
id: motion
|
||
sequence:
|
||
choose:
|
||
- alias: To On
|
||
conditions: '{{ trigger.to_state.state == ''on'' }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.hallway_light
|
||
- condition: state
|
||
entity_id: light.sonoff_1000f2f14a
|
||
state: 'off'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_1000f2f14a
|
||
- alias: To Off
|
||
conditions: '{{ trigger.to_state.state == ''off'' }}'
|
||
sequence:
|
||
- action: timer.finish
|
||
target:
|
||
entity_id: timer.hallway_light
|
||
- alias: Кнопка Xiaomi в Прихожей
|
||
id: c8299171-1d2a-428f-8f5f-d24d28e82b48
|
||
mode: queued
|
||
max: 5
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:04:5a:11:b1
|
||
command: click
|
||
id: click
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:04:5a:11:b1
|
||
command: hold
|
||
id: hold
|
||
actions:
|
||
choose:
|
||
- alias: Action Click
|
||
conditions:
|
||
- condition: trigger
|
||
id: click
|
||
sequence:
|
||
choose:
|
||
- alias: Single click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''single'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.sonoff_1000f2f14a
|
||
- alias: Double click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''double'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.sonoff_1000f2a500
|
||
- alias: Action Hold
|
||
conditions:
|
||
- condition: trigger
|
||
id: hold
|
||
sequence:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: group.all_lamps
|
||
- alias: Кнопка Xiaomi на Кухне
|
||
id: 3dd87840-2d90-4823-a4af-844395be2a2a
|
||
mode: queued
|
||
max: 5
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:03:5f:f6:31
|
||
command: click
|
||
id: click
|
||
actions:
|
||
choose:
|
||
- alias: Action Click
|
||
conditions:
|
||
- condition: trigger
|
||
id: click
|
||
sequence:
|
||
choose:
|
||
- alias: Single click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''single'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.kukhnia_lenta
|
||
- alias: Double click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''double'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.ikea_e27_kukhnia
|
||
- alias: Подсветка на кухне (сенсор движения - вкл)
|
||
id: 72c4f7ac-f72c-47fd-bf06-6e3671d12b1d
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.0x158d0003fac0ec_motion
|
||
to: 'on'
|
||
conditions:
|
||
- condition: numeric_state
|
||
entity_id: sensor.0x158d0003fac0ec_illuminance
|
||
below: 10
|
||
actions:
|
||
action: light.turn_on
|
||
target:
|
||
entity_id: light.kukhnia_lenta
|
||
- alias: Подсветка на кухне (сенсор движения - выкл)
|
||
id: 47413029-b8c2-4ec1-ad98-7c72b271766d
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.0x158d0003fac0ec_motion
|
||
to: 'off'
|
||
for:
|
||
minutes: 3
|
||
actions:
|
||
action: light.turn_off
|
||
target:
|
||
entity_id: light.kukhnia_lenta
|
||
- alias: Кнопка Xiaomi в Гостиной
|
||
id: 20b084dc-0393-44e3-897d-3cec019647a1
|
||
mode: queued
|
||
max: 5
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:03:5a:9b:c5
|
||
command: click
|
||
id: click
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:03:5a:9b:c5
|
||
command: hold
|
||
id: hold
|
||
actions:
|
||
choose:
|
||
- alias: Action Click
|
||
conditions:
|
||
- condition: trigger
|
||
id: click
|
||
sequence:
|
||
choose:
|
||
- alias: Single click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''single'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.sonoff_1000ab3c28
|
||
- alias: Double click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''double'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.sonoff_1000f3035d
|
||
- alias: Action Hold
|
||
conditions:
|
||
- condition: trigger
|
||
id: hold
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.gostinaia_podsvetka_na_okne
|
||
- alias: Подсветка на окне в Гостиной
|
||
id: 32c18d2f-1d01-4458-b5e2-05048b73a3d7
|
||
triggers:
|
||
- trigger: numeric_state
|
||
entity_id: sensor.outdoor_illuminance
|
||
below: input_number.livingroom_window_light_illuminance_threshold
|
||
for: 00:10:00
|
||
id: dark
|
||
- trigger: numeric_state
|
||
entity_id: sensor.outdoor_illuminance
|
||
above: input_number.livingroom_window_light_illuminance_threshold
|
||
for: 00:10:00
|
||
id: lightly
|
||
- trigger: time
|
||
at: 00:30:00
|
||
id: time
|
||
- trigger: state
|
||
entity_id: group.family_persons
|
||
from: not_home
|
||
to: home
|
||
id: to_home
|
||
conditions: '{{ is_state(''input_boolean.livingroom_window_light_auto'', ''on'')
|
||
}}'
|
||
actions:
|
||
choose:
|
||
- alias: Darkens (Turn On)
|
||
conditions:
|
||
- condition: trigger
|
||
id: dark
|
||
sequence:
|
||
- condition: state
|
||
entity_id: light.gostinaia_podsvetka_na_okne
|
||
state: 'off'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.gostinaia_podsvetka_na_okne
|
||
- alias: Brightens (Turn Off)
|
||
conditions:
|
||
- or:
|
||
- condition: trigger
|
||
id: lightly
|
||
- condition: trigger
|
||
id: time
|
||
sequence:
|
||
- condition: state
|
||
entity_id: light.gostinaia_podsvetka_na_okne
|
||
state: 'on'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.gostinaia_podsvetka_na_okne
|
||
- alias: Came Home
|
||
conditions:
|
||
- and:
|
||
- condition: trigger
|
||
id: to_home
|
||
- condition: numeric_state
|
||
entity_id: sensor.outdoor_illuminance
|
||
below: input_number.livingroom_window_light_illuminance_threshold
|
||
sequence:
|
||
- condition: state
|
||
entity_id: light.gostinaia_podsvetka_na_okne
|
||
state: 'off'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.gostinaia_podsvetka_na_okne
|
||
- alias: Пульт IKEA в Гостиной
|
||
id: 94f03734-3e9f-47cd-80c6-af9f37236974
|
||
mode: restart
|
||
triggers:
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: d0:cf:5e:ff:fe:33:93:f6
|
||
actions:
|
||
- alias: Set variables
|
||
variables:
|
||
target_lamp: light.ikea_e27_level_light_color_on_off
|
||
- choose:
|
||
- alias: toggle
|
||
conditions: '{{ trigger.event.data.command == ''toggle'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: '{{ target_lamp }}'
|
||
- alias: step_with_on_off
|
||
conditions: '{{ trigger.event.data.command == ''step_with_on_off'' }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: '{{ target_lamp }}'
|
||
data:
|
||
brightness_step: 8
|
||
- alias: move_with_on_off
|
||
conditions: '{{ trigger.event.data.command == ''move_with_on_off'' }}'
|
||
sequence:
|
||
repeat:
|
||
until: '{{ wait.trigger is not none }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: '{{ target_lamp }}'
|
||
data:
|
||
brightness_step: 8
|
||
- wait_for_trigger:
|
||
trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: '{{ trigger.event.data.device_ieee }}'
|
||
command: stop
|
||
timeout:
|
||
milliseconds: 200
|
||
- alias: step
|
||
conditions: '{{ trigger.event.data.command == ''step'' }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: '{{ target_lamp }}'
|
||
data:
|
||
brightness_step: -8
|
||
- alias: move
|
||
conditions: '{{ trigger.event.data.command == ''move'' }}'
|
||
sequence:
|
||
repeat:
|
||
until: '{{ wait.trigger is not none }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: '{{ target_lamp }}'
|
||
data:
|
||
brightness_step: -8
|
||
- wait_for_trigger:
|
||
trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: '{{ trigger.event.data.device_ieee }}'
|
||
command: stop
|
||
timeout:
|
||
milliseconds: 200
|
||
- alias: press
|
||
conditions: '{{ trigger.event.data.command == ''press'' }}'
|
||
sequence:
|
||
choose:
|
||
- alias: left button
|
||
conditions: '{{ (trigger.event.data.args[0] | int(0)) == 257 }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: '{{ target_lamp }}'
|
||
data:
|
||
color_temp: '{% set color_t = (state_attr(target_lamp, ''color_temp'')
|
||
| int(0)) %} {{ iif ((color_t - 10) > 172, color_t - 10, 172) }}'
|
||
- alias: right button
|
||
conditions: '{{ (trigger.event.data.args[0] | int(0)) == 256 }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: '{{ target_lamp }}'
|
||
data:
|
||
color_temp: '{% set color_t = (state_attr(target_lamp, ''color_temp'')
|
||
| int(0)) %} {{ iif ((color_t + 10 ) < 454, color_t + 10, 454) }}'
|
||
- alias: hold
|
||
conditions: '{{ trigger.event.data.command == ''hold'' }}'
|
||
sequence:
|
||
choose:
|
||
- alias: left button
|
||
conditions: '{{ (trigger.event.data.args[0] | int(0)) == 3329 }}'
|
||
sequence:
|
||
repeat:
|
||
until: '{{ wait.trigger is not none }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: '{{ target_lamp }}'
|
||
data:
|
||
color_temp: '{% set color_t = (state_attr(target_lamp, ''color_temp'')
|
||
| int(0)) %} {{ iif ((color_t - 10) > 172, color_t - 10, 172)
|
||
}}'
|
||
- wait_for_trigger:
|
||
trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: '{{ trigger.event.data.device_ieee }}'
|
||
command: release
|
||
timeout:
|
||
milliseconds: 200
|
||
- alias: right button
|
||
conditions: '{{ (trigger.event.data.args[0] | int(0)) == 3328 }}'
|
||
sequence:
|
||
repeat:
|
||
until: '{{ wait.trigger is not none }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: '{{ target_lamp }}'
|
||
data:
|
||
color_temp: '{% set color_t = (state_attr(target_lamp, ''color_temp'')
|
||
| int(0)) %} {{ iif ((color_t + 10) < 454, color_t + 10, 454)
|
||
}}'
|
||
- wait_for_trigger:
|
||
trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: '{{ trigger.event.data.device_ieee }}'
|
||
command: release
|
||
timeout:
|
||
milliseconds: 200
|
||
- alias: Кнопка Xiaomi в Детской
|
||
id: b1b33068-e33a-4955-94a0-80bc3b8f61fd
|
||
mode: queued
|
||
max: 5
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:03:3e:fd:9e
|
||
command: click
|
||
id: click
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:03:3e:fd:9e
|
||
command: hold
|
||
id: hold
|
||
actions:
|
||
choose:
|
||
- alias: Action Click
|
||
conditions:
|
||
- condition: trigger
|
||
id: click
|
||
sequence:
|
||
choose:
|
||
- alias: Single click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''single'' }}'
|
||
sequence:
|
||
choose:
|
||
- alias: Bulb unavailable
|
||
conditions: '{{ is_state(''light.ikea_e27_detskaia'', ''unavailable'')
|
||
}}'
|
||
sequence:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_zbmini_01_on_off
|
||
- delay: 00:00:01
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_zbmini_01_on_off
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: light.ikea_e27_detskaia
|
||
to: 'on'
|
||
timeout: 00:00:30
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.ikea_e27_detskaia
|
||
data:
|
||
brightness: 255
|
||
- alias: Relay off
|
||
conditions: '{{ is_state(''light.sonoff_zbmini_01_on_off'', ''off'')
|
||
}}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_zbmini_01_on_off
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: light.ikea_e27_detskaia
|
||
to: 'on'
|
||
timeout: 00:00:30
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.ikea_e27_detskaia
|
||
data:
|
||
brightness: 255
|
||
- alias: Relay on
|
||
conditions: '{{ is_state(''light.sonoff_zbmini_01_on_off'', ''on'')
|
||
}}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.ikea_e27_detskaia
|
||
- alias: Double click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''double'' }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.ikea_e27_detskaia
|
||
data:
|
||
transition: '0.5'
|
||
brightness: "{%- if (state_attr('light.ikea_e27_detskaia', 'brightness')\
|
||
\ | int(0)) <= 3 %}\n 51\n{% elif (state_attr('light.ikea_e27_detskaia',\
|
||
\ 'brightness') | int(0)) <= 51 %}\n 102\n{% elif (state_attr('light.ikea_e27_detskaia',\
|
||
\ 'brightness') | int(0)) <= 102 %}\n 153\n{% elif (state_attr('light.ikea_e27_detskaia',\
|
||
\ 'brightness') | int(0)) <= 153 %}\n 204\n{% elif (state_attr('light.ikea_e27_detskaia',\
|
||
\ 'brightness') | int(0)) <= 204 %}\n 255\n{% elif (state_attr('light.ikea_e27_detskaia',\
|
||
\ 'brightness') | int(0)) <= 255 %}\n 3\n{% endif %}\n"
|
||
- alias: Triple click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''triple'' }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.ikea_e27_detskaia
|
||
data:
|
||
color_temp: 270
|
||
- delay: '00:00:00.0500'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.ikea_e27_detskaia
|
||
data:
|
||
transition: '0.5'
|
||
brightness: 255
|
||
- alias: Action Hold
|
||
conditions:
|
||
- condition: trigger
|
||
id: hold
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.detskaia_podsvetka_na_okne
|
||
- alias: Подсветка на окне в Детской
|
||
id: 319b4fe1-b76d-459f-ac43-3187f0c9079a
|
||
triggers:
|
||
- trigger: numeric_state
|
||
entity_id: sensor.outdoor_illuminance
|
||
below: input_number.nursery_window_light_illuminance_threshold
|
||
for: 00:10:00
|
||
id: dark
|
||
- trigger: numeric_state
|
||
entity_id: sensor.outdoor_illuminance
|
||
above: input_number.nursery_window_light_illuminance_threshold
|
||
for: 00:10:00
|
||
id: lightly
|
||
- trigger: state
|
||
entity_id: group.family_persons
|
||
from: not_home
|
||
to: home
|
||
id: to_home
|
||
conditions: '{{ is_state(''input_boolean.nursery_window_light_auto'', ''on'') }}'
|
||
actions:
|
||
choose:
|
||
- alias: Darkens (Turn On)
|
||
conditions:
|
||
- condition: trigger
|
||
id: dark
|
||
sequence:
|
||
- condition: state
|
||
entity_id: light.detskaia_podsvetka_na_okne
|
||
state: 'off'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.detskaia_podsvetka_na_okne
|
||
- alias: Brightens (Turn Off)
|
||
conditions:
|
||
- or:
|
||
- condition: trigger
|
||
id: lightly
|
||
sequence:
|
||
- condition: state
|
||
entity_id: light.detskaia_podsvetka_na_okne
|
||
state: 'on'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.detskaia_podsvetka_na_okne
|
||
- alias: Came Home
|
||
conditions:
|
||
- and:
|
||
- condition: trigger
|
||
id: to_home
|
||
- condition: numeric_state
|
||
entity_id: sensor.outdoor_illuminance
|
||
below: input_number.nursery_window_light_illuminance_threshold
|
||
sequence:
|
||
- condition: state
|
||
entity_id: light.detskaia_podsvetka_na_okne
|
||
state: 'off'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.detskaia_podsvetka_na_okne
|
||
- alias: Лампы на столе в Детской
|
||
id: 2d312381-a7c3-4d33-874b-d7771d8ff178
|
||
triggers:
|
||
- trigger: time
|
||
at: 00:30:00
|
||
id: time_off
|
||
actions:
|
||
choose:
|
||
- alias: Time (Turn Off)
|
||
conditions:
|
||
- condition: trigger
|
||
id: time_off
|
||
sequence:
|
||
- parallel:
|
||
- sequence:
|
||
- condition: '{{ is_state(''light.ikea_e14_level_light_color_on_off'', ''on'')
|
||
}}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.ikea_e14_level_light_color_on_off
|
||
- sequence:
|
||
- condition: '{{ is_state(''light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light'',
|
||
''on'') }}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light
|
||
- alias: Sunrise Lighting (Nursery)
|
||
id: d50bfe78-2e35-4870-a24c-71d0f6ebf969
|
||
triggers:
|
||
- trigger: time
|
||
at: input_datetime.sunrise_in_nursery
|
||
conditions:
|
||
- and:
|
||
- condition: state
|
||
entity_id: binary_sensor.workday_sensor
|
||
state: 'on'
|
||
- condition: sun
|
||
before: sunrise
|
||
before_offset: 00:30:00
|
||
- condition: state
|
||
entity_id: calendar.semia_alexander_borisov_school_vacation_egor
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: calendar.semia_alexander_borisov_school_vacation_kirill
|
||
state: 'off'
|
||
actions:
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.sunrise_in_nursery
|
||
- alias: Kids must sleep at night
|
||
id: a2e4ec8e-926f-44bf-96fb-0029bd137f32
|
||
triggers:
|
||
trigger: state
|
||
entity_id: light.ikea_e27_detskaia
|
||
to: 'on'
|
||
for:
|
||
minutes: 2
|
||
conditions:
|
||
condition: time
|
||
after: 00:00
|
||
before: 06:30
|
||
actions:
|
||
- action: homeassistant.turn_off
|
||
target:
|
||
entity_id: light.ikea_e27_detskaia
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: _{{ now().strftime("%d.%m.%Y %H:%M:%S") }}_ автоматически выключен
|
||
свет в детской.
|
||
- alias: Кубик Aqara в Детской
|
||
id: 3ac0562a-feca-479d-ba2a-4bf0cc1fe5ce
|
||
mode: queued
|
||
max: 5
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:05:29:2a:d9
|
||
actions:
|
||
choose:
|
||
- alias: Rotate
|
||
conditions: '{{ trigger.event.data.command in (''rotate_right'', ''rotate_left'')
|
||
}}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.ikea_e14_level_light_color_on_off
|
||
data:
|
||
brightness: '{{ (state_attr(''light.ikea_e14_level_light_color_on_off'',
|
||
''brightness'') | int(0)) + (trigger.event.data.args.relative_degrees
|
||
| int) }}'
|
||
- alias: Flip
|
||
conditions: '{{ trigger.event.data.command in (''flip'') }}'
|
||
sequence:
|
||
choose:
|
||
- alias: Flip 90
|
||
conditions: '{{ (trigger.event.data.args.flip_degrees | int) == 90 }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.ikea_e14_level_light_color_on_off
|
||
data:
|
||
brightness: 255
|
||
- alias: Люстра в Кладовой
|
||
id: 4144c0c9-bd8e-4ed4-a6f4-42cf9d5b6228
|
||
mode: queued
|
||
max: 3
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.lumi_lumi_sensor_magnet_50659603_on_off
|
||
id: magnet
|
||
- trigger: state
|
||
entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_7b4e5f07_ias_zone
|
||
id: motion
|
||
- trigger: state
|
||
entity_id: timer.storeroom_light
|
||
id: timer
|
||
actions:
|
||
choose:
|
||
- alias: Magnet
|
||
conditions:
|
||
- condition: trigger
|
||
id: magnet
|
||
sequence:
|
||
choose:
|
||
- alias: To On
|
||
conditions: '{{ trigger.from_state.state == ''off'' and trigger.to_state.state
|
||
== ''on'' }}'
|
||
sequence:
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_1000b6831b
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.storeroom_light
|
||
- alias: To Off
|
||
conditions: '{{ trigger.from_state.state == ''on'' and trigger.to_state.state
|
||
== ''off'' }}'
|
||
sequence:
|
||
- action: timer.finish
|
||
target:
|
||
entity_id: timer.storeroom_light
|
||
- alias: Motion
|
||
conditions:
|
||
- condition: trigger
|
||
id: motion
|
||
sequence:
|
||
choose:
|
||
- alias: To On
|
||
conditions: '{{ trigger.to_state.state == ''on'' }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.storeroom_light
|
||
- condition: state
|
||
entity_id: light.sonoff_1000b6831b
|
||
state: 'off'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_1000b6831b
|
||
- alias: To Off
|
||
conditions: '{{ trigger.to_state.state == ''off'' }}'
|
||
sequence:
|
||
choose:
|
||
- alias: Door closed
|
||
conditions: '{{ is_state(''binary_sensor.lumi_lumi_sensor_magnet_50659603_on_off'',
|
||
''off'') }}'
|
||
sequence:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_1000b6831b
|
||
- alias: Door opened
|
||
conditions: '{{ is_state(''binary_sensor.lumi_lumi_sensor_magnet_50659603_on_off'',
|
||
''on'') }}'
|
||
sequence:
|
||
- action: timer.finish
|
||
target:
|
||
entity_id: timer.storeroom_light
|
||
- alias: Timer
|
||
conditions:
|
||
- condition: trigger
|
||
id: timer
|
||
sequence:
|
||
choose:
|
||
conditions: '{{ trigger.to_state.state == ''idle'' }}'
|
||
sequence:
|
||
choose:
|
||
- alias: Motion On
|
||
conditions: '{{ states(''binary_sensor.lumi_lumi_sensor_motion_aq2_7b4e5f07_ias_zone'')
|
||
== ''on'' }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.storeroom_light
|
||
- alias: Motion Off
|
||
conditions: '{{ states(''binary_sensor.lumi_lumi_sensor_motion_aq2_7b4e5f07_ias_zone'')
|
||
== ''off'' }}'
|
||
sequence:
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_1000b6831b
|
||
- alias: Свет в Туалете
|
||
id: 7fa56654-f362-4f13-97ca-9d8e4ff52ccb
|
||
mode: queued
|
||
max: 10
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: timer.toilet_presence
|
||
to: idle
|
||
id: timer_idle
|
||
- trigger: state
|
||
entity_id: binary_sensor.lumi_lumi_sensor_magnet_9bef9603_on_off
|
||
id: magnet
|
||
- trigger: state
|
||
entity_id: binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone
|
||
to: 'on'
|
||
id: motion_on
|
||
- trigger: state
|
||
entity_id: binary_sensor.0xa4c138b96f4627bc_presence
|
||
to: 'on'
|
||
id: presence_on
|
||
- trigger: event
|
||
event_type: zha_event
|
||
event_data:
|
||
device_ieee: 00:15:8d:00:03:d1:5d:00
|
||
command: click
|
||
id: click
|
||
actions:
|
||
choose:
|
||
- alias: Timer Idle
|
||
conditions:
|
||
- condition: trigger
|
||
id: timer_idle
|
||
sequence:
|
||
choose:
|
||
- alias: Presence On
|
||
conditions: '{{ states(''binary_sensor.0xa4c138b96f4627bc_presence'') ==
|
||
''on'' }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.bathroom_presence
|
||
- alias: Motion On
|
||
conditions: '{{ states(''binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone'')
|
||
== ''on'' }}'
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.toilet_presence
|
||
- alias: Motion Off
|
||
conditions: '{{ states(''binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone'')
|
||
== ''off'' }}'
|
||
sequence:
|
||
choose:
|
||
- alias: Motion detected > 2 min ago
|
||
conditions: '{{ (as_timestamp(now()) - as_timestamp(states.binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone.last_changed))
|
||
> 120 }}'
|
||
sequence:
|
||
- parallel:
|
||
- sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_03_on_off'', ''on'')
|
||
}}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_zbmini_03_on_off
|
||
- sequence:
|
||
- condition: '{{ is_state(''fan.toilet_extractor'', ''on'') }}'
|
||
- action: fan.turn_off
|
||
target:
|
||
entity_id: fan.toilet_extractor
|
||
- alias: Motion detected <= 2 min ago
|
||
conditions: '{{ (as_timestamp(now()) - as_timestamp(states.binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone.last_changed))
|
||
<= 120 }}'
|
||
sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_03_on_off'', ''on'')
|
||
}}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_zbmini_03_on_off
|
||
- delay:
|
||
seconds: 0.3
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_zbmini_03_on_off
|
||
- wait_template: '{{ is_state(''binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone'',
|
||
''on'') }}'
|
||
timeout: 00:00:30
|
||
- if:
|
||
- '{{ not wait.completed }}'
|
||
then:
|
||
- parallel:
|
||
- sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_03_on_off'', ''on'')
|
||
}}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_zbmini_03_on_off
|
||
- sequence:
|
||
- condition: '{{ is_state(''fan.toilet_extractor'', ''on'') }}'
|
||
- action: fan.turn_off
|
||
target:
|
||
entity_id: fan.toilet_extractor
|
||
- alias: Magnet
|
||
conditions:
|
||
- condition: trigger
|
||
id: magnet
|
||
sequence:
|
||
choose:
|
||
- alias: To On
|
||
conditions: '{{ trigger.from_state.state == ''off'' and trigger.to_state.state
|
||
== ''on'' }}'
|
||
sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_03_on_off'', ''off'') }}'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_zbmini_03_on_off
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.toilet_presence
|
||
- alias: To Off
|
||
conditions: '{{ trigger.from_state.state == ''on'' and trigger.to_state.state
|
||
== ''off'' }}'
|
||
sequence:
|
||
- condition: '{{ is_state(''binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone'',
|
||
''off'') }}'
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_03_on_off'', ''on'') }}'
|
||
- action: light.turn_off
|
||
target:
|
||
entity_id: light.sonoff_zbmini_03_on_off
|
||
- condition: '{{ is_state(''fan.toilet_extractor'', ''on'') }}'
|
||
- action: fan.turn_off
|
||
target:
|
||
entity_id: fan.toilet_extractor
|
||
- alias: Presence
|
||
conditions:
|
||
- condition: trigger
|
||
id: presence_on
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.bathroom_presence
|
||
- alias: Motion
|
||
conditions:
|
||
- condition: trigger
|
||
id: motion_on
|
||
sequence:
|
||
- action: timer.start
|
||
target:
|
||
entity_id: timer.toilet_presence
|
||
- parallel:
|
||
- sequence:
|
||
- condition: '{{ is_state(''fan.toilet_extractor'', ''off'') }}'
|
||
- action: fan.turn_on
|
||
target:
|
||
entity_id: fan.toilet_extractor
|
||
- sequence:
|
||
- condition: '{{ is_state(''light.sonoff_zbmini_03_on_off'', ''off'') }}'
|
||
- action: light.turn_on
|
||
target:
|
||
entity_id: light.sonoff_zbmini_03_on_off
|
||
- alias: Button
|
||
conditions:
|
||
- condition: trigger
|
||
id: click
|
||
sequence:
|
||
choose:
|
||
- alias: Single click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''single'' }}'
|
||
sequence:
|
||
- action: light.toggle
|
||
target:
|
||
entity_id: light.sonoff_zbmini_03_on_off
|
||
- action: fan.toggle
|
||
target:
|
||
entity_id: fan.toilet_extractor
|
||
- alias: Double click
|
||
conditions: '{{ trigger.event.data.args.click_type == ''double'' }}'
|
||
sequence:
|
||
- action: fan.toggle
|
||
target:
|
||
entity_id: fan.toilet_extractor
|
||
- alias: New Year Light [Scheduled]
|
||
id: 63ea7cdd-f8bc-4a4d-b3ce-72fc493e7392
|
||
triggers:
|
||
- trigger: time
|
||
at: input_datetime.new_year_illumination_on
|
||
id: 'on'
|
||
- trigger: time
|
||
at: input_datetime.new_year_illumination_off
|
||
id: 'off'
|
||
actions:
|
||
choose:
|
||
- conditions: '{{ trigger.id == ''on'' }}'
|
||
sequence:
|
||
- action: scene.turn_on
|
||
target:
|
||
entity_id: scene.new_year_light_on
|
||
- conditions: '{{ trigger.id == ''off'' }}'
|
||
sequence:
|
||
- if: '{{ states("sensor.date")[-5:] != "01-01" }}'
|
||
then:
|
||
- action: scene.turn_on
|
||
target:
|
||
entity_id: scene.new_year_light_off
|
||
- alias: New Year Light [Home Presence]
|
||
id: e0299715-bb22-4667-b4ad-7cf0b72bd433
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: group.family_persons
|
||
from: not_home
|
||
to: home
|
||
id: home
|
||
- trigger: state
|
||
entity_id: group.family_persons
|
||
to: not_home
|
||
for:
|
||
minutes: 5
|
||
id: not_home
|
||
actions:
|
||
choose:
|
||
- conditions: '{{ trigger.id == ''home'' }}'
|
||
sequence:
|
||
- action: scene.turn_on
|
||
target:
|
||
entity_id: scene.new_year_light_on
|
||
- conditions: '{{ trigger.id == ''not_home'' }}'
|
||
sequence:
|
||
- action: scene.turn_on
|
||
target:
|
||
entity_id: scene.new_year_light_off
|
||
- alias: Radio - Selected Name to URL
|
||
id: 113d01d2-80b9-4a5e-9745-ad34cb66ea4d
|
||
triggers:
|
||
- trigger: homeassistant
|
||
event: start
|
||
- trigger: state
|
||
entity_id: input_select.radio_station
|
||
actions:
|
||
- action: input_text.set_value
|
||
target:
|
||
entity_id: input_text.radio_url_to_play
|
||
data:
|
||
value: "{% if is_state(\"input_select.radio_station\", \"Радио Jazz\") -%}\n\
|
||
\ http://nashe1.hostingradio.ru/jazz-128.mp3\n{% elif is_state(\"input_select.radio_station\"\
|
||
, \"Monte Carlo\") -%}\n http://montecarlo.hostingradio.ru/montecarlo128.mp3\n\
|
||
{% elif is_state(\"input_select.radio_station\", \"Monte Carlo Lounge\") -%}\n\
|
||
\ http://stream.zeno.fm/953wvvz4gseuv\n{% elif is_state(\"input_select.radio_station\"\
|
||
, \"Наше Радио\") -%}\n http://nashe5.hostingradio.ru/nashe-128.mp3\n{% elif\
|
||
\ is_state(\"input_select.radio_station\", \"ENERGY\") -%}\n http://ic2.101.ru:8000/v1_1\n\
|
||
{% elif is_state(\"input_select.radio_station\", \"Русское Радио\") -%}\n\
|
||
\ http://rusradio.hostingradio.ru/rusradio128.mp3\n{% elif is_state(\"input_select.radio_station\"\
|
||
, \"Maximum\") -%}\n http://maximum.hostingradio.ru/maximum128.mp3\n{% elif\
|
||
\ is_state(\"input_select.radio_station\", \"Детское Радио\") -%}\n http://ic7.101.ru:8000/a199\n\
|
||
{% elif is_state(\"input_select.radio_station\", \"Детское Радио (Старое радио)\"\
|
||
) -%}\n http://195.91.237.50:8000/detskoe128\n{% endif %}"
|
||
- alias: Radio - Selected Name to Device
|
||
id: fda46b3d-2b94-4aeb-b58d-69d537756cd5
|
||
triggers:
|
||
- trigger: homeassistant
|
||
event: start
|
||
- trigger: state
|
||
entity_id: input_select.output_device
|
||
action:
|
||
- action: input_text.set_value
|
||
target:
|
||
entity_id: input_text.output_device_to_play
|
||
data:
|
||
value: "{% if is_state(\"input_select.output_device\", \"Гостинная (TV)\") -%}\n\
|
||
\ media_player.gostinaia\n{% elif is_state(\"input_select.output_device\"\
|
||
, \"Детская (TV)\") -%}\n media_player.detskaia\n{% elif is_state(\"input_select.output_device\"\
|
||
, \"Ванная (Home Mini)\") -%}\n media_player.mini_v_vannoi\n{% elif is_state(\"\
|
||
input_select.output_device\", \"Гостинная (Яндекс)\") -%}\n media_player.yandex_station_mini2_gostinaia\n\
|
||
{% elif is_state(\"input_select.output_device\", \"Спальня (Яндекс)\") -%}\n\
|
||
\ media_player.yandex_station_mini2_spalnia\n{% elif is_state(\"input_select.output_device\"\
|
||
, \"Детская (Яндекс)\") -%}\n media_player.yandex_station_lite_detskaia\n\
|
||
{% endif %}"
|
||
- alias: Radio - Volume Control
|
||
id: a5915a17-ec28-4adf-a3c3-6ac08f71d11f
|
||
triggers:
|
||
trigger: state
|
||
entity_id: input_number.volume_radio
|
||
actions:
|
||
action: media_player.volume_set
|
||
target:
|
||
entity_id: '{{ states(''input_text.output_device_to_play'') }}'
|
||
data:
|
||
volume_level: '{{ states(''input_number.volume_radio'') }}'
|
||
- alias: Samsung TV ue43ru7470 Turn On
|
||
triggers:
|
||
- trigger: samsungtv.turn_on
|
||
entity_id: media_player.ue43ru7470
|
||
actions:
|
||
- action: wake_on_lan.send_magic_packet
|
||
data:
|
||
mac: 8c:79:f5:51:2f:d1
|
||
- alias: Samsung TV ue32es5500 Turn On
|
||
triggers:
|
||
- trigger: samsungtv.turn_on
|
||
entity_id: media_player.ue32es5500
|
||
actions:
|
||
- action: shell_command.chromecast_tv_on
|
||
data:
|
||
ip_addr: 172.16.16.194
|
||
- alias: Samsung TV ue46es5507 Turn On
|
||
triggers:
|
||
- trigger: samsungtv.turn_on
|
||
entity_id: media_player.ue46es5507
|
||
actions:
|
||
- action: shell_command.chromecast_tv_on
|
||
data:
|
||
ip_addr: 172.16.16.211
|
||
- alias: 'Scene: Children go to Bed'
|
||
id: 4ecf7cf0-fc2e-4769-9d95-548dc4d52ba2
|
||
mode: restart
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Дети ложатся спать
|
||
id: sleep
|
||
actions:
|
||
choose:
|
||
- alias: Go to Bed
|
||
conditions:
|
||
- condition: trigger
|
||
id: sleep
|
||
sequence:
|
||
- action: scene.turn_on
|
||
target:
|
||
entity_id: scene.children_go_to_bed
|
||
data:
|
||
transition: 2
|
||
- action: script.turn_off
|
||
target:
|
||
entity_id: script.nursery_alice_stop_watchdog_1h
|
||
- wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: media_player.yandex_station_lite_detskaia
|
||
to:
|
||
- 'off'
|
||
- paused
|
||
timeout: 01:00:00
|
||
continue_on_timeout: false
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.nursery_alice_stop_watchdog_1h
|
||
- alias: Sync Shopping List with Yandex
|
||
id: 930a85ab-d531-42e7-a1a6-86bdfe0a628f
|
||
mode: single
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: time_pattern
|
||
minutes: '35'
|
||
id: time
|
||
- trigger: event
|
||
event_type: shopping_list_updated
|
||
id: event
|
||
- trigger: state
|
||
entity_id:
|
||
- person.alexander
|
||
- person.irina
|
||
to: not_home
|
||
id: state
|
||
actions:
|
||
- wait_template: '{{ is_state_attr(''media_player.yandex_station_lite_prikhozhaya'',
|
||
''alice_state'', ''IDLE'') }}'
|
||
- if:
|
||
- alias: Event trigger
|
||
condition: trigger
|
||
id: event
|
||
then:
|
||
- delay: 00:05:00
|
||
- if:
|
||
- '{{ state_attr(''media_player.yandex_station_lite_prikhozhaya'', ''volume_level'')
|
||
!= 0.1 }}'
|
||
then:
|
||
- repeat:
|
||
sequence:
|
||
- action: media_player.volume_set
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_prikhozhaya
|
||
data:
|
||
volume_level: 0.1
|
||
- wait_template: '{{ state_attr(''media_player.yandex_station_lite_prikhozhaya'',
|
||
''volume_level'') == 0.1 }}'
|
||
timeout: 00:00:01
|
||
until:
|
||
- '{{ state_attr(''media_player.yandex_station_lite_prikhozhaya'', ''volume_level'')
|
||
== 0.1 }}'
|
||
- '{{ repeat.index <= 3 }}'
|
||
- if:
|
||
- '{{ state_attr(''media_player.yandex_station_lite_prikhozhaya'', ''is_volume_muted'')
|
||
!= true }}'
|
||
then:
|
||
- repeat:
|
||
sequence:
|
||
- action: media_player.volume_mute
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_prikhozhaya
|
||
data:
|
||
is_volume_muted: true
|
||
- wait_template: '{{ state_attr(''media_player.yandex_station_lite_prikhozhaya'',
|
||
''is_volume_muted'') == true }}'
|
||
timeout: 00:00:01
|
||
until:
|
||
- '{{ state_attr(''media_player.yandex_station_lite_prikhozhaya'', ''is_volume_muted'')
|
||
== true }}'
|
||
- '{{ repeat.index <= 3 }}'
|
||
- delay: 00:00:01
|
||
- action: media_player.play_media
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_prikhozhaya
|
||
data:
|
||
media_content_id: update
|
||
media_content_type: shopping_list
|
||
- delay: 00:00:03
|
||
- wait_template: '{{ is_state_attr(''media_player.yandex_station_lite_prikhozhaya'',
|
||
''alice_state'', ''LISTENING'') }}'
|
||
- action: media_player.volume_mute
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_prikhozhaya
|
||
data:
|
||
is_volume_muted: false
|
||
- alias: Планшет в Прихожей - включение экрана
|
||
id: d8f01254-9cde-41a8-b35a-f296621d3ac9
|
||
mode: queued
|
||
max: 5
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: light.sonoff_1000f2f14a
|
||
not_to:
|
||
- unavailable
|
||
- unknown
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
actions:
|
||
choose:
|
||
- alias: To On
|
||
conditions: '{{ trigger.from_state.state == ''off'' and trigger.to_state.state
|
||
== ''on'' }}'
|
||
sequence:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.galaxy_tab_a_8_0_2019_screen
|
||
- action: media_player.volume_set
|
||
target:
|
||
entity_id: media_player.galaxy_tab_a_8_0_2019
|
||
data:
|
||
volume_level: "{% if is_state('binary_sensor.time_between_21_08','off')\
|
||
\ -%}\n 0.8\n{% else -%}\n 0.3\n{% endif -%}"
|
||
- alias: To Off
|
||
conditions: '{{ trigger.from_state.state == ''on'' and trigger.to_state.state
|
||
== ''off'' }}'
|
||
sequence:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.galaxy_tab_a_8_0_2019_screen
|
||
- action: media_player.volume_set
|
||
target:
|
||
entity_id: media_player.galaxy_tab_a_8_0_2019
|
||
data:
|
||
volume_level: 0
|
||
- action: fully_kiosk.load_url
|
||
target:
|
||
device_id: 41638a8b36f2ac6228aed99d142fd286
|
||
data:
|
||
url: about:blank
|
||
- alias: Планшет в Прихожей - поддержание заряда
|
||
id: 82fb6789-4385-44cc-b721-90b892063447
|
||
max_exceeded: silent
|
||
triggers:
|
||
- trigger: numeric_state
|
||
entity_id:
|
||
- sensor.galaxy_tab_a_8_0_2019_battery
|
||
- sensor.sm_t295_hallway_battery_level
|
||
below: 30
|
||
for:
|
||
minutes: 5
|
||
id: low
|
||
- trigger: numeric_state
|
||
entity_id:
|
||
- sensor.galaxy_tab_a_8_0_2019_battery
|
||
- sensor.sm_t295_hallway_battery_level
|
||
above: 80
|
||
for:
|
||
minutes: 5
|
||
id: hight
|
||
actions:
|
||
choose:
|
||
- alias: Battery Low
|
||
conditions:
|
||
- condition: trigger
|
||
id: low
|
||
sequence:
|
||
- condition: '{{ is_state(''switch.sonoff_mini_r2_02_switch'', ''off'') }}'
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.sonoff_mini_r2_02_switch
|
||
- alias: Battery Charged
|
||
conditions:
|
||
- condition: trigger
|
||
id: hight
|
||
sequence:
|
||
- condition: '{{ is_state(''switch.sonoff_mini_r2_02_switch'', ''on'') }}'
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.sonoff_mini_r2_02_switch
|
||
- alias: 'Sonoff Dongles: Persistent Notifications'
|
||
id: 2f4e6840-deb7-4629-80f1-8a34347e64e0
|
||
mode: queued
|
||
max: 5
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
id: e
|
||
- trigger: state
|
||
entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist
|
||
not_from:
|
||
- unavailable
|
||
- unknown
|
||
id: p
|
||
actions:
|
||
- choose:
|
||
- conditions: '{{ trigger.id == ''e'' }}'
|
||
sequence:
|
||
- choose:
|
||
- conditions: '{{ trigger.to_state.state == ''off'' }}'
|
||
sequence:
|
||
- action: persistent_notification.create
|
||
data:
|
||
title: Sonoff ZBDongle-E Disconnected
|
||
message: 'Sonoff ZBDongle-E **отключен** от VM,
|
||
|
||
недоступны все устройства интеграции **ZHA**.
|
||
|
||
'
|
||
notification_id: zbe_disconnected
|
||
- conditions: '{{ trigger.to_state.state == ''on'' }}'
|
||
sequence:
|
||
- action: persistent_notification.dismiss
|
||
data:
|
||
notification_id: zbe_disconnected
|
||
- action: persistent_notification.create
|
||
data:
|
||
title: Sonoff ZBDongle-E Connected
|
||
message: 'Sonoff ZBDongle-E **подключен**,
|
||
|
||
проверьте работу **ZHA** и **Multiprotocol Add-on**.
|
||
|
||
'
|
||
notification_id: zbe_connected
|
||
- conditions: '{{ trigger.id == ''p'' }}'
|
||
sequence:
|
||
- choose:
|
||
- conditions: '{{ trigger.to_state.state == ''off'' }}'
|
||
sequence:
|
||
- action: persistent_notification.create
|
||
data:
|
||
title: Sonoff ZBDongle-P Disconnected
|
||
message: 'Sonoff ZBDongle-P **отключен** от VM,
|
||
|
||
недоступны все устройства **Zigbee2MQTT**.
|
||
|
||
'
|
||
notification_id: zbp_disconnected
|
||
- conditions: '{{ trigger.to_state.state == ''on'' }}'
|
||
sequence:
|
||
- action: persistent_notification.dismiss
|
||
data:
|
||
notification_id: zbp_disconnected
|
||
- action: persistent_notification.create
|
||
data:
|
||
title: Sonoff ZBDongle-P Connected
|
||
message: 'Sonoff ZBDongle-P **подключен**,
|
||
|
||
проверьте работу **Zigbee2MQTT**.
|
||
|
||
'
|
||
notification_id: zbp_connected
|
||
- alias: 'Sonoff Dongles: Attach USB Stick to HA VM'
|
||
id: 165f7294-7880-4aaf-955c-d5f301bb1e72
|
||
mode: parallel
|
||
max: 5
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist
|
||
to: 'off'
|
||
id: e
|
||
- trigger: state
|
||
entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist
|
||
to: 'off'
|
||
id: p
|
||
actions:
|
||
- choose:
|
||
- conditions: '{{ trigger.id == ''e'' }}'
|
||
sequence:
|
||
- parallel:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
title: '*Внимание*'
|
||
message: 'Sonoff Dongle E отключен от VM, будет запущен процесс автоматического
|
||
подключения.
|
||
|
||
'
|
||
- repeat:
|
||
sequence:
|
||
- action: shell_command.attach_sonoff_dongle_e_to_ha_vm
|
||
- delay: 00:03:00
|
||
until:
|
||
- condition: state
|
||
entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist
|
||
state: 'on'
|
||
- conditions: '{{ trigger.id == ''p'' }}'
|
||
sequence:
|
||
- parallel:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
title: '*Внимание*'
|
||
message: 'Sonoff Dongle P отключен от VM, будет запущен процесс автоматического
|
||
подключения.
|
||
|
||
'
|
||
- repeat:
|
||
sequence:
|
||
- action: shell_command.attach_sonoff_dongle_p_to_ha_vm
|
||
- delay: 00:03:00
|
||
until:
|
||
- condition: state
|
||
entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist
|
||
state: 'on'
|
||
- alias: 'Sonoff Dongles: USB Stick Attached to HA VM'
|
||
id: cc1601bd-a416-4fb1-9af9-4a436b7557e9
|
||
mode: queued
|
||
max: 5
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist
|
||
from: 'off'
|
||
to: 'on'
|
||
id: e
|
||
- trigger: state
|
||
entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist
|
||
from: 'off'
|
||
to: 'on'
|
||
id: p
|
||
actions:
|
||
- choose:
|
||
- conditions: '{{ trigger.id == ''e'' }}'
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
title: '*Внимание*'
|
||
message: 'Sonoff Dongle E подключен.
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Перезапустить HA:/sd_ha_restart, Перезагрузить VM:/sd_vm_reboot
|
||
- conditions: '{{ trigger.id == ''p'' }}'
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_system
|
||
title: '*Внимание*'
|
||
message: 'Sonoff Dongle P подключен.
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Перезапустить HA:/sd_ha_restart, Перезагрузить VM:/sd_vm_reboot
|
||
- alias: Sonoff Dongles - Restart HA
|
||
id: a5621d7e-91e5-4f14-a6b2-80c774d415ac
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /sd_ha_restart
|
||
actions:
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_replymarkup
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
inline_keyboard: []
|
||
- action: homeassistant.restart
|
||
- alias: Sonoff Dongles - Reboot VM
|
||
id: 08dfe08a-3901-46f3-b16a-e807edf80986
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /sd_vm_reboot
|
||
actions:
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_replymarkup
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
inline_keyboard: []
|
||
- action: hassio.host_reboot
|
||
- alias: Оповещение о начале уборки
|
||
id: 61fb954b-3450-4fc6-9848-cc5304b54a16
|
||
triggers:
|
||
trigger: state
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
to: cleaning
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ trigger.from_state.state = ''unavailable''}}
|
||
|
||
'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
message: '_Mi Robot_: начал уборку.'
|
||
inline_keyboard:
|
||
- Остановить:/vacuum_stop, На базу:/vacuum_go_home
|
||
- alias: Vacuum - Telegram Control - Stop
|
||
id: 78e4ee4f-d0d7-4d23-9e3c-4ec125f19400
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /vacuum_stop
|
||
actions:
|
||
- action: vacuum.pause
|
||
target:
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
message: '_Mi Robot_: начал уборку.
|
||
|
||
Уборка остановлена.
|
||
|
||
'
|
||
inline_keyboard:
|
||
- На базу:/vacuum_go_home
|
||
- alias: Vacuum - Telegram Control - Go to Base
|
||
id: 0b1fd434-4044-4ce7-ab8a-262d6250407a
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /vacuum_go_home
|
||
actions:
|
||
- action: vacuum.pause
|
||
target:
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
- delay: 1
|
||
- action: vacuum.return_to_base
|
||
target:
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
message: '_Mi Robot_: начал уборку.
|
||
|
||
Уборка остановлена, робот отправлен на базу.
|
||
|
||
'
|
||
- alias: Оповещение о возращении пылесоса на базу [notify to group flat]
|
||
id: 68311ec4-1030-4d7d-a2ea-e9cb21f7f40c
|
||
triggers:
|
||
trigger: state
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
to: docked
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ trigger.from_state.state = ''unavailable''}}
|
||
|
||
'
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: '_Mi Robot_: вернулся на базу (закончил уборку).'
|
||
- alias: Оповещение о забытом пылесосе [notify to group flat]
|
||
id: db76ec80-b5d6-4991-8a6c-9272b25c1a39
|
||
triggers:
|
||
trigger: state
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
to: idle
|
||
for:
|
||
minutes: 15
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: '_Mi Robot_: потерялся и бездельничает, отправляем на базу.'
|
||
- action: vacuum.return_to_base
|
||
target:
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
- alias: Оповещение об ошибке [notify to group flat]
|
||
id: fe6bb5c1-f886-4161-bad7-4bf04be83258
|
||
triggers:
|
||
trigger: state
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
to: error
|
||
conditions:
|
||
condition: template
|
||
value_template: '{{ trigger.from_state.state = ''unavailable''}}
|
||
|
||
'
|
||
actions:
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: '_Mi Robot_: Произошла *ошибка*
|
||
|
||
{{ state_attr(''vacuum.xiaomi_vacuum_cleaner'', "error") }}
|
||
|
||
'
|
||
- alias: Ежедневная уборка по будням [утро]
|
||
id: 67acac52-bf44-4661-9140-2e40f0006175
|
||
triggers:
|
||
trigger: state
|
||
entity_id: group.family_persons
|
||
to: not_home
|
||
for:
|
||
minutes: 20
|
||
conditions:
|
||
- and:
|
||
- condition: time
|
||
after: 08:30:00
|
||
before: '10:30:00'
|
||
weekday:
|
||
- mon
|
||
- tue
|
||
- wed
|
||
- thu
|
||
- fri
|
||
- condition: template
|
||
value_template: '{{ now().day = states.automation.ezhednevnaia_uborka_po_budniam_utro.attributes.last_triggered.day
|
||
| default(0) }}'
|
||
actions:
|
||
- action: vacuum.set_fan_speed
|
||
target:
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
data:
|
||
fan_speed: Turbo
|
||
- action: vacuum.start
|
||
target:
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
- alias: Регулярная уборка прихожей
|
||
id: 6c64060c-0a65-4caf-8064-1d5cdfea50a3
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.0x158d00031c790f_contact
|
||
from: 'on'
|
||
to: 'off'
|
||
conditions:
|
||
- and:
|
||
- condition: time
|
||
after: 09:30:00
|
||
before: '21:30:00'
|
||
- condition: template
|
||
value_template: '{{ (as_timestamp(now())-(as_timestamp(state_attr("automation.reguliarnaia_uborka_prikhozhei",
|
||
"last_triggered")))>480) }}'
|
||
- or:
|
||
- condition: state
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
state: docked
|
||
- condition: state
|
||
entity_id: vacuum.xiaomi_vacuum_cleaner
|
||
state: idle
|
||
actions:
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.start_vacuum_hallway_by_door_sensor
|
||
- alias: Set cleaning mode
|
||
id: 8fef5cc1-030e-4549-91b4-ffe25207672c
|
||
triggers:
|
||
trigger: state
|
||
entity_id: input_select.vacuum_power
|
||
actions:
|
||
- action: "{% if trigger.to_state.state == 'Silent' %}\n script.set_vacuum_power_silent\n\
|
||
{% elif trigger.to_state.state == 'Standard' %}\n script.set_vacuum_power_standard\n\
|
||
{% elif trigger.to_state.state == 'Medium' %}\n script.set_vacuum_power_medium\n\
|
||
{% elif trigger.to_state.state == 'Turbo' %}\n script.set_vacuum_power_turbo\n\
|
||
{% elif trigger.to_state.state == 'Gentle' %}\n script.set_vacuum_power_gentle\n\
|
||
{% endif %}\n"
|
||
- alias: Wakeup Radio - Childrens
|
||
id: 75d1f4fc-c40b-433a-b6bc-ed480b53365e
|
||
triggers:
|
||
trigger: time
|
||
at: input_datetime.wakeup_radio_in_nursery
|
||
conditions:
|
||
- condition: state
|
||
entity_id: binary_sensor.workday_sensor
|
||
state: 'on'
|
||
- condition: state
|
||
entity_id: calendar.semia_alexander_borisov_school_vacation_egor
|
||
state: 'off'
|
||
- condition: state
|
||
entity_id: calendar.semia_alexander_borisov_school_vacation_kirill
|
||
state: 'off'
|
||
actions:
|
||
- if:
|
||
- '{{ state_attr(''media_player.yandex_station_lite_detskaia'', ''volume_level'')
|
||
!= 0.1 }}'
|
||
then:
|
||
- repeat:
|
||
sequence:
|
||
- action: media_player.volume_set
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_detskaia
|
||
data:
|
||
volume_level: 0.1
|
||
- wait_template: '{{ state_attr(''media_player.yandex_station_lite_detskaia'',
|
||
''volume_level'') == 0.1 }}'
|
||
timeout: 00:00:01
|
||
until:
|
||
- '{{ state_attr(''media_player.yandex_station_lite_detskaia'', ''volume_level'')
|
||
== 0.1 }}'
|
||
- '{{ repeat.index <= 3 }}'
|
||
- if:
|
||
- '{{ state_attr(''media_player.yandex_station_lite_detskaia'', ''is_volume_muted'')
|
||
!= true }}'
|
||
then:
|
||
- repeat:
|
||
sequence:
|
||
- action: media_player.volume_mute
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_detskaia
|
||
data:
|
||
is_volume_muted: true
|
||
- wait_template: '{{ state_attr(''media_player.yandex_station_lite_detskaia'',
|
||
''is_volume_muted'') == true }}'
|
||
timeout: 00:00:01
|
||
until:
|
||
- '{{ state_attr(''media_player.yandex_station_lite_detskaia'', ''is_volume_muted'')
|
||
== true }}'
|
||
- '{{ repeat.index <= 3 }}'
|
||
- delay: 00:00:01
|
||
- action: yandex_station.send_command
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_detskaia
|
||
data:
|
||
command: sendText
|
||
text: Включи {{ states('input_text.wakeup_radio_in_nursery_query') }}
|
||
- delay: 00:00:10
|
||
- if:
|
||
- '{{ state_attr(''media_player.yandex_station_lite_detskaia'', ''volume_level'')
|
||
!= 0.1 }}'
|
||
then:
|
||
- action: media_player.volume_set
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_detskaia
|
||
data:
|
||
volume_level: '0.1'
|
||
- alias: Volume Up 4 times
|
||
repeat:
|
||
while:
|
||
- condition: template
|
||
value_template: '{{ repeat.index <= 4 }}'
|
||
sequence:
|
||
- delay: 00:03:00
|
||
- action: media_player.volume_up
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_detskaia
|
||
- action: yandex_station.send_command
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_detskaia
|
||
data:
|
||
command: sendText
|
||
text: Повтори за мной 'Доброе утро дети, пора вставать!'
|
||
- alias: Water Leak Detected
|
||
id: 2eb96392-3d8a-41b7-87f2-7c6e5c5b6232
|
||
triggers:
|
||
trigger: state
|
||
entity_id:
|
||
- binary_sensor.neptun_water_leakage
|
||
- binary_sensor.0x158d000400e77d_moisture
|
||
- binary_sensor.0x158d0004030d84_moisture
|
||
- binary_sensor.lumi_lumi_sensor_wleak_aq1_ias_zone
|
||
from: 'off'
|
||
to: 'on'
|
||
actions:
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.water_valves_close
|
||
- alias: Catch Neptun Activated
|
||
id: 0e013823-d5f8-4362-b7aa-2be3c25da064
|
||
mode: queued
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.lumi_lumi_sensor_magnet_opening
|
||
from: 'on'
|
||
to: 'off'
|
||
for: 00:00:05
|
||
conditions:
|
||
condition: state
|
||
entity_id: input_boolean.neptun_activated
|
||
state: 'off'
|
||
actions:
|
||
- action: input_boolean.turn_on
|
||
target:
|
||
entity_id: input_boolean.neptun_activated
|
||
- alias: Catch Neptun DeActivated
|
||
id: f17481ec-0be2-4774-b2cb-53fffab68781
|
||
mode: queued
|
||
triggers:
|
||
trigger: state
|
||
entity_id: switch.sonoff_1000b68886
|
||
from: 'off'
|
||
to: 'on'
|
||
conditions:
|
||
condition: state
|
||
entity_id: input_boolean.neptun_activated
|
||
state: 'on'
|
||
actions:
|
||
- action: input_boolean.turn_off
|
||
target:
|
||
entity_id: input_boolean.neptun_activated
|
||
- alias: Restart Neptun [twice a month]
|
||
id: 896b9256-93fc-41d2-8ffc-a4c6503f62e0
|
||
triggers:
|
||
- trigger: time
|
||
at: '11:00:00'
|
||
conditions:
|
||
- and:
|
||
- condition: time
|
||
weekday: mon
|
||
- condition: template
|
||
value_template: '{{ (as_timestamp(now())|timestamp_custom (''%W'') | int % 2)
|
||
== 1 }}'
|
||
actions:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.sonoff_1000b68886
|
||
- delay: 5
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.sonoff_1000b68886
|
||
- action: notify.telegram_group_flat_1
|
||
data:
|
||
message: '_INFO:_ Нептун был перезапущен.
|
||
|
||
'
|
||
- alias: PowerOff Valves After 60 Seconds
|
||
id: ac6042cd-ab15-4ff2-a0ed-9f873830d221
|
||
triggers:
|
||
- trigger: state
|
||
entity_id:
|
||
- switch.rele_aqara_vodoprovodnye_krany_l1
|
||
- switch.rele_aqara_vodoprovodnye_krany_l2
|
||
to: 'on'
|
||
for: 00:01:00
|
||
actions:
|
||
action: switch.turn_off
|
||
target:
|
||
entity_id: '{{ trigger.entity_id }}'
|
||
- alias: Valves Relay Software Interlock
|
||
id: f16be388-8c31-43d0-905b-d9c31968414c
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: switch.rele_aqara_vodoprovodnye_krany_l1
|
||
to: 'on'
|
||
id: open
|
||
- trigger: state
|
||
entity_id: switch.rele_aqara_vodoprovodnye_krany_l2
|
||
to: 'on'
|
||
id: close
|
||
actions:
|
||
- choose:
|
||
- alias: open_channel_to_on
|
||
conditions:
|
||
- condition: trigger
|
||
id: open
|
||
sequence:
|
||
- if:
|
||
- '{{ is_state(''switch.rele_aqara_vodoprovodnye_krany_l2'', ''on'') }}'
|
||
then:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.rele_aqara_vodoprovodnye_krany_l2
|
||
- alias: close_channel_to_on
|
||
conditions:
|
||
- condition: trigger
|
||
id: close
|
||
sequence:
|
||
- if:
|
||
- '{{ is_state(''switch.rele_aqara_vodoprovodnye_krany_l1'', ''on'') }}'
|
||
then:
|
||
- action: switch.turn_off
|
||
target:
|
||
entity_id: switch.rele_aqara_vodoprovodnye_krany_l1
|
||
- alias: Оповещения об активации датчиков [notify to group flat]
|
||
id: 54d437ce-2ec6-4779-93cb-3f36fe99b44c
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: binary_sensor.neptun_water_leakage
|
||
to: 'on'
|
||
id: neptun_on
|
||
- trigger: state
|
||
entity_id: binary_sensor.0x158d000400e77d_moisture
|
||
from: 'off'
|
||
to: 'on'
|
||
id: aqara_storeroom_on
|
||
- trigger: state
|
||
entity_id: binary_sensor.0x158d0004030d84_moisture
|
||
from: 'off'
|
||
to: 'on'
|
||
id: aqara_under_bath_on
|
||
- trigger: state
|
||
entity_id: binary_sensor.lumi_lumi_sensor_wleak_aq1_ias_zone
|
||
from: 'off'
|
||
to: 'on'
|
||
id: aqara_03_near_door
|
||
actions:
|
||
- choose:
|
||
- alias: neptun_on
|
||
conditions:
|
||
- condition: trigger
|
||
id: neptun_on
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: 'Сработал датчик протечки *Нептун*.
|
||
|
||
Водопроводные краны перекрыты
|
||
|
||
Необходимо проверить Кухню, Ванную, Туалет, Кладовую.
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Открыть краны:/water_valves_open
|
||
- alias: aqara_storeroom_on
|
||
conditions:
|
||
- condition: trigger
|
||
id: aqara_storeroom_on
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: 'Сработал датчик протечки Aqara в *Кладовой*.
|
||
|
||
Водопроводные краны перекрыты
|
||
|
||
Необходимо проверить наличие воды за стиральной машиной.
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Открыть краны:/water_valves_open
|
||
- alias: aqara_under_bath_on
|
||
conditions:
|
||
- condition: trigger
|
||
id: aqara_under_bath_on
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: 'Сработал датчик протечки Aqara в *Ванной*.
|
||
|
||
Водопроводные краны перекрыты
|
||
|
||
Необходимо проверить наличие воды *слева под ванной*.
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Открыть краны:/water_valves_open
|
||
- alias: aqara_03_near_door
|
||
conditions:
|
||
- condition: trigger
|
||
id: aqara_03_near_door
|
||
sequence:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: 'Сработал датчик протечки Aqara в *Ванной*.
|
||
|
||
Водопроводные краны перекрыты
|
||
|
||
Необходимо проверить наличие воды *рядом с ванной, справа*.
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Открыть краны:/water_valves_open
|
||
- alias: Оповещение о деактивации Нептуна [notify to group flat]
|
||
id: 344fff46-b0f1-41c3-b6e7-6386b5bc1256
|
||
triggers:
|
||
trigger: state
|
||
entity_id: binary_sensor.neptun_water_leakage
|
||
to: 'off'
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
message: Нептун деактивирован.
|
||
- alias: Оповещение об отключенном Нептуне (>2 мин)
|
||
id: 1a017a47-40b1-4315-892e-36760a8e86ec
|
||
triggers:
|
||
trigger: state
|
||
entity_id: switch.sonoff_1000b68886
|
||
to: 'off'
|
||
for: 00:02:00
|
||
actions:
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: secret tlg_group_flat_1
|
||
title: '*Внимание*'
|
||
message: 'Питание контроллера Нептун отключено более 2х минут
|
||
|
||
'
|
||
inline_keyboard:
|
||
- Включить:/neptune_poweron
|
||
- alias: Neptune - Telegram Control - Open
|
||
id: d42cd9f6-1a89-4116-8348-d99970407b75
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /neptune_poweron
|
||
actions:
|
||
- action: switch.turn_on
|
||
target:
|
||
entity_id: switch.sonoff_1000b68886
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_message
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
message: 'Питание контроллера Нептун отключено более 2х минут
|
||
|
||
Нептун включен.
|
||
|
||
'
|
||
- alias: Water Valves - Telegram Control - Open
|
||
id: b5321723-bc10-4146-88a5-7080d0fe70a8
|
||
triggers:
|
||
trigger: event
|
||
event_type: telegram_callback
|
||
event_data:
|
||
data: /water_valves_open
|
||
actions:
|
||
- action: script.turn_on
|
||
target:
|
||
entity_id: script.water_valves_open
|
||
- action: telegram_bot.answer_callback_query
|
||
data:
|
||
callback_query_id: '{{ trigger.event.data.id }}'
|
||
message: Команда отправлена
|
||
- action: telegram_bot.edit_replymarkup
|
||
data:
|
||
message_id: '{{ trigger.event.data.message.message_id }}'
|
||
chat_id: '{{ trigger.event.data.chat_id }}'
|
||
inline_keyboard: []
|
||
- alias: Wait for script.water_valves_open to stop
|
||
wait_for_trigger:
|
||
- trigger: state
|
||
entity_id: script.water_valves_open
|
||
from: 'on'
|
||
to: 'off'
|
||
timeout: 00:00:40
|
||
continue_on_timeout: false
|
||
- action: telegram_bot.send_message
|
||
data:
|
||
target: '{{ trigger.event.data.chat_id }}'
|
||
message: Водопроводные краны открыты.
|
||
- alias: Update Saures Sensors after HA Start
|
||
id: c0192c64-d64b-45b6-ab2e-91170c12f591
|
||
triggers:
|
||
- trigger: homeassistant
|
||
event: start
|
||
actions:
|
||
- wait_template: '{{ has_value(''sensor.saures_api_sid'') }}'
|
||
- action: homeassistant.update_entity
|
||
target:
|
||
entity_id: sensor.saures_controller_1113513_battery
|
||
- alias: Ya Music - Selected Name to Device
|
||
id: 2a16fa66-67a7-4960-95b0-9b766528f44d
|
||
triggers:
|
||
- trigger: homeassistant
|
||
event: start
|
||
- trigger: state
|
||
entity_id: input_select.yandex_station_start_stream_to
|
||
actions:
|
||
- action: input_text.set_value
|
||
target:
|
||
entity_id: input_text.yandex_station_device_to_play
|
||
data:
|
||
value: "{% if is_state(\"input_select.yandex_station_start_stream_to\", \"Ванная\
|
||
\ (Home Mini)\") -%}\n Мини в Ванной\n{% elif is_state(\"input_select.yandex_station_start_stream_to\"\
|
||
, \"Гостинная (Яндекс)\") -%}\n media_player.yandex_station_mini2_gostinaia\n\
|
||
{% elif is_state(\"input_select.yandex_station_start_stream_to\", \"Спальня\
|
||
\ (Яндекс)\") -%}\n media_player.yandex_station_mini2_spalnia\n{% elif is_state(\"\
|
||
input_select.yandex_station_start_stream_to\", \"Детская (Яндекс)\") -%}\n\
|
||
\ media_player.yandex_station_lite_detskaia\n{% endif %}"
|
||
- alias: Ya Music - Volume Control
|
||
id: 0303b471-3e9c-436a-84c0-cc5784eee706
|
||
triggers:
|
||
trigger: state
|
||
entity_id: input_number.volume_ya_music
|
||
actions:
|
||
- if:
|
||
- '{{ ''Мини в Ванной'' in states(''input_text.yandex_station_device_to_play'')
|
||
}}'
|
||
then:
|
||
- action: media_player.volume_set
|
||
target:
|
||
entity_id: media_player.mini_v_vannoi
|
||
data:
|
||
volume_level: '{{ states(''input_number.volume_ya_music'') }}'
|
||
else:
|
||
- action: media_player.volume_set
|
||
target:
|
||
entity_id: '{{ states(''input_text.yandex_station_device_to_play'') }}'
|
||
data:
|
||
volume_level: '{{ states(''input_number.volume_ya_music'') }}'
|
||
- alias: Синхронизация состояния Алисы в Прихожей с Мини в Ванной
|
||
id: 82c05e64-0259-4f54-8d17-952d241ef34e
|
||
triggers:
|
||
- trigger: state
|
||
entity_id: media_player.mini_v_vannoi
|
||
from: playing
|
||
to: 'off'
|
||
conditions:
|
||
condition: state
|
||
entity_id: media_player.yandex_station_lite_prikhozhaya
|
||
state: playing
|
||
actions:
|
||
- action: media_player.media_pause
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_prikhozhaya
|
||
- delay: 00:00:01
|
||
- action: media_player.select_source
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_prikhozhaya
|
||
data:
|
||
source: Станция
|
||
- alias: Stop Yandex Station
|
||
triggers:
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Выключи колонку в детской
|
||
id: nursery
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Выключи колонку в гостиной
|
||
id: livingroom
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Выключи колонку на кухне
|
||
id: livingroom
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Выключи колонку в спальне
|
||
id: bedroom
|
||
- trigger: event
|
||
event_type: yandex_intent
|
||
event_data:
|
||
text: Выключи колонку в прихожей
|
||
id: hallway
|
||
actions:
|
||
- choose:
|
||
- conditions: '{{ trigger.id == ''nursery'' }}'
|
||
sequence:
|
||
- action: media_player.turn_off
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_detskaia
|
||
- conditions: '{{ trigger.id == ''livingroom'' }}'
|
||
sequence:
|
||
- action: media_player.turn_off
|
||
target:
|
||
entity_id: media_player.yandex_station_mini2_gostinaia
|
||
- conditions: '{{ trigger.id == ''bedroom'' }}'
|
||
sequence:
|
||
- action: media_player.turn_off
|
||
target:
|
||
entity_id: media_player.yandex_station_mini2_spalnia
|
||
- conditions: '{{ trigger.id == ''hallway'' }}'
|
||
sequence:
|
||
- action: media_player.turn_off
|
||
target:
|
||
entity_id: media_player.yandex_station_lite_prikhozhaya
|