diff --git a/README.md b/README.md index 59d8ae5a..02f8fb32 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,9 @@ _Remote site (country house):_ - eWelink DIN rail Switch with Energy Meter (SMT002, Coolkit PSF-X67)\ Integration "Sonoff LAN" by [AlexxIT](https://github.com/AlexxIT/SonoffLAN) + - Sonoff POW R3 16D Elite flashed to [ESPHome](https://esphome.io/)\ + Integration "ESPHome" + - Plugs: - TP-Link HS110\ Integration "TP-Link Kasa Smart" diff --git a/automations/auto_humidor.yaml b/automations/auto_humidor.yaml index 4acd87e3..86fef546 100644 --- a/automations/auto_humidor.yaml +++ b/automations/auto_humidor.yaml @@ -4,52 +4,52 @@ - alias: 'Humidity in humidor too low' id: 4ccbd0aa-829a-45d3-abe7-33ae2552215b - trigger: - platform: numeric_state + triggers: + trigger: numeric_state entity_id: sensor.atc_3d13_humidity below: 65 for: minutes: 30 - action: - - service: notify.telegram_group_system + 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 - trigger: - platform: numeric_state + triggers: + trigger: numeric_state entity_id: sensor.atc_3d13_humidity above: 80 for: minutes: 30 - action: - - service: notify.telegram_group_system + 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 - trigger: - platform: numeric_state + triggers: + trigger: numeric_state entity_id: sensor.atc_3d13_temperature below: 20 for: minutes: 30 - action: - - service: notify.telegram_group_system + 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 - trigger: - platform: numeric_state + triggers: + trigger: numeric_state entity_id: sensor.atc_3d13_temperature above: 25 for: minutes: 30 - action: - - service: notify.telegram_group_system + actions: + - action: notify.telegram_group_system data: message: Температура в хьюмидоре выше 25°C (текущая {{ states("sensor.atc_3d13_temperature") }}°C) \ No newline at end of file diff --git a/automations/auto_media.yaml b/automations/auto_media.yaml index cd08faad..3a4df251 100644 --- a/automations/auto_media.yaml +++ b/automations/auto_media.yaml @@ -4,15 +4,14 @@ - alias: "PowerOff all media when nobody at home" id: 0e2312c7-3cab-413a-aefb-20ff5802c718 - trigger: - platform: state + triggers: + trigger: state entity_id: group.family_persons to: "not_home" for: minutes: 5 - condition: - condition: or - conditions: + conditions: + - or: - condition: state entity_id: group.all_tv state: "on" @@ -29,15 +28,15 @@ - condition: state entity_id: group.all_xbox state: "on" - action: - - service: homeassistant.turn_off - data: + actions: + - action: homeassistant.turn_off + target: entity_id: group.all_tv - - service: media_player.media_stop - data: + - action: media_player.media_stop + target: entity_id: - group.all_chromecasts - - service: media_player.turn_off + - action: media_player.turn_off target: entity_id: - group.all_yandex_stations diff --git a/automations/auto_notifications.yaml b/automations/auto_notifications.yaml index fed584fa..3aeb0a19 100644 --- a/automations/auto_notifications.yaml +++ b/automations/auto_notifications.yaml @@ -5,19 +5,18 @@ - alias: "Home Presence Alert" id: 12b0184c-bb8b-436a-887a-733d0ddac126 mode: parallel - trigger: - platform: state + triggers: + trigger: state entity_id: person.alexander, person.irina, person.galina, person.tatiana, person.olga, person.egor - condition: - condition: and - conditions: + conditions: + - and: # - condition: template # value_template: "{{ states('sensor.uptime') != '0.0' }}" - condition: template value_template: "{{ trigger.to_state.state != trigger.from_state.state }}" - action: - - service: notify.telegram_group_flat_1 - data_template: + actions: + - action: notify.telegram_group_flat_1 + data: message: > {{ trigger.to_state.attributes.friendly_name }} {% if trigger.to_state.state == 'home' %}дома! @@ -27,58 +26,58 @@ - alias: Entrance Door - Opened id: 067c832a-9626-4f61-8d19-444d6156e889 - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.0x158d00031c790f_contact from: "off" to: "on" - action: - service: notify.telegram_group_flat_1 + actions: + action: notify.telegram_group_flat_1 data: message: Открыта входная дверь! - alias: Entrance Door - Closed id: c6df423a-a1ec-41fb-b600-3874ffef758b - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.0x158d00031c790f_contact from: "on" to: "off" - action: - service: notify.telegram_group_flat_1 + actions: + action: notify.telegram_group_flat_1 data: message: Входная дверь закрыта. - alias: "Torrent Completed [notify to group system]" id: fe45c917-f489-4c38-a3a1-c66e5fedb07f - trigger: - platform: event + triggers: + trigger: event event_type: transmission_downloaded_torrent - action: - service: notify.telegram_group_system - data_template: + actions: + action: notify.telegram_group_system + data: message: "Загрузка torrent-файла завершена" - alias: "Полнолуние [notify to group system]" id: d698bdcc-4ce9-4954-a118-8a1f29cf327e - trigger: - platform: state + triggers: + trigger: state entity_id: sensor.moon to: "full_moon" - action: - service: notify.telegram_group_system - data_template: + actions: + action: notify.telegram_group_system + data: message: "Сегодня полнолуние!" - alias: Gas Alert id: 0ca74008-65a2-4ed1-b860-e27e57b216f2 - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.0x00158d000413b210_gas from: "off" to: "on" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" @@ -90,19 +89,20 @@ - alias: Gas Alert - Telegram control - poweroff_gas_sensor id: 3254a184-a04f-4b31-bbe9-1a00e403f134 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/poweroff_gas_sensor" - action: - - service: switch.turn_off - entity_id: switch.blitzwolf_shp13_02_3ad702fe_on_off - - service: telegram_bot.answer_callback_query - data_template: + 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: "Команда отправлена" - - service: telegram_bot.edit_message + - action: telegram_bot.edit_message data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" @@ -113,13 +113,13 @@ - alias: Gas Alert - Sensor Powered Off More Than 30 Min id: 3e69fa5f-34f2-4e5e-86e2-467aad2420b6 - trigger: - platform: state + triggers: + trigger: state entity_id: switch.blitzwolf_shp13_02_3ad702fe_on_off to: "off" for: "00:30:00" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" @@ -130,19 +130,20 @@ - alias: Gas Alert - Telegram control - poweroff_gas_sensor id: 50892fe7-741c-4b4d-a71c-a498be52d6b7 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/poweron_gas_sensor" - action: - - service: switch.turn_on - entity_id: switch.blitzwolf_shp13_02_3ad702fe_on_off - - service: telegram_bot.answer_callback_query + 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: "Команда отправлена" - - service: telegram_bot.edit_message + - action: telegram_bot.edit_message data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" @@ -153,32 +154,32 @@ - alias: Boiler - Low Temperature Alert id: fe98880b-2fcd-4b6f-9ded-adc174b9b958 - trigger: - - platform: numeric_state + triggers: + - trigger: numeric_state entity_id: sensor.boiler_water_temp below: 50 - - platform: numeric_state + - trigger: numeric_state entity_id: sensor.boiler_water_temp below: 40 - - platform: numeric_state + - trigger: numeric_state entity_id: sensor.boiler_water_temp below: 30 - condition: + conditions: condition: template value_template: "{{ (trigger.to_state.state | int) != 0 }}" - action: - - service: notify.telegram_group_flat_1 - data_template: + actions: + - action: notify.telegram_group_flat_1 + data: title: "*Внимание!*" message: | Температура воды в бойлере *{{ trigger.to_state.state }}*°C - alias: Huawei E5372 - New Unread SMS Alert id: a3215213-fe61-43f1-8eb4-ea572a4acee2 - trigger: - - platform: state + triggers: + - trigger: state entity_id: sensor.huawei_e5372_sms_unread - condition: + conditions: - condition: template value_template: > {% set ignore = ['unknown', 'unavailable', 'none', None, null, '', 'null'] %} @@ -186,63 +187,63 @@ - condition: template value_template: > {{ (trigger.to_state.state | int) > (trigger.from_state.state | int) }} - action: - - service: notify.telegram_group_system + actions: + - action: notify.telegram_group_system data: message: | _Huawei E5372_, Непрочитанных SMS: *{{ states('sensor.huawei_e5372_sms_unread') }}*, новых: *{{ (trigger.to_state.state | int ) - (trigger.from_state.state | int) }}* - alias: Kettle - Boil Finished Notification id: c5eaa742-7ea5-4c0b-8d43-d3ce69232a3e - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.kettle_status from: "on" to: "off" - condition: "{{ states('input_boolean.ha_shutdown') == 'off' }}" - action: - - service: notify.telegram_group_flat_1 + 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 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.washer_status from: "on" to: "off" - condition: "{{ states('input_boolean.ha_shutdown') == 'off' }}" - action: - - service: notify.telegram_group_flat_1 + 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 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.dryer_status from: "on" to: "off" - condition: "{{ states('input_boolean.ha_shutdown') == 'off' }}" - action: - - service: notify.telegram_group_flat_1 + 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 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.dishwasher_status from: "on" to: "off" - condition: "{{ states('input_boolean.ha_shutdown') == 'off' }}" - action: - - service: notify.telegram_group_flat_1 + conditions: "{{ states('input_boolean.ha_shutdown') == 'off' }}" + actions: + - action: notify.telegram_group_flat_1 data: title: "Посудомоечная машина:" message: Программа *закончена*, посуда вымыта. @@ -251,20 +252,20 @@ id: 3f22e8f0-6f31-49c1-bca1-ce19184c5184 mode: queued max: 10 - trigger: - - platform: state + 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 - condition: + 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 }} - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system message: | diff --git a/automations/auto_system.yaml b/automations/auto_system.yaml index aec8805e..dafd4666 100644 --- a/automations/auto_system.yaml +++ b/automations/auto_system.yaml @@ -4,61 +4,64 @@ - alias: "HA: Mount NFS Share from NAS01 [/nmt/nas]" id: eb3ef8ea-e19a-4b1e-b7ff-482089a346b5 - trigger: - - platform: homeassistant + triggers: + - trigger: homeassistant event: start - action: - - service: switch.turn_on - entity_id: switch.mount_mnt_nas + 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 - trigger: - - platform: time + triggers: + - trigger: time at: "01:00:00" - action: - - service: auto_backup.backup_full + 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 - trigger: - platform: event + triggers: + trigger: event event_type: system_log_event event_data: level: ERROR mode: parallel max: 50 - action: - - service: counter.increment - entity_id: counter.syslog_errors + actions: + - action: counter.increment + target: + entity_id: counter.syslog_errors - alias: "HASS: WARNINGs in System Log - Counter" id: acdf3489-b611-445c-bd24-2efc9c431124 - trigger: - platform: event + triggers: + trigger: event event_type: system_log_event event_data: level: WARNING mode: parallel max: 50 - action: - - service: counter.increment - entity_id: counter.syslog_warnings + actions: + - action: counter.increment + target: + entity_id: counter.syslog_warnings - alias: "HASS: Create Group of Battery Devices" id: 823d8378-6723-4e71-93ce-29c59946347a - trigger: - - platform: homeassistant + triggers: + - trigger: homeassistant event: start - - platform: time_pattern + - trigger: time_pattern hours: "/2" - action: - - service: group.set - data_template: + actions: + - action: group.set + data: object_id: battery_devices entities: >- {%- @@ -71,31 +74,32 @@ - alias: Fix for reload automations id: 4c7a9752-b7d2-4c41-acf6-7d175f6b9d39 - trigger: - - platform: event + triggers: + - trigger: event event_type: call_service event_data: domain: automation service: reload - - platform: event + - trigger: event event_type: automation_reloaded - action: - - service: >- + actions: + - action: >- {% if trigger.event.event_type == 'call_service' -%} automation.turn_off {% else -%} automation.turn_on {% endif -%} - entity_id: automation.device_needs_attention_notify_to_group_system + target: + entity_id: automation.device_needs_attention_notify_to_group_system - alias: Update HA DB SQL sensors id: e41348f5-2915-4a51-8d88-e5f00e7c0b67 - trigger: - - platform: time_pattern + triggers: + - trigger: time_pattern hours: "/1" minutes: "22" - action: - - service: homeassistant.update_entity + actions: + - action: homeassistant.update_entity target: entity_id: - sensor.hass_db_events_rows_count @@ -106,46 +110,46 @@ - alias: Update MES sensors id: 7f460de3-11dc-4e23-886c-a14b7db8bfeb - trigger: - - platform: time_pattern + triggers: + - trigger: time_pattern minutes: "33" - condition: + conditions: - condition: time after: "07:00:00" before: "22:50:00" - action: - - service: homeassistant.update_entity + 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 - trigger: - - platform: time_pattern + triggers: + - trigger: time_pattern seconds: "10" - action: - - service: homeassistant.update_entity + 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 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.z2m_2_stuck from: "off" to: "on" - condition: + conditions: - condition: state entity_id: sensor.addons_mostuitto_state state: "started" - action: + actions: - parallel: - - service: hassio.addon_restart + - action: hassio.addon_restart data: addon: 4b41db2d_zigbee2mqtt - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html diff --git a/automations/auto_system_notifications.yaml b/automations/auto_system_notifications.yaml index 6ee821ea..a66e123d 100644 --- a/automations/auto_system_notifications.yaml +++ b/automations/auto_system_notifications.yaml @@ -6,14 +6,14 @@ id: 142e502b-3e63-49e3-b790-9150f155dc6d mode: queued max: 5 - trigger: - - platform: state + triggers: + - trigger: state entity_id: persistent_notification.http_login - condition: + conditions: - condition: template value_template: "{{ trigger.to_state.state != off }}" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system disable_web_page_preview: true @@ -22,7 +22,7 @@ Неудачная попытка входа, ошибка авторизации! Источник: {{ 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('\((.*)\)') }}_ - - service: persistent_notification.dismiss + - action: persistent_notification.dismiss data: notification_id: http_login @@ -30,11 +30,11 @@ id: ba2318c5-5c2e-4575-aa13-02f53063793d mode: queued max: 5 - trigger: - - platform: state + triggers: + - trigger: state entity_id: persistent_notification.ip_ban - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system disable_web_page_preview: true @@ -42,104 +42,103 @@ *Внимание!* Заблокирован 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] }}_ - - service: persistent_notification.dismiss + - action: persistent_notification.dismiss data: notification_id: ip_ban - alias: "HASS: Home Assistant Start" id: 60f94d65-93d1-49e5-94d7-ca58471d02c4 - trigger: - - platform: homeassistant + triggers: + - trigger: homeassistant event: start - action: - - service: homeassistant.update_entity + actions: + - action: homeassistant.update_entity target: entity_id: sensor.errors_in_system_log_command_line - wait_for_trigger: - - platform: state + - trigger: state entity_id: sensor.errors_in_system_log_command_line timeout: "00:00:01" - - service: homeassistant.update_entity + - action: homeassistant.update_entity target: entity_id: sensor.warnings_in_system_log_command_line - wait_for_trigger: - - platform: state + - trigger: state entity_id: sensor.warnings_in_system_log_command_line timeout: "00:00:01" - - service: notify.telegram_group_system + - 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') }}* - - service: script.turn_on + - action: script.turn_on target: entity_id: script.hass_errors_counter_set_at_startup - - service: script.turn_on + - action: script.turn_on target: entity_id: script.hass_warnings_counter_set_at_startup - - service: script.turn_on + - 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 - trigger: - platform: homeassistant + triggers: + trigger: homeassistant event: shutdown - action: - - service: input_boolean.turn_on + actions: + - action: input_boolean.turn_on data: entity_id: input_boolean.ha_shutdown - - service: notify.telegram_group_system + - 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 - trigger: - platform: event + triggers: + trigger: event event_type: system_log_event event_data: level: ERROR - action: - - service: notify.telegram_group_system - data_template: + 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 - trigger: - platform: event + triggers: + trigger: event event_type: system_log_event event_data: level: WARNING - action: - - service: notify.telegram_group_system - data_template: + 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 - trigger: - - platform: event + triggers: + - trigger: event event_type: call_service event_data: domain: persistent_notification service: create - condition: - - condition: or - conditions: - - 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' }} - action: - - service: notify.telegram_group_system - data_template: + 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' -%} @@ -147,7 +146,7 @@ {% elif trigger.event.data.service_data.notification_id == 'invalid_config' -%} {{ trigger.event.data.service_data.message }} {% endif %} - - service: persistent_notification.dismiss + - action: persistent_notification.dismiss data: notification_id: >- {{ trigger.event.data.service_data.notification_id }} @@ -155,20 +154,20 @@ - alias: "HASS: ERRORs in Automations [notify to group system]" id: 67d49afb-cac6-45e2-99b0-0ad5904d84b2 mode: queued - trigger: - - platform: event + triggers: + - trigger: event event_type: system_log_event event_data: level: ERROR - condition: + conditions: - condition: template value_template: >- {{ trigger.event.data.message | regex_search('Error while executing automation') or trigger.event.data.message | regex_search('Error executing script') }} - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html @@ -179,17 +178,17 @@ - alias: "HASS: Critical Error [notify to group system]" id: d70721b8-e0f2-415a-b917-331781a463ee mode: queued - trigger: - - platform: event + triggers: + - trigger: event event_type: system_log_event event_data: level: FATAL - - platform: event + - trigger: event event_type: system_log_event event_data: level: CRITICAL - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html @@ -199,37 +198,37 @@ - alias: "HASSIO: New Version Available [notify to group system]" id: 4f0d8495-8abd-4513-9348-7630c5576088 - trigger: - platform: template + triggers: + trigger: template value_template: "{{ states('sensor.current_version') < states('sensor.latest_version') }}" - action: - service: notify.telegram_group_system - data_template: + actions: + action: notify.telegram_group_system + data: message: "_INFO:_ Доступна новая версия Home Assistant ({{ states('sensor.latest_version') }})" - alias: "HASSIO: New Home Assistant OS Version Available [notify to group system]" id: e1febbae-54ca-44b3-b808-83f74f29bf36 - trigger: - platform: template + triggers: + trigger: template value_template: "{{ states('sensor.home_assistant_operating_system_version') < states('sensor.home_assistant_operating_system_newest_version') }}" - action: - service: notify.telegram_group_system - data_template: + actions: + action: notify.telegram_group_system + data: message: "_INFO:_ Доступна новая версия Home Assistant OS ({{ states('sensor.home_assistant_operating_system_newest_version') }})" #- alias: "HASSIO: New Addons Update Available [notify to group system]" # id: 19295cc3-b128-4b64-925a-ffde2688cf9c -# trigger: -# - platform: state +# triggers: +# - trigger: state # entity_id: binary_sensor.updater_addons # from: "off" # to: "on" -# condition: +# conditions: # - condition: template # value_template: "{{ states('sensor.supervisor_updates') | int > 0 }}" -# action: -# - service: notify.telegram_group_system -# data_template: +# actions: +# - action: notify.telegram_group_system +# data: # message: | # _INFO:_ Доступны новые версии Add-ons (Supervisor) ({{ states('sensor.supervisor_updates') }}): # {%- for repo in state_attr('sensor.supervisor_updates', 'addons') %} @@ -238,26 +237,26 @@ #- alias: "HASSIO: New Supervisor Version Available [notify to group system]" # id: 80b629d2-3441-467b-ad60-dd49de9f8703 -# trigger: -# - platform: state +# triggers: +# - trigger: state # from: "off" # to: "on" -# action: -# - service: notify.telegram_group_system -# data_template: +# actions: +# - action: notify.telegram_group_system +# data: # message: "_INFO:_ Доступна новая версия Supervisor ({{ state_attr('sensor.supervisor_updates', 'newest_version') }})" #- alias: "HACS: New Component Version Available [notify to group system]" # id: 4bc5609a-1e8b-4e66-944a-e613bcaad6d2 -# trigger: -# platform: state +# triggers: +# trigger: state # entity_id: sensor.hacs -# condition: +# conditions: # - condition: template # value_template: "{{ (states('sensor.hacs') | int) > 0 }}" -# action: -# service: notify.telegram_group_system -# data_template: +# actions: +# action: notify.telegram_group_system +# data: # message: | # _INFO:_ Доступны новые версии Custom Components (HACS) ({{ states('sensor.hacs') }}): # {%- for repo in state_attr('sensor.hacs', 'repositories') %} @@ -269,10 +268,10 @@ mode: queued max: 50 max_exceeded: silent - trigger: - - platform: event + triggers: + - trigger: event event_type: state_changed - condition: + 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: @@ -296,7 +295,7 @@ trigger.event.data.new_state.attributes.installed_version not in ignore and trigger.event.data.new_state.attributes.installed_version is not none }} - action: + actions: - variables: latest_version: "{{ trigger.event.data.new_state.attributes.latest_version }}" installed_version: "{{ state_attr(trigger.event.data.entity_id, 'installed_version') }}" @@ -324,10 +323,10 @@ id: 89bb378c-13b5-4051-bd08-3f226dbc8834 mode: queued max: 30 - trigger: - - platform: event + triggers: + - trigger: event event_type: state_changed - condition: + conditions: - condition: template value_template: >- {{ states('input_boolean.ha_shutdown') == 'off' }} @@ -386,10 +385,10 @@ - condition: template value_template: >- {{ trigger.event.data.new_state.state in ['unknown', 'unavailable'] }} - action: + actions: - condition: template value_template: "{{ states('input_boolean.ha_shutdown') == 'off' }}" - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html @@ -401,10 +400,10 @@ id: 6d87e0a2-8a6b-4b20-bd28-900af1620584 mode: queued max: 30 - trigger: - - platform: event + triggers: + - trigger: event event_type: state_changed - condition: + conditions: - condition: template value_template: >- {{ not trigger.event.data.entity_id | regex_search @@ -421,8 +420,8 @@ - condition: template value_template: >- {{ (trigger.event.data.new_state.state | int) < (states('input_number.low_battery_alert_threshold') | int) }} - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html @@ -433,11 +432,11 @@ - alias: New Network Device Notification id: 7e5b4f9a-eb87-487f-8e1a-4b980de13734 mode: parallel - trigger: - platform: event + triggers: + trigger: event event_type: device_tracker_new_device - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html @@ -447,11 +446,11 @@ - alias: "Auto Backup Completed [notify to group system]" id: fef0c4de-e2ba-419b-b49e-ff39449e6481 - trigger: - platform: event + triggers: + trigger: event event_type: auto_backup.backup_successful - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html @@ -461,11 +460,11 @@ - alias: "Auto Backup Failure [notify to group system]" id: 24f2bb2c-3e2c-47b5-ba9a-a92f0f5bf63a - trigger: - platform: event + triggers: + trigger: event event_type: auto_backup.backup_failed - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html diff --git a/automations/auto_telegram.yaml b/automations/auto_telegram.yaml index 2a103514..2208d86e 100644 --- a/automations/auto_telegram.yaml +++ b/automations/auto_telegram.yaml @@ -5,47 +5,47 @@ # ---- Mirror all text messages - alias: "Telegram Bot - Mirror text" id: d35faec4-c949-4358-8aff-00e11b560444 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_text - action: - service: notify.telegram_group_system - data_template: + 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 }} # ---- /start - alias: "Telegram Bot - Start" id: d50c7e2c-9f67-40f2-9495-41ba1140c9b5 - trigger: - - platform: event + triggers: + - trigger: event event_type: telegram_command event_data: command: "/start" - - platform: event + - trigger: event event_type: telegram_command event_data: command: "/start@HAutoBot" - action: - service: telegram_bot.send_message - data_template: + actions: + action: telegram_bot.send_message + data: target: "{{ trigger.event.data.user_id }}" message: "Привет! Помощь - /help" # ---- /help - alias: "Telegram Bot - Help" id: 1e265eea-3d26-4a04-8402-f25a828f841d - trigger: - - platform: event + triggers: + - trigger: event event_type: telegram_command event_data: command: "/help" - - platform: event + - trigger: event event_type: telegram_command event_data: command: "/help@HAutoBot" - action: - service: telegram_bot.send_message - data_template: + actions: + action: telegram_bot.send_message + data: target: "{{ trigger.event.data.user_id }}" parse_mode: html message: | @@ -58,18 +58,18 @@ # ---- /ping - alias: "Telegram Bot - Ping" id: 936c648b-18b6-4636-a941-cc3f3361fdd0 - trigger: - - platform: event + triggers: + - trigger: event event_type: telegram_command event_data: command: "/ping" - - platform: event + - trigger: event event_type: telegram_command event_data: command: "/ping@HAutoBot" - action: - service: telegram_bot.send_message - data_template: + actions: + action: telegram_bot.send_message + data: target: "{{ trigger.event.data.user_id }}" message: | Pong! _{{ now().strftime("%d.%m.%Y %H:%M:%S") }}_ @@ -79,18 +79,18 @@ # ---- /whoishome - alias: "Telegram Bot - Who is home?" id: f3af5ecc-3eb8-4542-8207-97f90b6f5abf - trigger: - - platform: event + triggers: + - trigger: event event_type: telegram_command event_data: command: "/whoishome" - - platform: event + - trigger: event event_type: telegram_command event_data: command: "/whoishome@HAutoBot" - action: - service: telegram_bot.send_message - data_template: + actions: + action: telegram_bot.send_message + data: target: "{{ trigger.event.data.chat_id }}" message: | Сейчас дома: @@ -100,18 +100,18 @@ # ---- /weather - alias: "Telegram Bot - Weather" id: b0b0a539-14fb-440c-b57c-269460961819 - trigger: - - platform: event + triggers: + - trigger: event event_type: telegram_command event_data: command: "/weather" - - platform: event + - trigger: event event_type: telegram_command event_data: command: "/weather@HAutoBot" - action: - - service: telegram_bot.send_photo - data_template: + actions: + - action: telegram_bot.send_photo + data: target: "{{ trigger.event.data.user_id }}" file: '/config/www/weather_icons/{{ states("weather.yandex_weather_danilovskii") }}.webp' caption: | @@ -122,18 +122,18 @@ # ---- /weather_ch - alias: "Telegram Bot - Weather Country House" id: c5ac3f4b-80b8-479f-96bf-45274aeba2ec - trigger: - - platform: event + triggers: + - trigger: event event_type: telegram_command event_data: command: "/weather_ch" - - platform: event + - trigger: event event_type: telegram_command event_data: command: "/weather_ch@HAutoBot" - action: - - service: telegram_bot.send_photo - data_template: + actions: + - action: telegram_bot.send_photo + data: target: "{{ trigger.event.data.user_id }}" file: '/config/www/weather_icons/{{ states("weather.yandex_weather_nivki_2") }}.webp' caption: | @@ -144,18 +144,18 @@ # ---- /status - alias: "Telegram Bot - Status" id: 51572bf5-4960-4034-b09a-17d202c07c18 - trigger: - - platform: event + triggers: + - trigger: event event_type: telegram_command event_data: command: "/status" - - platform: event + - trigger: event event_type: telegram_command event_data: command: "/status@HAutoBot" - action: - service: telegram_bot.send_message - data_template: + actions: + action: telegram_bot.send_message + data: target: "{{ trigger.event.data.user_id }}" message: | *Климат* diff --git a/configuration.yaml b/configuration.yaml index 2c7ec7ae..9d0ddef8 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -112,6 +112,10 @@ recorder: - input_number.*_window_light_illuminance_threshold - input_number.*_covers_illuminance_threshold - sensor.*_target_distance + - sensor.sonoff_pow_r3_*_voltage + - sensor.sonoff_pow_r3_*_total_daily_energy + - sensor.sonoff_pow_r3_*_energy + - sensor.sonoff_pow_r3_*_apparent_power entities: - sensor.time - sensor.date diff --git a/entities/fan/fan_all.yaml b/entities/fan/fan_all.yaml index a041e073..347414d4 100644 --- a/entities/fan/fan_all.yaml +++ b/entities/fan/fan_all.yaml @@ -11,11 +11,13 @@ value_template: "{{ states('switch.sonoff_basic_01_switch') }}" availability_template: "{{ states('binary_sensor.sonoff_basic_01_status') }}" turn_on: - service: switch.turn_on - entity_id: switch.sonoff_basic_01_switch + action: switch.turn_on + target: + entity_id: switch.sonoff_basic_01_switch turn_off: - service: switch.turn_off - entity_id: switch.sonoff_basic_01_switch + action: switch.turn_off + target: + entity_id: switch.sonoff_basic_01_switch bathroom_extractor: unique_id: 89b94bc8-2c48-4240-b216-a688a9d8585b @@ -23,8 +25,10 @@ value_template: "{{ states('switch.sonoff_basic_02_switch') }}" availability_template: "{{ states('binary_sensor.sonoff_basic_02_status') }}" turn_on: - service: switch.turn_on - entity_id: switch.sonoff_basic_02_switch + action: switch.turn_on + target: + entity_id: switch.sonoff_basic_02_switch turn_off: - service: switch.turn_off - entity_id: switch.sonoff_basic_02_switch \ No newline at end of file + action: switch.turn_off + target: + entity_id: switch.sonoff_basic_02_switch \ No newline at end of file diff --git a/entities/samsungtv/samsungtv.yaml b/entities/samsungtv/samsungtv.yaml index b81a8355..1828f90e 100644 --- a/entities/samsungtv/samsungtv.yaml +++ b/entities/samsungtv/samsungtv.yaml @@ -4,18 +4,18 @@ - host: 172.16.16.205 turn_on_action: - - service: wake_on_lan.send_magic_packet + - action: wake_on_lan.send_magic_packet data: mac: 8c:79:f5:51:2f:d1 - host: 172.16.16.207 turn_on_action: - - service: shell_command.chromecast_tv_on + - action: shell_command.chromecast_tv_on data: ip_addr: "172.16.16.194" - host: 172.16.16.208 turn_on_action: - - service: shell_command.chromecast_tv_on + - action: shell_command.chromecast_tv_on data: ip_addr: "172.16.16.211" diff --git a/entities/switch/sw_all.yaml b/entities/switch/sw_all.yaml index 0c13ccaf..e04f1d32 100644 --- a/entities/switch/sw_all.yaml +++ b/entities/switch/sw_all.yaml @@ -17,12 +17,12 @@ value_template: "{{ is_state('binary_sensor.samsungtv_40c5100', 'on') }}" availability_template: "{{ is_state('binary_sensor.smartir_01_status', 'on') }}" turn_on: - service: switch.turn_on - data: + action: switch.turn_on + target: entity_id: switch.smartir_01_tv_samsung_power turn_off: - service: script.turn_on - data: + action: script.turn_on + target: entity_id: script.power_off_samsungtv_40c5100 icon_template: >- {% if is_state('binary_sensor.samsungtv_40c5100', 'on') %} @@ -34,11 +34,11 @@ samsungtv_46es5507: value_template: "{{ is_state('media_player.ue46es5507', 'on') }}" turn_on: - service: shell_command.chromecast_tv_on + action: shell_command.chromecast_tv_on data: ip_addr: "172.16.16.211" turn_off: - service: media_player.turn_off + action: media_player.turn_off data: entity_id: media_player.ue46es5507 icon_template: >- diff --git a/entities/template/triggers/tpl_trg_misc.yaml b/entities/template/triggers/tpl_trg_misc.yaml index 6a644df2..00489df6 100644 --- a/entities/template/triggers/tpl_trg_misc.yaml +++ b/entities/template/triggers/tpl_trg_misc.yaml @@ -3,7 +3,7 @@ ################################################# - trigger: - - platform: time_pattern + - trigger: time_pattern hours: "/1" minutes: 7 unique_id: bc9099b4-5f43-4ffb-ab2a-9d259964f87d @@ -30,13 +30,13 @@ {{ device_attr('5772d03ba3bdaef053d59d4554654308', 'sw_version') }} - trigger: - - platform: time_pattern + - trigger: time_pattern seconds: "/30" - - platform: homeassistant + - trigger: homeassistant event: start - - platform: event + - trigger: event event_type: automation_reloaded - - platform: event + - trigger: event event_type: event_template_reloaded unique_id: 9ac814d6-71ed-4823-8fb8-8f089785e8e4 sensor: diff --git a/lovelace/views/vi_ch_heating.yaml b/lovelace/views/vi_ch_heating.yaml index 54867e0f..e1a6e281 100644 --- a/lovelace/views/vi_ch_heating.yaml +++ b/lovelace/views/vi_ch_heating.yaml @@ -75,7 +75,8 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.ch_energy_show_radiator_terrace + - condition: state + entity: input_boolean.ch_energy_show_radiator_terrace state: "on" card: type: entities @@ -203,7 +204,8 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.ch_energy_show_radiator_livingroom + - condition: state + entity: input_boolean.ch_energy_show_radiator_livingroom state: "on" card: type: entities @@ -331,7 +333,8 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.ch_energy_show_radiator_kidsrooms + - condition: state + entity: input_boolean.ch_energy_show_radiator_kidsrooms state: "on" card: type: entities diff --git a/lovelace/views/vi_ch_home.yaml b/lovelace/views/vi_ch_home.yaml index f71c408a..3ddc2500 100644 --- a/lovelace/views/vi_ch_home.yaml +++ b/lovelace/views/vi_ch_home.yaml @@ -7,7 +7,8 @@ cards: ###
Сейчас на даче
- type: conditional conditions: - - entity: binary_sensor.coutry_house_presence + - condition: state + entity: binary_sensor.coutry_house_presence state: "off" card: type: markdown @@ -15,7 +16,8 @@ cards: *Никого нет...* - type: conditional conditions: - - entity: binary_sensor.coutry_house_presence + - condition: state + entity: binary_sensor.coutry_house_presence state: "on" card: type: entity-filter @@ -44,7 +46,8 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.country_house_show_last_detect + - condition: state + entity: input_boolean.country_house_show_last_detect state: "on" card: type: vertical-stack diff --git a/lovelace/views/vi_climate.yaml b/lovelace/views/vi_climate.yaml index 2758010a..14bb90ac 100644 --- a/lovelace/views/vi_climate.yaml +++ b/lovelace/views/vi_climate.yaml @@ -64,7 +64,8 @@ cards: icon: mdi:shuffle - type: conditional conditions: - - entity: humidifier.smartmi_humidifier_01_detskaia + - condition: state + entity: humidifier.smartmi_humidifier_01_detskaia state_not: "unavailable" card: type: custom:vertical-stack-in-card @@ -100,7 +101,8 @@ cards: name: "Автоматичеки" - type: conditional conditions: - - entity: input_boolean.smartmi_humidifier_01_detskaia_autocontrol + - condition: state + entity: input_boolean.smartmi_humidifier_01_detskaia_autocontrol state: "on" row: entity: input_number.target_humidity_01_detskaia @@ -227,7 +229,8 @@ cards: icon: mdi:shuffle - type: conditional conditions: - - entity: humidifier.smartmi_humidifier_02_spalnia + - condition: state + entity: humidifier.smartmi_humidifier_02_spalnia state_not: "unavailable" card: type: custom:vertical-stack-in-card @@ -263,7 +266,8 @@ cards: name: "Автоматически" - type: conditional conditions: - - entity: input_boolean.smartmi_humidifier_02_spalnia_autocontrol + - condition: state + entity: input_boolean.smartmi_humidifier_02_spalnia_autocontrol state: "on" row: entity: input_number.target_humidity_02_spalnia diff --git a/lovelace/views/vi_home.yaml b/lovelace/views/vi_home.yaml index af3f9fd1..a014d099 100644 --- a/lovelace/views/vi_home.yaml +++ b/lovelace/views/vi_home.yaml @@ -189,7 +189,8 @@ cards: ###
Сейчас дома
- type: conditional conditions: - - entity: group.family_persons + - condition: state + entity: group.family_persons state: "not_home" card: type: markdown @@ -197,7 +198,8 @@ cards: *Никого нет...* - type: conditional conditions: - - entity: group.family_persons + - condition: state + entity: group.family_persons state: "home" card: type: entity-filter @@ -220,7 +222,8 @@ cards: ###
Сейчас на даче
- type: conditional conditions: - - entity: binary_sensor.coutry_house_presence + - condition: state + entity: binary_sensor.coutry_house_presence state: "off" card: type: markdown @@ -228,7 +231,8 @@ cards: *Никого нет...* - type: conditional conditions: - - entity: binary_sensor.coutry_house_presence + - condition: state + entity: binary_sensor.coutry_house_presence state: "on" card: type: entity-filter @@ -245,9 +249,11 @@ cards: # --- Карта: - type: conditional conditions: - - entity: group.persons_to_map + - condition: state + entity: group.persons_to_map state: "not_home" - - entity: binary_sensor.coutry_house_presence + - condition: state + entity: binary_sensor.coutry_house_presence state: "off" card: type: vertical-stack @@ -265,9 +271,11 @@ cards: # --- Время в пути (Утро) # - type: conditional # conditions: - # - entity: binary_sensor.time_between_7_10 + # - condition: state + # entity: binary_sensor.time_between_7_10 # state: "on" - # - entity: binary_sensor.workday_sensor + # - condition: state + # entity: binary_sensor.workday_sensor # state: "on" # card: # type: vertical-stack @@ -288,9 +296,11 @@ cards: # # --- Время в пути (Вечер) # - type: conditional # conditions: - # - entity: binary_sensor.time_between_17_21 + # - condition: state + # entity: binary_sensor.time_between_17_21 # state: "on" - # - entity: binary_sensor.workday_sensor + # - condition: state + # entity: binary_sensor.workday_sensor # state: "on" # card: # type: vertical-stack @@ -460,7 +470,8 @@ cards: ###
Освещение
- type: conditional conditions: - - entity: group.all_lamps + - condition: state + entity: group.all_lamps state: "on" card: type: custom:vertical-stack-in-card @@ -488,7 +499,8 @@ cards: entity_id: group.all_lamps - type: conditional conditions: - - entity: group.all_lamps + - condition: state + entity: group.all_lamps state: "off" card: type: markdown diff --git a/lovelace/views/vi_light.yaml b/lovelace/views/vi_light.yaml index e5df498f..c58bb964 100644 --- a/lovelace/views/vi_light.yaml +++ b/lovelace/views/vi_light.yaml @@ -20,7 +20,8 @@ cards: cards: - type: conditional conditions: - - entity: light.sonoff_1000f2f14a + - condition: state + entity: light.sonoff_1000f2f14a state_not: "unavailable" card: type: light @@ -29,7 +30,8 @@ cards: icon: mdi:light-recessed - type: conditional conditions: - - entity: light.sonoff_1000f2a500 + - condition: state + entity: light.sonoff_1000f2a500 state_not: "unavailable" card: type: light @@ -51,7 +53,8 @@ cards: cards: - type: conditional conditions: - - entity: light.ikea_e27_detskaia + - condition: state + entity: light.ikea_e27_detskaia state_not: "unavailable" card: type: light @@ -62,7 +65,8 @@ cards: cards: - type: conditional conditions: - - entity: light.ikea_e14_level_light_color_on_off + - condition: state + entity: light.ikea_e14_level_light_color_on_off state_not: "unavailable" card: type: light @@ -71,7 +75,8 @@ cards: icon: mdi:desk-lamp - type: conditional conditions: - - entity: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light + - condition: state + entity: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light state_not: "unavailable" card: type: light @@ -82,7 +87,8 @@ cards: cards: - type: conditional conditions: - - entity: light.detskaia_podsvetka_na_okne + - condition: state + entity: light.detskaia_podsvetka_na_okne state_not: "unavailable" card: type: light @@ -91,7 +97,8 @@ cards: icon: mdi:string-lights - type: conditional conditions: - - entity: light.detskaia_girlianda_na_krovati + - condition: state + entity: light.detskaia_girlianda_na_krovati state_not: "unavailable" card: type: light @@ -107,7 +114,8 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.nursery_light_show_settings + - condition: state + entity: input_boolean.nursery_light_show_settings state: "on" card: type: entities @@ -123,7 +131,8 @@ cards: icon: mdi:weather-sunset-up - type: conditional conditions: - - entity: automation.sunrise_lighting_nursery + - condition: state + entity: automation.sunrise_lighting_nursery state: "on" row: entity: input_datetime.sunrise_in_nursery @@ -134,14 +143,16 @@ cards: icon: mdi:radio - type: conditional conditions: - - entity: automation.wakeup_radio_childrens + - condition: state + entity: automation.wakeup_radio_childrens state: "on" row: entity: input_datetime.wakeup_radio_in_nursery name: "Время включения радио" - type: conditional conditions: - - entity: automation.wakeup_radio_childrens + - condition: state + entity: automation.wakeup_radio_childrens state: "on" row: entity: input_text.wakeup_radio_in_nursery_query @@ -158,7 +169,8 @@ cards: cards: - type: conditional conditions: - - entity: light.sonoff_1000f30a9e + - condition: state + entity: light.sonoff_1000f30a9e state_not: "unavailable" card: type: light @@ -170,7 +182,8 @@ cards: cards: - type: conditional conditions: - - entity: light.sonoff_1000f3035d + - condition: state + entity: light.sonoff_1000f3035d state_not: "unavailable" card: type: light @@ -179,7 +192,8 @@ cards: icon: mdi:ceiling-light - type: conditional conditions: - - entity: light.sonoff_1000ab3c28 + - condition: state + entity: light.sonoff_1000ab3c28 state_not: "unavailable" card: type: light @@ -191,7 +205,8 @@ cards: cards: - type: conditional conditions: - - entity: light.ikea_e27_level_light_color_on_off + - condition: state + entity: light.ikea_e27_level_light_color_on_off state_not: "unavailable" card: type: light @@ -200,7 +215,8 @@ cards: icon: mdi:desk-lamp - type: conditional conditions: - - entity: light.gostinaia_podsvetka_na_okne + - condition: state + entity: light.gostinaia_podsvetka_na_okne state_not: "unavailable" card: type: light @@ -217,7 +233,8 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.livingroom_light_show_settings + - condition: state + entity: input_boolean.livingroom_light_show_settings state: "on" card: type: entities @@ -235,7 +252,8 @@ cards: ###
Кухня
- type: conditional conditions: - - entity: light.sonoff_1000b72483 + - condition: state + entity: light.sonoff_1000b72483 state_not: "unavailable" card: type: light @@ -246,7 +264,8 @@ cards: cards: - type: conditional conditions: - - entity: light.ikea_e27_kukhnia + - condition: state + entity: light.ikea_e27_kukhnia state_not: "unavailable" card: type: light @@ -255,7 +274,8 @@ cards: icon: mdi:ceiling-light - type: conditional conditions: - - entity: light.kukhnia_lenta + - condition: state + entity: light.kukhnia_lenta state_not: "unavailable" card: type: light @@ -271,7 +291,8 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.kitchen_light_show_settings + - condition: state + entity: input_boolean.kitchen_light_show_settings state: "on" card: type: entities @@ -303,7 +324,8 @@ cards: cards: - type: conditional conditions: - - entity: light.sonoff_1001053235 + - condition: state + entity: light.sonoff_1001053235 state_not: "unavailable" card: type: light @@ -314,7 +336,8 @@ cards: cards: - type: conditional conditions: - - entity: light.sonoff_01minizb_47ef08fe_on_off + - condition: state + entity: light.sonoff_01minizb_47ef08fe_on_off state_not: "unavailable" card: type: light @@ -323,7 +346,8 @@ cards: icon: mdi:wall-sconce-flat - type: conditional conditions: - - entity: light.sonoff_1001045426 + - condition: state + entity: light.sonoff_1001045426 state_not: "unavailable" card: type: light @@ -334,7 +358,8 @@ cards: cards: - type: conditional conditions: - - entity: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 + - condition: state + entity: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 state_not: "unavailable" card: type: light @@ -343,7 +368,8 @@ cards: icon: mdi:lamp - type: conditional conditions: - - entity: light.spalnia_stol + - condition: state + entity: light.spalnia_stol state_not: "unavailable" card: type: vertical-stack @@ -361,12 +387,14 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.bedroom_light_show_settings + - condition: state + entity: input_boolean.bedroom_light_show_settings state: "on" card: type: conditional conditions: - - entity: light.spalnia_stol + - condition: state + entity: light.spalnia_stol state_not: "unavailable" card: type: vertical-stack @@ -378,7 +406,8 @@ cards: icon: mdi:weather-sunset-up - type: conditional conditions: - - entity: automation.sunrise_lighting_bedroom + - condition: state + entity: automation.sunrise_lighting_bedroom state: "on" row: entity: input_datetime.sunrise_in_bedroom @@ -396,7 +425,8 @@ cards: cards: - type: conditional conditions: - - entity: light.sonoff_zbmini_03_on_off + - condition: state + entity: light.sonoff_zbmini_03_on_off state_not: "unavailable" card: type: light @@ -405,7 +435,8 @@ cards: icon: mdi:light-recessed - type: conditional conditions: - - entity: fan.toilet_extractor + - condition: state + entity: fan.toilet_extractor state_not: "unavailable" card: type: entities @@ -420,7 +451,8 @@ cards: cards: - type: conditional conditions: - - entity: light.sonoff_zbmini_04_on_off + - condition: state + entity: light.sonoff_zbmini_04_on_off state_not: "unavailable" card: type: light @@ -429,7 +461,8 @@ cards: icon: mdi:light-recessed - type: conditional conditions: - - entity: fan.bathroom_extractor + - condition: state + entity: fan.bathroom_extractor state_not: "unavailable" card: type: entities @@ -449,7 +482,8 @@ cards: ###
Кладовая
- type: conditional conditions: - - entity: light.sonoff_1000b6831b + - condition: state + entity: light.sonoff_1000b6831b state_not: "unavailable" card: type: light diff --git a/lovelace/views/vi_media.yaml b/lovelace/views/vi_media.yaml index ef8155a7..484abc8c 100644 --- a/lovelace/views/vi_media.yaml +++ b/lovelace/views/vi_media.yaml @@ -89,13 +89,17 @@ cards: entity: script.yanedx_station_tts_to - type: conditional conditions: - - entity: binary_sensor.yandex_station_lite_prikhozhaya_status + - condition: state + entity: binary_sensor.yandex_station_lite_prikhozhaya_status state_not: "on" - - entity: binary_sensor.yandex_station_lite_detskaia_status + - condition: state + entity: binary_sensor.yandex_station_lite_detskaia_status state_not: "on" - - entity: binary_sensor.yandex_station_mini2_gostinaia_status + - condition: state + entity: binary_sensor.yandex_station_mini2_gostinaia_status state_not: "on" - - entity: binary_sensor.yandex_station_mini2_spalnia_status + - condition: state + entity: binary_sensor.yandex_station_mini2_spalnia_status state_not: "on" card: type: markdown @@ -103,36 +107,44 @@ cards: *Все устройства бездействуют...* - type: conditional conditions: - - entity: media_player.yandex_station_lite_prikhozhaya + - condition: state + entity: media_player.yandex_station_lite_prikhozhaya state_not: "paused" - - entity: media_player.yandex_station_lite_prikhozhaya + - condition: state + entity: media_player.yandex_station_lite_prikhozhaya state_not: "idle" card: type: media-control entity: media_player.yandex_station_lite_prikhozhaya - type: conditional conditions: - - entity: media_player.yandex_station_lite_detskaia + - condition: state + entity: media_player.yandex_station_lite_detskaia state_not: "paused" - - entity: media_player.yandex_station_lite_detskaia + - condition: state + entity: media_player.yandex_station_lite_detskaia state_not: "idle" card: type: media-control entity: media_player.yandex_station_lite_detskaia - type: conditional conditions: - - entity: media_player.yandex_station_mini2_gostinaia + - condition: state + entity: media_player.yandex_station_mini2_gostinaia state_not: "paused" - - entity: media_player.yandex_station_mini2_gostinaia + - condition: state + entity: media_player.yandex_station_mini2_gostinaia state_not: "idle" card: type: media-control entity: media_player.yandex_station_mini2_gostinaia - type: conditional conditions: - - entity: media_player.yandex_station_mini2_spalnia + - condition: state + entity: media_player.yandex_station_mini2_spalnia state_not: "paused" - - entity: media_player.yandex_station_mini2_spalnia + - condition: state + entity: media_player.yandex_station_mini2_spalnia state_not: "idle" card: type: media-control @@ -159,14 +171,17 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.tv_remote_show_bedroom + - condition: state + entity: input_boolean.tv_remote_show_bedroom state: "on" card: !include samsung_tv_remote_ue.yaml - type: conditional conditions: - - entity: media_player.ue43ru7470 + - condition: state + entity: media_player.ue43ru7470 state_not: "off" - - entity: media_player.ue43ru7470 + - condition: state + entity: media_player.ue43ru7470 state_not: "unavailable" card: type: media-control @@ -174,9 +189,11 @@ cards: # --- Гостиная - type: conditional conditions: - - entity: media_player.ue46es5507 + - condition: state + entity: media_player.ue46es5507 state_not: "off" - - entity: media_player.ue46es5507 + - condition: state + entity: media_player.ue46es5507 state_not: "unknown" card: type: vertical-stack @@ -189,9 +206,11 @@ cards: # --- Кухня - type: conditional conditions: - - entity: media_player.ue32es5500 + - condition: state + entity: media_player.ue32es5500 state_not: "off" - - entity: media_player.ue32es5500 + - condition: state + entity: media_player.ue32es5500 state_not: "unknown" card: type: vertical-stack @@ -207,9 +226,11 @@ cards: *Детская:* - type: conditional conditions: - - entity: switch.samsungtv_40c5100 + - condition: state + entity: switch.samsungtv_40c5100 state_not: "off" - - entity: switch.samsungtv_40c5100 + - condition: state + entity: switch.samsungtv_40c5100 state_not: "unknown" card: type: vertical-stack @@ -228,7 +249,8 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.tv_remote_show_nursery + - condition: state + entity: input_boolean.tv_remote_show_nursery state: "on" card: !include samsung_tv_remote_c.yaml @@ -240,7 +262,8 @@ cards: ###
Microsoft
- type: conditional conditions: - - entity: media_player.xbox_v_gostinoi + - condition: state + entity: media_player.xbox_v_gostinoi state: "off" card: type: markdown @@ -248,7 +271,8 @@ cards: *Нет включенных устройств...* - type: conditional conditions: - - entity: media_player.xbox_v_gostinoi + - condition: state + entity: media_player.xbox_v_gostinoi state_not: "off" card: type: media-control @@ -262,21 +286,29 @@ cards: ###
Plex
- type: conditional conditions: - - entity: media_player.plex_tv_ue46es5507 + - condition: state + entity: media_player.plex_tv_ue46es5507 state: "unavailable" - - entity: media_player.plex_tv_ue32es5500 + - condition: state + entity: media_player.plex_tv_ue32es5500 state: "unavailable" - - entity: media_player.plex_guest_plex_for_samsung_tv_ue32es5500 + - condition: state + entity: media_player.plex_guest_plex_for_samsung_tv_ue32es5500 state: "unavailable" - - entity: media_player.plex_guest_plex_for_samsung_tv_ue46es5507 + - condition: state + entity: media_player.plex_guest_plex_for_samsung_tv_ue46es5507 state: "unavailable" - - entity: media_player.plex_guest_plex_cast_chromecast + - condition: state + entity: media_player.plex_guest_plex_cast_chromecast state: "unavailable" - - entity: media_player.plex_guest_plex_for_samsung_tv_2019 + - condition: state + entity: media_player.plex_guest_plex_for_samsung_tv_2019 state: "unavailable" - - entity: media_player.plex_guest_plex_for_android_mobile_sm_t295 + - condition: state + entity: media_player.plex_guest_plex_for_android_mobile_sm_t295 state: "unavailable" - - entity: media_player.plex_guest_plex_for_android_mobile_sm_t295_2 + - condition: state + entity: media_player.plex_guest_plex_for_android_mobile_sm_t295_2 state: "unavailable" card: type: markdown @@ -284,72 +316,88 @@ cards: *Все выключенно...* - type: conditional conditions: - - entity: media_player.plex_tv_ue46es5507 + - condition: state + entity: media_player.plex_tv_ue46es5507 state_not: "off" - - entity: media_player.plex_tv_ue46es5507 + - condition: state + entity: media_player.plex_tv_ue46es5507 state_not: "unavailable" card: type: media-control entity: media_player.plex_tv_ue46es5507 - type: conditional conditions: - - entity: media_player.plex_tv_ue32es5500 + - condition: state + entity: media_player.plex_tv_ue32es5500 state_not: "off" - - entity: media_player.plex_tv_ue32es5500 + - condition: state + entity: media_player.plex_tv_ue32es5500 state_not: "unavailable" card: type: media-control entity: media_player.plex_tv_ue32es5500 - type: conditional conditions: - - entity: media_player.plex_guest_plex_for_samsung_tv_ue32es5500 + - condition: state + entity: media_player.plex_guest_plex_for_samsung_tv_ue32es5500 state_not: "off" - - entity: media_player.plex_guest_plex_for_samsung_tv_ue32es5500 + - condition: state + entity: media_player.plex_guest_plex_for_samsung_tv_ue32es5500 state_not: "unavailable" card: type: media-control entity: media_player.plex_guest_plex_for_samsung_tv_ue32es5500 - type: conditional conditions: - - entity: media_player.plex_guest_plex_for_samsung_tv_ue46es5507 + - condition: state + entity: media_player.plex_guest_plex_for_samsung_tv_ue46es5507 state_not: "off" - - entity: media_player.plex_guest_plex_for_samsung_tv_ue46es5507 + - condition: state + entity: media_player.plex_guest_plex_for_samsung_tv_ue46es5507 state_not: "unavailable" card: type: media-control entity: media_player.plex_guest_plex_for_samsung_tv_ue46es5507 - type: conditional conditions: - - entity: media_player.plex_guest_plex_cast_chromecast + - condition: state + entity: media_player.plex_guest_plex_cast_chromecast state_not: "off" - - entity: media_player.plex_guest_plex_cast_chromecast + - condition: state + entity: media_player.plex_guest_plex_cast_chromecast state_not: "unavailable" card: type: media-control entity: media_player.plex_guest_plex_cast_chromecast - type: conditional conditions: - - entity: media_player.plex_guest_plex_for_samsung_tv_2019 + - condition: state + entity: media_player.plex_guest_plex_for_samsung_tv_2019 state_not: "off" - - entity: media_player.plex_guest_plex_for_samsung_tv_2019 + - condition: state + entity: media_player.plex_guest_plex_for_samsung_tv_2019 state_not: "unavailable" card: type: media-control entity: media_player.plex_guest_plex_for_samsung_tv_2019 - type: conditional conditions: - - entity: media_player.plex_guest_plex_for_android_mobile_sm_t295 + - condition: state + entity: media_player.plex_guest_plex_for_android_mobile_sm_t295 state_not: "off" - - entity: media_player.plex_guest_plex_for_android_mobile_sm_t295 + - condition: state + entity: media_player.plex_guest_plex_for_android_mobile_sm_t295 state_not: "unavailable" card: type: media-control entity: media_player.plex_guest_plex_for_android_mobile_sm_t295 - type: conditional conditions: - - entity: media_player.plex_guest_plex_for_android_mobile_sm_t295_2 + - condition: state + entity: media_player.plex_guest_plex_for_android_mobile_sm_t295_2 state_not: "off" - - entity: media_player.plex_guest_plex_for_android_mobile_sm_t295_2 + - condition: state + entity: media_player.plex_guest_plex_for_android_mobile_sm_t295_2 state_not: "unavailable" card: type: media-control @@ -363,7 +411,8 @@ cards: ###
Google
- type: conditional conditions: - - entity: media_player.mini_v_vannoi + - condition: state + entity: media_player.mini_v_vannoi state: "off" card: type: markdown @@ -371,7 +420,8 @@ cards: *Все устройства бездействуют...* - type: conditional conditions: - - entity: media_player.mini_v_vannoi + - condition: state + entity: media_player.mini_v_vannoi state_not: "off" card: type: media-control diff --git a/lovelace/views/vi_new_year.yaml b/lovelace/views/vi_new_year.yaml index de303b0f..572c4092 100644 --- a/lovelace/views/vi_new_year.yaml +++ b/lovelace/views/vi_new_year.yaml @@ -27,7 +27,8 @@ cards: icon: mdi:string-lights - type: conditional conditions: - - entity: automation.new_year_light_scheduled + - condition: state + entity: automation.new_year_light_scheduled state: "on" row: entity: input_datetime.new_year_illumination_on @@ -35,7 +36,8 @@ cards: icon: mdi:clock-time-seven-outline - type: conditional conditions: - - entity: automation.new_year_light_scheduled + - condition: state + entity: automation.new_year_light_scheduled state: "on" row: entity: input_datetime.new_year_illumination_off diff --git a/lovelace/views/vi_security.yaml b/lovelace/views/vi_security.yaml index cedc385c..8b8ea05c 100644 --- a/lovelace/views/vi_security.yaml +++ b/lovelace/views/vi_security.yaml @@ -17,7 +17,8 @@ cards: action: toggle - type: conditional conditions: - - entity: input_boolean.staircase_show_last_person + - condition: state + entity: input_boolean.staircase_show_last_person state: "on" card: type: picture-entity diff --git a/lovelace/views/vi_system.yaml b/lovelace/views/vi_system.yaml index afbf1c45..1d2cbccd 100644 --- a/lovelace/views/vi_system.yaml +++ b/lovelace/views/vi_system.yaml @@ -127,7 +127,8 @@ cards: name: GitHub Autocommit - type: conditional conditions: - - entity: input_boolean.git_autocommit + - condition: state + entity: input_boolean.git_autocommit state: "on" row: entity: timer.git_time_to_push diff --git a/lovelace/views/vi_water.yaml b/lovelace/views/vi_water.yaml index 13b19071..6270c08e 100644 --- a/lovelace/views/vi_water.yaml +++ b/lovelace/views/vi_water.yaml @@ -99,7 +99,8 @@ cards: icon: mdi:water-boiler - type: conditional conditions: - - entity: switch.tplink_smartplug_01 + - condition: state + entity: switch.tplink_smartplug_01 state_not: "off" card: type: "custom:simple-thermostat" diff --git a/packages/country_house/pack_ch_cctv.yaml b/packages/country_house/pack_ch_cctv.yaml index 1d9dbc2f..687e9e0c 100644 --- a/packages/country_house/pack_ch_cctv.yaml +++ b/packages/country_house/pack_ch_cctv.yaml @@ -21,9 +21,9 @@ ch_cctv_pack: sss_reolinkcam_02: turn_on: - service: rest_command.sss_reolinkcam_02_enable + action: rest_command.sss_reolinkcam_02_enable turn_off: - service: rest_command.sss_reolinkcam_02_disable + action: rest_command.sss_reolinkcam_02_disable icon_template: mdi:cctv # Input Booleans @@ -79,43 +79,43 @@ ch_cctv_pack: - alias: "Country House CCTV - Toggle Camera" id: 97f7f60b-61c2-482b-894a-c12704418075 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.coutry_house_presence - action: + actions: choose: - alias: Presence Sensor To On conditions: "{{ trigger.to_state.state == 'on' }}" sequence: - - service: switch.turn_off + - action: switch.turn_off target: entity_id: switch.frigate_srv01_reolinkcam_02 - alias: Presence Sensor To Off conditions: "{{ trigger.to_state.state == 'off' }}" sequence: - - service: switch.turn_on + - action: switch.turn_on target: entity_id: switch.frigate_srv01_reolinkcam_02 - alias: "Country House CCTV - Person detected" id: a0d9386b-ecf4-46f1-92d8-6ad1a777d1d9 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.reolinkcam_02_person_occupancy from: "off" to: "on" - condition: + conditions: - condition: state entity_id: binary_sensor.coutry_house_presence state: "off" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house message: | {{ now().strftime('%d.%m.%Y, %H:%M:%S') }} На даче обнаружен человек: - - service: telegram_bot.send_photo + - action: telegram_bot.send_photo data: target: !secret tlg_group_country_house url: !secret reolinkcam_02_snapshot_url diff --git a/packages/country_house/pack_ch_energy.yaml b/packages/country_house/pack_ch_energy.yaml index 4ca84add..1fc21c2b 100644 --- a/packages/country_house/pack_ch_energy.yaml +++ b/packages/country_house/pack_ch_energy.yaml @@ -323,7 +323,7 @@ ch_energy_pack: # Triggers # Energy Meter Value with modification time - trigger: - - platform: state + - trigger: state entity_id: - input_number.country_house_enegry_meter_value not_to: @@ -351,7 +351,7 @@ ch_energy_pack: # Predict Energy Meter Value (last known energy meter value + daily consumption from shelly em) - trigger: - - platform: state + - trigger: state entity_id: - input_number.country_house_enegry_meter_predicted_value not_to: @@ -374,9 +374,9 @@ ch_energy_pack: # Save Energy Meter Readings for Transfer to MES - trigger: - #- platform: time_pattern + #- trigger: time_pattern # minutes: "/2" - - platform: time + - trigger: time at: "07:15:00" unique_id: 0113570c-f663-4427-84d0-04d284c1c8a3 sensor: @@ -394,7 +394,7 @@ ch_energy_pack: # Modification time for sensor.ch_energy_meter_value_saved_for_transfer - trigger: - - platform: state + - trigger: state entity_id: sensor.ch_energy_meter_value_saved_for_transfer not_to: - unavailable @@ -535,7 +535,7 @@ ch_energy_pack: - alias: Submit period active conditions: "{{ state_attr('sensor.mes_55384_014_37_meter_44259893','submit_period_active') == true }}" sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house title: "*Электроэнергия:*" @@ -544,13 +544,13 @@ ch_energy_pack: - parallel: - sequence: - wait_for_trigger: - platform: event + trigger: event event_type: lkcomu_interrao_push_indications timeout: 180 - if: - "{{ wait.trigger == none }}" then: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house title: "*Электроэнергия:*" @@ -560,14 +560,14 @@ ch_energy_pack: - choose: - conditions: "{{ wait.trigger.event.data['success'] }}" sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house title: "*Электроэнергия:*" message: | ✅ Показания успешно переданы. default: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house parse_mode: html @@ -579,15 +579,15 @@ ch_energy_pack: - sequence: - delay: seconds: 1 - - service: lkcomu_interrao.push_indications - data: - indications: "{{ states('sensor.ch_energy_meter_value_saved_for_transfer') | float(0) }}" + - action: lkcomu_interrao.push_indications target: entity_id: sensor.mes_55384_014_37_meter_44259893 + data: + indications: "{{ states('sensor.ch_energy_meter_value_saved_for_transfer') | float(0) }}" - alias: Submit period not active conditions: "{{ state_attr('sensor.mes_55384_014_37_meter_44259893','submit_period_active') == false }}" sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house title: "*Электроэнергия:*" @@ -601,8 +601,8 @@ ch_energy_pack: # Set current cost per kWh - alias: CH Set current cost per kWh id: 28450e89-7fdf-459d-bcbd-9e3ea9377de7 - trigger: - - platform: state + triggers: + - trigger: state entity_id: sensor.country_house_enegry_cost_mes_t1 not_to: - unavailable @@ -610,20 +610,21 @@ ch_energy_pack: not_from: - unavailable - unknown - condition: + conditions: - "{{ trigger.to_state.state | is_number() }}" - action: - - service: input_number.set_value - data: + actions: + - action: input_number.set_value + target: entity_id: input_number.country_house_enegry_cost_current + data: value: >- {{ trigger.to_state.state | float(0) }} # Adjusting predicted values for Main Energy Meter - alias: CH Set Main Energy Meter values for predict id: 3570493e-c074-4d88-b8ce-a196cb1a60a6 - trigger: - - platform: state + triggers: + - trigger: state entity_id: - input_number.country_house_enegry_meter_value not_to: @@ -632,31 +633,33 @@ ch_energy_pack: not_from: - unavailable - unknown - action: - - service: input_number.set_value - data: + 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) }} # Predict Main Energy Meter - alias: CH Predict energy meter readings id: 36df2266-8486-42de-b42d-d7b956c24e40 - trigger: - - platform: time + triggers: + - trigger: time at: "23:59:55" - action: - - service: input_number.set_value - data: + 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.ch_main_energy_daily_total') | float(0))) | round(2) }} # Push an energy meter reading to MES - alias: CH Push Energy Meter reading id: d20af113-a06c-4eec-a1a0-0a8a4f8f6fa9 - trigger: - - platform: state + triggers: + - trigger: state entity_id: - sensor.ch_energy_meter_value_saved_for_transfer not_to: @@ -665,10 +668,10 @@ ch_energy_pack: not_from: - unavailable - unknown - condition: + conditions: - "{{ (now().strftime('%d') | int(0)) == (states('input_number.country_house_enegry_meter_value_transfer_day') | int(0)) }}" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house title: "*Электроэнергия:*" @@ -678,23 +681,23 @@ ch_energy_pack: Текущее: {{ 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) }} руб. - - service: script.turn_on + - action: script.turn_on target: entity_id: script.ch_push_energy_readings_to_mes # MES - energy meter reading accepted - alias: CH Energy Meter readings accepted notification id: 99ae89c3-a865-4c3b-841c-729bbbc4b447 - trigger: - - platform: state + triggers: + - trigger: state entity_id: - binary_sensor.mes_55384_014_37_meter_44259893_readings_accepted to: "on" not_from: - unavailable - unknown - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house title: "*Электроэнергия:*" diff --git a/packages/country_house/pack_ch_light.yaml b/packages/country_house/pack_ch_light.yaml index 24f4ddef..56636ea0 100644 --- a/packages/country_house/pack_ch_light.yaml +++ b/packages/country_house/pack_ch_light.yaml @@ -19,16 +19,16 @@ ch_light_pack: automation: - alias: "Дача - Включение подсветки двора - Приехали вечером" id: b2d0dfb1-d7c9-42ad-ae66-70e8c8f306c8 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.coutry_house_presence from: "off" to: "on" - condition: + conditions: - condition: time after: "21:00:00" before: "03:00:00" - action: + actions: - action: light.turn_on target: entity_id: @@ -37,11 +37,11 @@ ch_light_pack: - alias: "Дача - Включение подсветки двора - Кнопка Aqara 2" id: 920540ae-bdaf-46e6-b6e1-3a4c179c8abe - trigger: - - platform: state + triggers: + - trigger: state entity_id: sensor.0x00158d00054859d5_action to: single - action: - - service: light.toggle + actions: + - action: light.toggle target: entity_id: light.dacha_dvor diff --git a/packages/country_house/pack_ch_misc.yaml b/packages/country_house/pack_ch_misc.yaml index ff04a29f..d7d915ff 100644 --- a/packages/country_house/pack_ch_misc.yaml +++ b/packages/country_house/pack_ch_misc.yaml @@ -9,14 +9,14 @@ ch_misc_pack: - alias: Дача - Оповещение о повышенной температуре в холодильнике id: c7acbed6-d09b-47ce-a52f-cb6f9ff38765 - trigger: - platform: numeric_state + triggers: + trigger: numeric_state entity_id: sensor.0x00158d000802df91_temperature above: 10 for: minutes: 30 - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house title: "*Внимание!*" @@ -26,25 +26,25 @@ ch_misc_pack: - alias: Дача - Насос - Включение id: 93336fae-64cd-4f48-90a9-5ec2abb6ece3 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.coutry_house_presence from: "off" to: "on" - - platform: state + - trigger: state entity_id: switch.gosund_sp111_01_switch from: "off" to: "on" - condition: "{{ is_state('switch.sonoff_pow_r3_02', 'off') }}" - action: - - service: switch.turn_on + conditions: "{{ is_state('switch.sonoff_pow_r3_02', 'off') }}" + actions: + - action: switch.turn_on target: entity_id: switch.sonoff_pow_r3_02 - alias: Дача - Насос - Оповещение о состоянии id: 5db218dd-eef9-45ab-aa9f-f9e814fdfe62 - trigger: - - platform: state + triggers: + - trigger: state entity_id: switch.sonoff_pow_r3_02 not_from: - unavailable @@ -52,9 +52,9 @@ ch_misc_pack: not_to: - unavailable - unknown - condition: "{{ trigger.to_state.state != trigger.from_state.state }}" - action: - - service: telegram_bot.send_message + conditions: "{{ trigger.to_state.state != trigger.from_state.state }}" + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house title: "*Водяной насос:*" @@ -67,14 +67,14 @@ ch_misc_pack: - alias: Дача - Напоминание после отъезда id: 7596485f-5cf9-4b99-af54-b51672510ab6 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.coutry_house_presence from: "on" to: "off" for: minutes: 30 - condition: + conditions: - or: - condition: template value_template: "{{ is_state('switch.gosund_sp111_01_switch', 'on') }}" @@ -88,8 +88,8 @@ ch_misc_pack: value_template: "{{ is_state('light.dacha_dvor', 'on') }}" - condition: template value_template: "{{ is_state('light.dacha_parkovka', 'on') }}" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house title: "*Внимание!*" @@ -112,59 +112,59 @@ ch_misc_pack: - alias: 'Дача - Telegram Control - Turn Off All When Leave' id: 86da4969-92fa-49c9-aba3-23ab804e7194 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: '/ch_turn_off_all_when_leave' - action: + actions: - parallel: - if: - "{{ is_state('switch.gosund_sp111_01_switch', 'on') }}" then: - - service: switch.turn_off + - action: switch.turn_off target: entity_id: switch.gosund_sp111_01_switch - if: - "{{ is_state('climate.country_house_terrace', 'heat') }}" then: - - service: climate.turn_off + - action: climate.turn_off target: entity_id: climate.country_house_terrace - if: - "{{ is_state('climate.country_house_living_room', 'heat') }}" then: - - service: climate.turn_off + - action: climate.turn_off target: entity_id: climate.country_house_living_room - if: - "{{ is_state('climate.country_house_kids_rooms', 'heat') }}" then: - - service: climate.turn_off + - action: climate.turn_off target: entity_id: climate.country_house_kids_rooms - if: - "{{ is_state('light.dacha_dvor', 'on') }}" then: - - service: light.turn_off + - action: light.turn_off target: entity_id: light.dacha_dvor - if: - "{{ is_state('light.dacha_parkovka', 'on') }}" then: - - service: light.turn_off + - action: light.turn_off target: entity_id: light.dacha_parkovka - - service: telegram_bot.answer_callback_query - data_template: + - action: telegram_bot.answer_callback_query + data: callback_query_id: '{{ trigger.event.data.id }}' message: 'Команда отправлена' - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: '{{ trigger.event.data.message.message_id }}' chat_id: '{{ trigger.event.data.chat_id }}' inline_keyboard: [] - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_country_house message: "Все приборы отключены." \ No newline at end of file diff --git a/packages/country_house/pack_ch_pool.yaml b/packages/country_house/pack_ch_pool.yaml index a4732ad7..7829b5b4 100644 --- a/packages/country_house/pack_ch_pool.yaml +++ b/packages/country_house/pack_ch_pool.yaml @@ -9,25 +9,25 @@ ch_pool_pack: - alias: Дача - Управление фильтром бассейна id: 48bf00c7-ef92-40a9-a724-8628c2004e9d - trigger: - - platform: time + triggers: + - trigger: time at: "06:00:00" id: start - - platform: time + - trigger: time at: "21:00:00" id: stop - - platform: state + - trigger: state entity_id: sensor.0x00158d00054859d5_action to: double id: aqara_button - action: + actions: choose: - alias: Power On Filter conditions: - condition: trigger id: "start" sequence: - - service: switch.turn_on + - action: switch.turn_on target: entity_id: switch.sonoff_basic_04_switch - alias: Power Off Filter @@ -35,7 +35,7 @@ ch_pool_pack: - condition: trigger id: "stop" sequence: - - service: switch.turn_off + - action: switch.turn_off target: entity_id: switch.sonoff_basic_04_switch - alias: Toggle Filter @@ -43,6 +43,6 @@ ch_pool_pack: - condition: trigger id: "aqara_button" sequence: - - service: switch.toggle + - action: switch.toggle target: entity_id: switch.sonoff_basic_04_switch \ No newline at end of file diff --git a/packages/light/pack_light_bathroom.yaml b/packages/light/pack_light_bathroom.yaml index 7645bb47..2cf28443 100644 --- a/packages/light/pack_light_bathroom.yaml +++ b/packages/light/pack_light_bathroom.yaml @@ -17,29 +17,29 @@ bathroom_light_pack: mode: queued max: 10 max_exceeded: silent - trigger: - - platform: state + triggers: + - trigger: state entity_id: timer.bathroom_presence to: "idle" id: "timer_idle" - - platform: state + - trigger: state entity_id: binary_sensor.lumi_lumi_sensor_magnet_on_off id: "magnet" - - platform: state + - trigger: state entity_id: binary_sensor.trust_iaszone to: "on" id: "motion_on" - - platform: state + - trigger: state entity_id: binary_sensor.0xa4c138792ba1d268_presence to: "on" id: "presence_on" - - platform: event + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:03:d1:77:62" command: "click" id: "click" - action: + actions: choose: - alias: Timer Idle conditions: @@ -50,13 +50,13 @@ bathroom_light_pack: - alias: Presence On conditions: "{{ states('binary_sensor.0xa4c138792ba1d268_presence') == 'on' }}" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.bathroom_presence - alias: Motion On conditions: "{{ states('binary_sensor.trust_iaszone') == 'on' }}" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.bathroom_presence - alias: Motion Off @@ -69,25 +69,25 @@ bathroom_light_pack: - parallel: - sequence: - condition: "{{ is_state('light.sonoff_zbmini_04_on_off', 'on') }}" - - service: light.turn_off + - 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') }}" - - service: fan.turn_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') }}" - - service: light.turn_off + - action: light.turn_off target: entity_id: light.sonoff_zbmini_04_on_off - delay: seconds: 0.3 - - service: light.turn_on + - action: light.turn_on target: entity_id: light.sonoff_zbmini_04_on_off - wait_template: "{{ is_state('binary_sensor.trust_iaszone', 'on') }}" @@ -98,13 +98,13 @@ bathroom_light_pack: - parallel: - sequence: - condition: "{{ is_state('light.sonoff_zbmini_04_on_off', 'on') }}" - - service: light.turn_off + - 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') }}" - - service: fan.turn_off + - action: fan.turn_off target: entity_id: fan.bathroom_extractor - alias: Magnet @@ -117,10 +117,10 @@ bathroom_light_pack: conditions: "{{ trigger.from_state.state == 'off' and trigger.to_state.state == 'on' }}" sequence: - condition: "{{ is_state('light.sonoff_zbmini_04_on_off', 'off') }}" - - service: light.turn_on + - action: light.turn_on target: entity_id: light.sonoff_zbmini_04_on_off - - service: timer.start + - action: timer.start target: entity_id: timer.bathroom_presence - alias: To Off @@ -130,14 +130,14 @@ bathroom_light_pack: - sequence: - condition: "{{ is_state('binary_sensor.trust_iaszone', 'off') }}" - condition: "{{ is_state('light.sonoff_zbmini_04_on_off', 'on') }}" - - service: light.turn_off + - 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') }}" - - service: fan.turn_off + - action: fan.turn_off target: entity_id: fan.bathroom_extractor - alias: Presence @@ -145,7 +145,7 @@ bathroom_light_pack: - condition: trigger id: "presence_on" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.bathroom_presence - alias: Motion @@ -153,18 +153,18 @@ bathroom_light_pack: - condition: trigger id: "motion_on" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.bathroom_presence - parallel: - sequence: - condition: "{{ is_state('fan.bathroom_extractor', 'off') }}" - - service: fan.turn_on + - action: fan.turn_on target: entity_id: fan.bathroom_extractor - sequence: - condition: "{{ is_state('light.sonoff_zbmini_04_on_off', 'off') }}" - - service: light.turn_on + - action: light.turn_on target: entity_id: light.sonoff_zbmini_04_on_off - alias: Button @@ -176,7 +176,7 @@ bathroom_light_pack: - alias: Single click conditions: "{{ trigger.event.data.args.click_type == 'single' }}" sequence: - - service: light.toggle + - action: light.toggle data: entity_id: light.sonoff_zbmini_04_on_off - delay: "00:00:02" @@ -184,39 +184,39 @@ bathroom_light_pack: - alias: Light On conditions: "{{ is_state('light.sonoff_zbmini_04_on_off', 'on') }}" sequence: - - service: fan.turn_on + - 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') }}" - - service: fan.turn_off + - action: fan.turn_off target: entity_id: fan.bathroom_extractor - alias: Double click conditions: "{{ trigger.event.data.args.click_type == 'double' }}" sequence: - - service: fan.toggle + - action: fan.toggle target: entity_id: fan.bathroom_extractor - alias: Ванная - вытяжка id: 9c4552b3-11ee-4364-bf40-2b142c5f97e6 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.bathroom_high_humidity to: "on" for: minutes: 3 id: "high_humidity" - - platform: state + - trigger: state entity_id: binary_sensor.bathroom_high_humidity to: "off" for: minutes: 10 id: "normal_humidity" - action: + actions: choose: - alias: High humidity conditions: @@ -224,7 +224,7 @@ bathroom_light_pack: id: "high_humidity" sequence: - condition: "{{ is_state('fan.bathroom_extractor', 'off') }}" - - service: fan.turn_on + - action: fan.turn_on target: entity_id: fan.bathroom_extractor - alias: Normal humidity @@ -233,6 +233,6 @@ bathroom_light_pack: id: "normal_humidity" sequence: - condition: "{{ is_state('fan.bathroom_extractor', 'on') }}" - - service: fan.turn_off + - action: fan.turn_off target: entity_id: fan.bathroom_extractor \ No newline at end of file diff --git a/packages/light/pack_light_bedroom.yaml b/packages/light/pack_light_bedroom.yaml index 724049e8..ced8bc99 100644 --- a/packages/light/pack_light_bedroom.yaml +++ b/packages/light/pack_light_bedroom.yaml @@ -25,7 +25,7 @@ bedroom_light_pack: sunrise_in_bedroom_left: sequence: # Start at brightness 1% and color temp 454 - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -33,7 +33,7 @@ bedroom_light_pack: brightness_pct: 1 - delay: "00:00:05" # Go to brightness 10% in 3 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -41,7 +41,7 @@ bedroom_light_pack: brightness_pct: 10 - delay: "00:03:05" # To color temp 415 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -49,7 +49,7 @@ bedroom_light_pack: color_temp: 415 - delay: "00:01:35" # To brightness 15% in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -57,7 +57,7 @@ bedroom_light_pack: brightness_pct: 15 - delay: "00:01:35" # Color temp 384 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -65,7 +65,7 @@ bedroom_light_pack: color_temp: 384 - delay: "00:01:35" # Brightness 20% in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -73,7 +73,7 @@ bedroom_light_pack: brightness_pct: 20 - delay: "00:01:35" # Color 357 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -81,7 +81,7 @@ bedroom_light_pack: color_temp: 357 - delay: "00:01:35" # Brightness 25% in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -89,7 +89,7 @@ bedroom_light_pack: brightness_pct: 25 - delay: "00:01:35" # Color 333 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -97,7 +97,7 @@ bedroom_light_pack: color_temp: 333 - delay: "00:01:35" # Brightness 30 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 data: @@ -109,26 +109,26 @@ bedroom_light_pack: - alias: "Кнопки IKEA в Спальне" id: ffd8dce9-55d7-449c-a5ed-280604c00930 - trigger: - - platform: event + triggers: + - trigger: event event_type: zha_event event_data: device_ieee: "84:fd:27:ff:fe:90:a6:46" id: "ikea_sw_1" - - platform: event + - trigger: event event_type: zha_event event_data: device_ieee: "84:fd:27:ff:fe:9e:e4:06" id: "ikea_sw_2" - action: + actions: choose: - alias: "command: on" conditions: - condition: template value_template: "{{ trigger.event.data.command == 'on' }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.sonoff_1001053235 - alias: "command: off" conditions: @@ -142,8 +142,8 @@ bedroom_light_pack: entity_id: group.light_spalnia_bra state: "on" sequence: - - service: homeassistant.turn_off - data: + - action: homeassistant.turn_off + target: entity_id: group.light_spalnia_bra - alias: 'If Group is Off' conditions: @@ -151,35 +151,34 @@ bedroom_light_pack: entity_id: group.light_spalnia_bra state: "off" sequence: - - service: homeassistant.turn_on - data: + - 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: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.spalnia_stol - alias: 'command: move' conditions: - condition: template value_template: "{{ trigger.event.data.command == 'move' }}" sequence: - - service: light.turn_off - data: + - action: light.turn_off + target: entity_id: group.all_lamps - alias: "Sunrise Lighting (Bedroom)" id: 35fa00c7-72bd-4a5f-9bef-7bcf13a3bf49 - trigger: - - platform: time + triggers: + - trigger: time at: input_datetime.sunrise_in_bedroom condition: - condition: and - conditions: + - and: - condition: state entity_id: binary_sensor.workday_sensor state: "on" @@ -189,13 +188,13 @@ bedroom_light_pack: - condition: sun before: sunrise before_offset: "00:30:00" - action: - - service: script.turn_on + actions: + - action: script.turn_on target: entity_id: script.sunrise_in_bedroom_left - alias: "Wait for OnePlus presence at livingroom" wait_for_trigger: - - platform: state + - trigger: state entity_id: binary_sensor.living_room_oneplus_8t_presence from: "off" to: "on" @@ -205,12 +204,12 @@ bedroom_light_pack: - if: - "{{ is_state('script.sunrise_in_bedroom_left', 'on') }}" then: - - service: script.turn_off + - 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: - - service: light.turn_off + - action: light.turn_off target: entity_id: light.ikea_of_sweden_tradfri_bulb_e14_ws_opal_600lm_light_2 diff --git a/packages/light/pack_light_common.yaml b/packages/light/pack_light_common.yaml index 2416b509..30b79350 100644 --- a/packages/light/pack_light_common.yaml +++ b/packages/light/pack_light_common.yaml @@ -8,7 +8,7 @@ common_light_pack: template: - trigger: - - platform: state + - trigger: state entity_id: - sensor.xiaomi_lumi_sen_ill_mgl01_illuminance_2 not_to: @@ -32,18 +32,18 @@ common_light_pack: - alias: Turn Off All Light When Nobody at Home id: b06cbc8a-6488-412b-8842-e6c72b004ff1 - trigger: - platform: state + triggers: + trigger: state entity_id: group.family_persons to: "not_home" for: minutes: 5 - condition: + conditions: - condition: state entity_id: group.all_lamps state: "on" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" @@ -55,24 +55,25 @@ common_light_pack: - alias: 'Light - Telegram Control - Turn Off All Lamps' id: a395b9eb-6a18-40bd-a7f4-6e3f133049ba - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: '/turn_off_all_lamps' - action: - - service: homeassistant.turn_off - entity_id: group.all_lamps - - service: telegram_bot.answer_callback_query - data_template: + 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: 'Команда отправлена' - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: '{{ trigger.event.data.message.message_id }}' chat_id: '{{ trigger.event.data.chat_id }}' inline_keyboard: [] - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 message: "Свет выключен." \ No newline at end of file diff --git a/packages/light/pack_light_corridor.yaml b/packages/light/pack_light_corridor.yaml index f5e1fe67..6d19781e 100644 --- a/packages/light/pack_light_corridor.yaml +++ b/packages/light/pack_light_corridor.yaml @@ -12,20 +12,20 @@ corridor_light_pack: mode: queued max: 5 max_exceeded: silent - trigger: - - platform: event + triggers: + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:04:5a:11:53" command: "click" id: "click" - - platform: event + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:04:5a:11:53" command: "hold" id: "hold" - action: + actions: choose: - alias: Action Click conditions: @@ -36,22 +36,22 @@ corridor_light_pack: - alias: Single click conditions: "{{ trigger.event.data.args.click_type == 'single' }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.sonoff_1000f2a500 - alias: Double click conditions: "{{ trigger.event.data.args.click_type == 'double' }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.sonoff_1000f2f14a - alias: Action Hold conditions: - condition: trigger id: "hold" sequence: - - service: light.turn_off - data: + - action: light.turn_off + target: entity_id: - group.light_detskaia - group.light_prikhozhaya diff --git a/packages/light/pack_light_hallway.yaml b/packages/light/pack_light_hallway.yaml index 9cb5d514..7fa3b994 100644 --- a/packages/light/pack_light_hallway.yaml +++ b/packages/light/pack_light_hallway.yaml @@ -18,14 +18,14 @@ hallway_light_pack: mode: queued max: 5 max_exceeded: silent - trigger: - - platform: state + triggers: + - trigger: state entity_id: timer.hallway_light id: "timer" - - platform: state + - trigger: state entity_id: binary_sensor.0x158d00031c790f_contact id: "magnet" - - platform: state + - trigger: state entity_id: binary_sensor.0x158d000309920a_motion id: "motion" action: @@ -43,20 +43,21 @@ hallway_light_pack: - alias: Frigate Presence On conditions: "{{ states('binary_sensor.dafangcam_02_person_occupancy') == 'on' }}" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.hallway_light - alias: Motion On conditions: "{{ states('binary_sensor.0x158d000309920a_motion') == 'on' }}" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.hallway_light - alias: Motion Off conditions: "{{ states('binary_sensor.0x158d000309920a_motion') == 'off' }}" sequence: - - service: light.turn_off - entity_id: light.sonoff_1000f2f14a + - action: light.turn_off + target: + entity_id: light.sonoff_1000f2f14a - alias: Magnet conditions: - condition: trigger @@ -66,9 +67,10 @@ hallway_light_pack: - alias: To On conditions: "{{ trigger.from_state.state == 'off' and trigger.to_state.state == 'on' }}" sequence: - - service: light.turn_on - entity_id: light.sonoff_1000f2f14a - - service: timer.start + - action: light.turn_on + target: + entity_id: light.sonoff_1000f2f14a + - action: timer.start target: entity_id: timer.hallway_light - alias: Motion @@ -80,18 +82,19 @@ hallway_light_pack: - alias: To On conditions: "{{ trigger.to_state.state == 'on' }}" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.hallway_light - condition: state entity_id: light.sonoff_1000f2f14a state: "off" - - service: light.turn_on - entity_id: light.sonoff_1000f2f14a + - action: light.turn_on + target: + entity_id: light.sonoff_1000f2f14a - alias: To Off conditions: "{{ trigger.to_state.state == 'off' }}" sequence: - - service: timer.finish + - action: timer.finish target: entity_id: timer.hallway_light @@ -100,20 +103,20 @@ hallway_light_pack: mode: queued max: 5 max_exceeded: silent - trigger: - - platform: event + triggers: + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:04:5a:11:b1" command: "click" id: "click" - - platform: event + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:04:5a:11:b1" command: "hold" id: "hold" - action: + actions: choose: - alias: Action Click conditions: @@ -124,20 +127,20 @@ hallway_light_pack: - alias: Single click conditions: "{{ trigger.event.data.args.click_type == 'single' }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.sonoff_1000f2f14a - alias: Double click conditions: "{{ trigger.event.data.args.click_type == 'double' }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.sonoff_1000f2a500 - alias: Action Hold conditions: - condition: trigger id: "hold" sequence: - - service: light.turn_off - data: + - action: light.turn_off + target: entity_id: group.all_lamps \ No newline at end of file diff --git a/packages/light/pack_light_kitchen.yaml b/packages/light/pack_light_kitchen.yaml index 0226e538..59fc2201 100644 --- a/packages/light/pack_light_kitchen.yaml +++ b/packages/light/pack_light_kitchen.yaml @@ -18,14 +18,14 @@ kitchen_light_pack: mode: queued max: 5 max_exceeded: silent - trigger: - - platform: event + triggers: + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:03:5f:f6:31" command: "click" id: "click" - action: + actions: choose: - alias: Action Click conditions: @@ -36,38 +36,40 @@ kitchen_light_pack: - alias: Single click conditions: "{{ trigger.event.data.args.click_type == 'single' }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.kukhnia_lenta - alias: Double click conditions: "{{ trigger.event.data.args.click_type == 'double' }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.ikea_e27_kukhnia - alias: "Подсветка на кухне (сенсор движения - вкл)" id: 72c4f7ac-f72c-47fd-bf06-6e3671d12b1d - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.0x158d0003fac0ec_motion to: "on" - condition: + conditions: - condition: numeric_state entity_id: sensor.0x158d0003fac0ec_illuminance below: 10 - action: - service: light.turn_on - entity_id: light.kukhnia_lenta + actions: + action: light.turn_on + target: + entity_id: light.kukhnia_lenta - alias: "Подсветка на кухне (сенсор движения - выкл)" id: 47413029-b8c2-4ec1-ad98-7c72b271766d - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.0x158d0003fac0ec_motion to: "off" for: minutes: 3 - action: - service: light.turn_off - entity_id: light.kukhnia_lenta \ No newline at end of file + actions: + action: light.turn_off + target: + entity_id: light.kukhnia_lenta \ No newline at end of file diff --git a/packages/light/pack_light_livingroom.yaml b/packages/light/pack_light_livingroom.yaml index 22d71527..9ba7be80 100644 --- a/packages/light/pack_light_livingroom.yaml +++ b/packages/light/pack_light_livingroom.yaml @@ -39,20 +39,20 @@ livingroom_light_pack: mode: queued max: 5 max_exceeded: silent - trigger: - - platform: event + triggers: + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:03:5a:9b:c5" command: "click" id: "click" - - platform: event + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:03:5a:9b:c5" command: "hold" id: "hold" - action: + actions: choose: - alias: Action Click conditions: @@ -63,47 +63,47 @@ livingroom_light_pack: - alias: Single click conditions: "{{ trigger.event.data.args.click_type == 'single' }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.sonoff_1000ab3c28 - alias: Double click conditions: "{{ trigger.event.data.args.click_type == 'double' }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.sonoff_1000f3035d - alias: Action Hold conditions: - condition: trigger id: "hold" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.gostinaia_podsvetka_na_okne - alias: "Подсветка на окне в Гостиной" id: 32c18d2f-1d01-4458-b5e2-05048b73a3d7 - trigger: - - platform: numeric_state + triggers: + - trigger: numeric_state entity_id: sensor.outdoor_illuminance below: input_number.livingroom_window_light_illuminance_threshold for: "00:10:00" id: "dark" - - platform: numeric_state + - trigger: numeric_state entity_id: sensor.outdoor_illuminance above: input_number.livingroom_window_light_illuminance_threshold for: "00:10:00" id: "lightly" - - platform: time + - trigger: time at: "00:30:00" id: "time" - - platform: state + - trigger: state entity_id: group.family_persons from: "not_home" to: "home" id: "to_home" - condition: "{{ is_state('input_boolean.livingroom_window_light_auto', 'on') }}" - action: + conditions: "{{ is_state('input_boolean.livingroom_window_light_auto', 'on') }}" + actions: choose: - alias: Darkens (Turn On) conditions: @@ -113,50 +113,48 @@ livingroom_light_pack: - condition: state entity_id: light.gostinaia_podsvetka_na_okne state: "off" - - service: light.turn_on - data: + - action: light.turn_on + target: entity_id: light.gostinaia_podsvetka_na_okne - alias: Brightens (Turn Off) conditions: - - condition: or - conditions: - - condition: trigger - id: "lightly" - - condition: trigger - id: "time" + - or: + - condition: trigger + id: "lightly" + - condition: trigger + id: "time" sequence: - condition: state entity_id: light.gostinaia_podsvetka_na_okne state: "on" - - service: light.turn_off - data: + - action: light.turn_off + target: entity_id: light.gostinaia_podsvetka_na_okne - alias: Came Home conditions: - - condition: and - conditions: - - condition: trigger - id: "to_home" - - condition: numeric_state - entity_id: sensor.outdoor_illuminance - below: input_number.livingroom_window_light_illuminance_threshold + - 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" - - service: light.turn_on - data: + - action: light.turn_on + target: entity_id: light.gostinaia_podsvetka_na_okne - alias: "Пульт IKEA в Гостиной" id: 94f03734-3e9f-47cd-80c6-af9f37236974 mode: restart - trigger: - - platform: event + triggers: + - trigger: event event_type: zha_event event_data: device_ieee: "d0:cf:5e:ff:fe:33:93:f6" - action: + actions: - alias: Set variables variables: target_lamp: "light.ikea_e27_level_light_color_on_off" @@ -164,30 +162,30 @@ livingroom_light_pack: - alias: toggle conditions: "{{ trigger.event.data.command == 'toggle' }}" sequence: - - service: light.toggle + - action: light.toggle target: entity_id: "{{ target_lamp }}" - alias: step_with_on_off conditions: "{{ trigger.event.data.command == 'step_with_on_off' }}" sequence: - - service: light.turn_on - data: - brightness_step: 8 + - 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: - - service: light.turn_on - data: - brightness_step: 8 + - action: light.turn_on target: entity_id: "{{ target_lamp }}" + data: + brightness_step: 8 - wait_for_trigger: - platform: event + trigger: event event_type: zha_event event_data: device_ieee: "{{ trigger.event.data.device_ieee }}" @@ -197,24 +195,24 @@ livingroom_light_pack: - alias: step conditions: "{{ trigger.event.data.command == 'step' }}" sequence: - - service: light.turn_on - data: - brightness_step: -8 + - 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: - - service: light.turn_on - data: - brightness_step: -8 + - action: light.turn_on target: entity_id: "{{ target_lamp }}" + data: + brightness_step: -8 - wait_for_trigger: - platform: event + trigger: event event_type: zha_event event_data: device_ieee: "{{ trigger.event.data.device_ieee }}" @@ -228,23 +226,23 @@ livingroom_light_pack: - alias: left button conditions: "{{ (trigger.event.data.args[0] | int(0)) == 257 }}" sequence: - - service: light.turn_on + - 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) }} - target: - entity_id: "{{ target_lamp }}" - alias: right button conditions: "{{ (trigger.event.data.args[0] | int(0)) == 256 }}" sequence: - - service: light.turn_on + - 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) }} - target: - entity_id: "{{ target_lamp }}" - alias: hold conditions: "{{ trigger.event.data.command == 'hold' }}" sequence: @@ -255,15 +253,15 @@ livingroom_light_pack: repeat: until: "{{ wait.trigger is not none }}" sequence: - - service: light.turn_on + - 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) }} - target: - entity_id: "{{ target_lamp }}" - wait_for_trigger: - platform: event + trigger: event event_type: zha_event event_data: device_ieee: "{{ trigger.event.data.device_ieee }}" @@ -276,15 +274,15 @@ livingroom_light_pack: repeat: until: "{{ wait.trigger is not none }}" sequence: - - service: light.turn_on + - 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) }} - target: - entity_id: "{{ target_lamp }}" - wait_for_trigger: - platform: event + trigger: event event_type: zha_event event_data: device_ieee: "{{ trigger.event.data.device_ieee }}" diff --git a/packages/light/pack_light_nursery.yaml b/packages/light/pack_light_nursery.yaml index 745f0328..fc899710 100644 --- a/packages/light/pack_light_nursery.yaml +++ b/packages/light/pack_light_nursery.yaml @@ -50,7 +50,7 @@ nursery_light_pack: sunrise_in_nursery: sequence: # Start at brightness 1% and color temp 454 - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -58,7 +58,7 @@ nursery_light_pack: brightness_pct: 1 - delay: "00:00:05" # Go to brightness 10% in 3 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -66,7 +66,7 @@ nursery_light_pack: brightness_pct: 10 - delay: "00:03:05" # To color temp 400 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -74,7 +74,7 @@ nursery_light_pack: color_temp: 400 - delay: "00:01:35" # To brightness 20% in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -82,7 +82,7 @@ nursery_light_pack: brightness_pct: 20 - delay: "00:01:35" # Color temp 350 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -90,7 +90,7 @@ nursery_light_pack: color_temp: 350 - delay: "00:01:35" # Brightness 30% in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -98,7 +98,7 @@ nursery_light_pack: brightness_pct: 30 - delay: "00:01:35" # Color 300 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -106,7 +106,7 @@ nursery_light_pack: color_temp: 300 - delay: "00:01:35" # Brightness 40% in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -114,7 +114,7 @@ nursery_light_pack: brightness_pct: 40 - delay: "00:01:35" # Color 270 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -122,7 +122,7 @@ nursery_light_pack: color_temp: 270 - delay: "00:01:35" # Brightness 100 in 1.5 min - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -137,20 +137,20 @@ nursery_light_pack: mode: queued max: 5 max_exceeded: silent - trigger: - - platform: event + triggers: + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:03:3e:fd:9e" command: "click" id: "click" - - platform: event + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:03:3e:fd:9e" command: "hold" id: "hold" - action: + actions: choose: - alias: Action Click conditions: @@ -165,19 +165,19 @@ nursery_light_pack: - alias: Bulb unavailable conditions: "{{ is_state('light.ikea_e27_detskaia', 'unavailable') }}" sequence: - - service: light.turn_off - data: + - action: light.turn_off + target: entity_id: light.sonoff_zbmini_01_on_off - delay: "00:00:01" - - service: light.turn_on - data: + - action: light.turn_on + target: entity_id: light.sonoff_zbmini_01_on_off - wait_for_trigger: - - platform: state + - trigger: state entity_id: light.ikea_e27_detskaia to: "on" timeout: "00:00:30" - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -185,15 +185,15 @@ nursery_light_pack: - alias: Relay off conditions: "{{ is_state('light.sonoff_zbmini_01_on_off', 'off') }}" sequence: - - service: light.turn_on - data: + - action: light.turn_on + target: entity_id: light.sonoff_zbmini_01_on_off - wait_for_trigger: - - platform: state + - trigger: state entity_id: light.ikea_e27_detskaia to: "on" timeout: "00:00:30" - - service: light.turn_on + - action: light.turn_on target: entity_id: light.ikea_e27_detskaia data: @@ -201,15 +201,16 @@ nursery_light_pack: - alias: Relay on conditions: "{{ is_state('light.sonoff_zbmini_01_on_off', 'on') }}" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.ikea_e27_detskaia - alias: Double click conditions: "{{ trigger.event.data.args.click_type == 'double' }}" sequence: - - service: light.turn_on - data_template: + - 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 %} @@ -228,14 +229,16 @@ nursery_light_pack: - alias: Triple click conditions: "{{ trigger.event.data.args.click_type == 'triple' }}" sequence: - - service: light.turn_on - data: + - action: light.turn_on + target: entity_id: light.ikea_e27_detskaia + data: color_temp: 270 - delay: "00:00:00.0500" - - service: light.turn_on - data: + - action: light.turn_on + target: entity_id: light.ikea_e27_detskaia + data: transition: "0.5" brightness: 255 - alias: Action Hold @@ -243,30 +246,30 @@ nursery_light_pack: - condition: trigger id: "hold" sequence: - - service: light.toggle - data: + - action: light.toggle + target: entity_id: light.detskaia_podsvetka_na_okne - alias: "Подсветка на окне в Детской" id: 319b4fe1-b76d-459f-ac43-3187f0c9079a - trigger: - - platform: numeric_state + triggers: + - trigger: numeric_state entity_id: sensor.outdoor_illuminance below: input_number.nursery_window_light_illuminance_threshold for: "00:10:00" id: "dark" - - platform: numeric_state + - trigger: numeric_state entity_id: sensor.outdoor_illuminance above: input_number.nursery_window_light_illuminance_threshold for: "00:10:00" id: "lightly" - - platform: state + - trigger: state entity_id: group.family_persons from: "not_home" to: "home" id: "to_home" - condition: "{{ is_state('input_boolean.nursery_window_light_auto', 'on') }}" - action: + conditions: "{{ is_state('input_boolean.nursery_window_light_auto', 'on') }}" + actions: choose: - alias: Darkens (Turn On) conditions: @@ -276,46 +279,44 @@ nursery_light_pack: - condition: state entity_id: light.detskaia_podsvetka_na_okne state: "off" - - service: light.turn_on - data: + - action: light.turn_on + target: entity_id: light.detskaia_podsvetka_na_okne - alias: Brightens (Turn Off) conditions: - - condition: or - conditions: - - condition: trigger - id: "lightly" + - or: + - condition: trigger + id: "lightly" sequence: - condition: state entity_id: light.detskaia_podsvetka_na_okne state: "on" - - service: light.turn_off - data: + - action: light.turn_off + target: entity_id: light.detskaia_podsvetka_na_okne - alias: Came Home conditions: - - condition: and - conditions: - - condition: trigger - id: "to_home" - - condition: numeric_state - entity_id: sensor.outdoor_illuminance - below: input_number.nursery_window_light_illuminance_threshold + - 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" - - service: light.turn_on - data: + - action: light.turn_on + target: entity_id: light.detskaia_podsvetka_na_okne - alias: "Лампы на столе в Детской" id: 2d312381-a7c3-4d33-874b-d7771d8ff178 - trigger: - - platform: time + triggers: + - trigger: time at: "00:30:00" id: "time_off" - action: + actions: choose: - alias: Time (Turn Off) conditions: @@ -325,23 +326,22 @@ nursery_light_pack: - parallel: - sequence: - condition: "{{ is_state('light.ikea_e14_level_light_color_on_off', 'on') }}" - - service: light.turn_off + - 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') }}" - - service: light.turn_off + - 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 - trigger: - - platform: time + triggers: + - trigger: time at: input_datetime.sunrise_in_nursery - condition: - condition: and - conditions: + conditions: + - and: - condition: state entity_id: binary_sensor.workday_sensor state: "on" @@ -351,27 +351,28 @@ nursery_light_pack: - condition: state entity_id: calendar.semia_alexander_borsiov_school_vacation_egor state: "off" - action: - - service: script.turn_on + actions: + - action: script.turn_on target: entity_id: script.sunrise_in_nursery - alias: "Kids must sleep at night" id: a2e4ec8e-926f-44bf-96fb-0029bd137f32 - trigger: - platform: state + triggers: + trigger: state entity_id: light.ikea_e27_detskaia to: "on" for: minutes: 2 - condition: + conditions: condition: time after: "00:00" before: "06:30" - action: - - service: homeassistant.turn_off - entity_id: light.ikea_e27_detskaia - - service: notify.telegram_group_flat_1 + 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") }}_ автоматически выключен свет в детской. @@ -380,18 +381,19 @@ nursery_light_pack: mode: queued max: 5 max_exceeded: silent - trigger: - - platform: event + triggers: + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:05:29:2a:d9" - action: + actions: choose: - alias: Rotate conditions: "{{ trigger.event.data.command in ('rotate_right', 'rotate_left') }}" sequence: - - service: light.turn_on - entity_id: light.ikea_e14_level_light_color_on_off + - 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)) + @@ -403,7 +405,8 @@ nursery_light_pack: - alias: Flip 90 conditions: "{{ (trigger.event.data.args.flip_degrees | int) == 90 }}" sequence: - - service: light.toggle - entity_id: light.ikea_e14_level_light_color_on_off + - action: light.toggle + target: + entity_id: light.ikea_e14_level_light_color_on_off data: brightness: 255 \ No newline at end of file diff --git a/packages/light/pack_light_storeroom.yaml b/packages/light/pack_light_storeroom.yaml index 149e0c58..c2539d00 100644 --- a/packages/light/pack_light_storeroom.yaml +++ b/packages/light/pack_light_storeroom.yaml @@ -18,17 +18,17 @@ storeroom_light_pack: mode: queued max: 3 max_exceeded: silent - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.lumi_lumi_sensor_magnet_50659603_on_off id: "magnet" - - platform: state + - trigger: state entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_7b4e5f07_ias_zone id: "motion" - - platform: state + - trigger: state entity_id: timer.storeroom_light id: "timer" - action: + actions: choose: - alias: Magnet conditions: @@ -39,15 +39,16 @@ storeroom_light_pack: - alias: To On conditions: "{{ trigger.from_state.state == 'off' and trigger.to_state.state == 'on' }}" sequence: - - service: light.turn_on - entity_id: light.sonoff_1000b6831b - - service: timer.start + - 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: - - service: timer.finish + - action: timer.finish target: entity_id: timer.storeroom_light - alias: Motion @@ -59,14 +60,15 @@ storeroom_light_pack: - alias: To On conditions: "{{ trigger.to_state.state == 'on' }}" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.storeroom_light - condition: state entity_id: light.sonoff_1000b6831b state: "off" - - service: light.turn_on - entity_id: light.sonoff_1000b6831b + - action: light.turn_on + target: + entity_id: light.sonoff_1000b6831b - alias: To Off conditions: "{{ trigger.to_state.state == 'off' }}" sequence: @@ -74,12 +76,13 @@ storeroom_light_pack: - alias: Door closed conditions: "{{ is_state('binary_sensor.lumi_lumi_sensor_magnet_50659603_on_off', 'off') }}" sequence: - - service: light.turn_off - entity_id: light.sonoff_1000b6831b + - 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: - - service: timer.finish + - action: timer.finish target: entity_id: timer.storeroom_light - alias: Timer @@ -94,11 +97,12 @@ storeroom_light_pack: - alias: Motion On conditions: "{{ states('binary_sensor.lumi_lumi_sensor_motion_aq2_7b4e5f07_ias_zone') == 'on' }}" sequence: - - service: timer.start + - 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: - - service: light.turn_off - entity_id: light.sonoff_1000b6831b \ No newline at end of file + - action: light.turn_off + target: + entity_id: light.sonoff_1000b6831b \ No newline at end of file diff --git a/packages/light/pack_light_toilet.yaml b/packages/light/pack_light_toilet.yaml index 5dc8942c..3af166b5 100644 --- a/packages/light/pack_light_toilet.yaml +++ b/packages/light/pack_light_toilet.yaml @@ -18,29 +18,29 @@ toilet_light_pack: mode: queued max: 10 max_exceeded: silent - trigger: - - platform: state + triggers: + - trigger: state entity_id: timer.toilet_presence to: "idle" id: "timer_idle" - - platform: state + - trigger: state entity_id: binary_sensor.lumi_lumi_sensor_magnet_9bef9603_on_off id: "magnet" - - platform: state + - trigger: state entity_id: binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone to: "on" id: "motion_on" - - platform: state + - trigger: state entity_id: binary_sensor.0xa4c138b96f4627bc_presence to: "on" id: "presence_on" - - platform: event + - trigger: event event_type: zha_event event_data: device_ieee: "00:15:8d:00:03:d1:5d:00" command: "click" id: "click" - action: + actions: choose: - alias: Timer Idle conditions: @@ -51,13 +51,13 @@ toilet_light_pack: - alias: Presence On conditions: "{{ states('binary_sensor.0xa4c138b96f4627bc_presence') == 'on' }}" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.bathroom_presence - alias: Motion On conditions: "{{ states('binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone') == 'on' }}" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.toilet_presence - alias: Motion Off @@ -70,24 +70,24 @@ toilet_light_pack: - parallel: - sequence: - condition: "{{ is_state('light.sonoff_zbmini_03_on_off', 'on') }}" - - service: light.turn_off + - action: light.turn_off target: entity_id: light.sonoff_zbmini_03_on_off - sequence: - condition: "{{ is_state('fan.toilet_extractor', 'on') }}" - - service: fan.turn_off + - 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') }}" - - service: light.turn_off + - action: light.turn_off target: entity_id: light.sonoff_zbmini_03_on_off - delay: seconds: 0.3 - - service: light.turn_on + - 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') }}" @@ -98,12 +98,12 @@ toilet_light_pack: - parallel: - sequence: - condition: "{{ is_state('light.sonoff_zbmini_03_on_off', 'on') }}" - - service: light.turn_off + - action: light.turn_off target: entity_id: light.sonoff_zbmini_03_on_off - sequence: - condition: "{{ is_state('fan.toilet_extractor', 'on') }}" - - service: fan.turn_off + - action: fan.turn_off target: entity_id: fan.toilet_extractor - alias: Magnet @@ -116,10 +116,10 @@ toilet_light_pack: conditions: "{{ trigger.from_state.state == 'off' and trigger.to_state.state == 'on' }}" sequence: - condition: "{{ is_state('light.sonoff_zbmini_03_on_off', 'off') }}" - - service: light.turn_on + - action: light.turn_on target: entity_id: light.sonoff_zbmini_03_on_off - - service: timer.start + - action: timer.start target: entity_id: timer.toilet_presence - alias: To Off @@ -127,11 +127,11 @@ toilet_light_pack: sequence: - condition: "{{ is_state('binary_sensor.adurolight_vms_adurolight_f604cd01_ias_zone', 'off') }}" - condition: "{{ is_state('light.sonoff_zbmini_03_on_off', 'on') }}" - - service: light.turn_off + - action: light.turn_off target: entity_id: light.sonoff_zbmini_03_on_off - condition: "{{ is_state('fan.toilet_extractor', 'on') }}" - - service: fan.turn_off + - action: fan.turn_off target: entity_id: fan.toilet_extractor - alias: Presence @@ -139,7 +139,7 @@ toilet_light_pack: - condition: trigger id: "presence_on" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.bathroom_presence - alias: Motion @@ -147,18 +147,18 @@ toilet_light_pack: - condition: trigger id: "motion_on" sequence: - - service: timer.start + - action: timer.start target: entity_id: timer.toilet_presence - parallel: - sequence: - condition: "{{ is_state('fan.toilet_extractor', 'off') }}" - - service: fan.turn_on + - action: fan.turn_on target: entity_id: fan.toilet_extractor - sequence: - condition: "{{ is_state('light.sonoff_zbmini_03_on_off', 'off') }}" - - service: light.turn_on + - action: light.turn_on target: entity_id: light.sonoff_zbmini_03_on_off - alias: Button @@ -170,15 +170,15 @@ toilet_light_pack: - alias: Single click conditions: "{{ trigger.event.data.args.click_type == 'single' }}" sequence: - - service: light.toggle + - action: light.toggle target: entity_id: light.sonoff_zbmini_03_on_off - - service: fan.toggle + - action: fan.toggle target: entity_id: fan.toilet_extractor - alias: Double click conditions: "{{ trigger.event.data.args.click_type == 'double' }}" sequence: - - service: fan.toggle - data: + - action: fan.toggle + target: entity_id: fan.toilet_extractor \ No newline at end of file diff --git a/packages/pack_alice_say.yaml b/packages/pack_alice_say.yaml index c34df295..ac3a421e 100644 --- a/packages/pack_alice_say.yaml +++ b/packages/pack_alice_say.yaml @@ -46,13 +46,14 @@ alice_say_pack: - alias: "Mirror Yandex Station input_select Name to ID" id: 1ec5424e-f770-486c-b4cf-ed29e65dcb36 - trigger: - platform: state + triggers: + trigger: state entity_id: input_select.yandex_station_target_name - action: - - service: input_text.set_value - data: + actions: + - action: input_text.set_value + target: entity_id: input_text.yandex_station_target_id + data: value: > {% if trigger.to_state.state == 'Детская' %} media_player.yandex_station_lite_detskaia @@ -69,7 +70,7 @@ alice_say_pack: yanedx_station_tts_to: sequence: - - service: media_player.play_media + - action: media_player.play_media target: entity_id: "{{ states('input_text.yandex_station_target_id') }}" data: diff --git a/packages/pack_autoreboot.yaml b/packages/pack_autoreboot.yaml index 6955da00..65f7745b 100644 --- a/packages/pack_autoreboot.yaml +++ b/packages/pack_autoreboot.yaml @@ -40,7 +40,7 @@ autoreboot_pack: value_template: "{{ (states('counter.auto_reboot') | int) <= 2 }}" sequence: - alias: Send Notification - service: telegram_bot.send_message + action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -51,23 +51,24 @@ autoreboot_pack: - alias: Wait 15 seconds delay: "00:00:15" - alias: Increase AutoReboot Counter - service: counter.increment - entity_id: counter.auto_reboot + action: counter.increment + target: + entity_id: counter.auto_reboot - if: "{{ (states('counter.auto_reboot') | int) <= 1 }}" then: - alias: Silicon Labs Multiprotocol Add-On - service: hassio.addon_restart + action: hassio.addon_restart data: addon: core_silabs_multiprotocol - alias: Restart HA - service: homeassistant.restart + action: homeassistant.restart - alias: If Auto Reboot Counter > 2 conditions: - condition: template value_template: "{{ (states('counter.auto_reboot') | int) > 2 }}" sequence: - alias: Send Notification - service: telegram_bot.send_message + action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -81,15 +82,15 @@ autoreboot_pack: - alias: "Auto Reboot: Reset Automatic Reboot Counter" id: 950840e8-8ef1-4984-8996-6ddee1f56cb7 - trigger: - - platform: state + triggers: + - trigger: state entity_id: sensor.ha_uptime to: "10" - condition: + conditions: condition: template value_template: "{{ (states('counter.auto_reboot') | int) > 0 }}" - action: - - service: counter.set_value + actions: + - action: counter.set_value target: entity_id: counter.auto_reboot data: @@ -97,19 +98,20 @@ autoreboot_pack: - alias: "Auto Reboot: Telegram Control - Cancel Auto Reboot" id: 5524cadd-7b96-41f8-b489-90782e17af80 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: '/cancel_auto_reboot' - action: - - service: script.turn_off - entity_id: script.auto_reboot_by_errors_after_boot - - service: telegram_bot.answer_callback_query - data_template: + 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: 'Команда отправлена' - - service: telegram_bot.edit_message + - action: telegram_bot.edit_message data: message_id: '{{ trigger.event.data.message.message_id }}' chat_id: '{{ trigger.event.data.chat_id }}' diff --git a/packages/pack_ble_presence.yaml b/packages/pack_ble_presence.yaml index dd11389f..e849ace1 100644 --- a/packages/pack_ble_presence.yaml +++ b/packages/pack_ble_presence.yaml @@ -72,32 +72,32 @@ ble_presence_pack: - alias: Forgotten car key - Alex id: abdaa9e1-cfbc-4c00-b22c-db82f01cd214 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.amazfit_gtr_4_presence from: "on" to: "off" - condition: + 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" - action: + actions: - wait_template: "{{ is_state('binary_sensor.holy_iot_white_1_presence', 'off') }}" timeout: "00:00:30" - if: - "{{ not wait.completed }}" then: - parallel: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_stall_id parse_mode: html title: "Внимание!" message: "Возможно, ты забыл ключ от машины!" - - service: notify.mobile_app_kb2003 + - action: notify.mobile_app_kb2003 data: title: "Ключ от машины!" message: "Возможно, ты забыл ключ от машины..." @@ -111,12 +111,12 @@ ble_presence_pack: - alias: Forgotten school pass reminder - Egor id: 0a72e0b9-d7f2-41b9-90b3-5d1a601de887 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.0x158d00031c790f_contact from: "on" to: "off" - condition: + conditions: - condition: time after: "07:30:00" before: "08:30:00" @@ -129,20 +129,20 @@ ble_presence_pack: - condition: state entity_id: binary_sensor.holy_iot_green_1_presence state: "on" - action: + actions: - wait_template: "{{ is_state('binary_sensor.holy_iot_green_1_presence', 'off') }}" timeout: "00:00:30" - if: - "{{ not wait.completed }}" then: - parallel: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 parse_mode: html title: "Внимание!" message: "Возможно, Егор забыл пропуск в школу..." - - service: notify.mobile_app_kb2003 + - action: notify.mobile_app_kb2003 data: title: "Пропуск в школу!" message: "Возможно, Егор забыл пропуск в школу..." @@ -153,8 +153,9 @@ ble_presence_pack: importance: max color: red clickAction: entityId:binary_sensor.holy_iot_green_1_presence - - service: media_player.play_media - entity_id: media_player.yandex_station_lite_prikhozhaya + - action: media_player.play_media + target: + entity_id: media_player.yandex_station_lite_prikhozhaya data: media_content_id: "Внимание, возможно, Егор забыл пропуск в школу!" media_content_type: text diff --git a/packages/pack_cctv.yaml b/packages/pack_cctv.yaml index 33481565..a1e86978 100644 --- a/packages/pack_cctv.yaml +++ b/packages/pack_cctv.yaml @@ -14,7 +14,7 @@ cctv_pack: template: - trigger: - - platform: webhook + - trigger: webhook webhook_id: !secret sss_reolinkcam_01_webhook local_only: true unique_id: b0db0ecc-27e6-46aa-b157-640f02effd80 @@ -56,7 +56,7 @@ cctv_pack: example: "326a677d-cdeb-46b6-bd34-0e8293a1c121.jpg" sequence: - parallel: - - service: media_player.play_media + - action: media_player.play_media target: entity_id: media_player.yandex_station_lite_prikhozhaya data: @@ -76,7 +76,7 @@ cctv_pack: {% else -%} 0.7 {% endif -%} - - service: telegram_bot.send_photo + - action: telegram_bot.send_photo data: target: !secret tlg_group_flat_1 url: >- @@ -87,43 +87,43 @@ cctv_pack: - alias: Catch Possible Frigate FFmpeg Errors id: ad6c6761-94ba-4edb-b744-b844c5f0d2d6 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.frigate_reolinkcam_02_ffmpeg_problem from: "off" to: "on" - action: + actions: - parallel: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Frigate Warning!*" message: | Возможна проблема с камерой Reolink 02, будет выполнена попытка перезагрузки Frigate. - - service: shell_command.restart_frigate_srv01 + - action: shell_command.restart_frigate_srv01 - alias: Движение в детской id: 6166ef07-c478-44e3-a226-24d7737d6646 initial_state: false - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.0x158d00044cea8e_motion from: "off" to: "on" - action: - - service: notify.telegram_group_flat_1 + actions: + - action: notify.telegram_group_flat_1 data: message: "В *Детской* обнаружено движение:" - - service: notify.telegram_group_flat_1 - data_template: + - action: notify.telegram_group_flat_1 + data: message: "Camera Snapshot 1" data: photo: - url: !secret dafangcam_03_snapshot_url - delay: seconds: 1 - - service: notify.telegram_group_flat_1 + - action: notify.telegram_group_flat_1 data: message: "Camera Snapshot 2" data: @@ -131,7 +131,7 @@ cctv_pack: - url: !secret dafangcam_03_snapshot_url - delay: seconds: 1 - - service: notify.telegram_group_flat_1 + - action: notify.telegram_group_flat_1 data: message: "Camera Snapshot 3" data: @@ -140,62 +140,64 @@ cctv_pack: - alias: "Вкл контроль движения в детской" id: f46ce78b-11b1-42e9-b217-34ed6eabb7bb - trigger: - platform: time + triggers: + trigger: time at: "23:30:00" - action: - - service: automation.turn_on - entity_id: automation.dvizhenie_v_detskoi + actions: + - action: automation.turn_on + target: + entity_id: automation.dvizhenie_v_detskoi - alias: "Выкл контроль движения в детской" id: 0ffb0c86-cd64-4990-9571-da1799709488 - trigger: - platform: time + triggers: + trigger: time at: "07:00:00" - action: - - service: automation.turn_off - entity_id: automation.dvizhenie_v_detskoi + actions: + - action: automation.turn_off + target: + entity_id: automation.dvizhenie_v_detskoi - alias: Вход в квартиру id: 47a5b56e-5c41-4ae6-a3c2-25984c67b1b5 - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.0x158d00031c790f_contact from: "off" to: "on" - condition: + conditions: - condition: state entity_id: binary_sensor.0x158d000309920a_motion state: "off" - action: + actions: - delay: seconds: 3 - - service: notify.telegram_group_flat_1 - data_template: + - action: notify.telegram_group_flat_1 + data: message: "Camera Snapshot 1" data: photo: - url: !secret dafangcam_02_snapshot_url - delay: seconds: 1 - - service: notify.telegram_group_flat_1 - data_template: + - action: notify.telegram_group_flat_1 + data: message: "Camera Snapshot 2" data: photo: - url: !secret dafangcam_02_snapshot_url - delay: seconds: 2 - - service: notify.telegram_group_flat_1 - data_template: + - action: notify.telegram_group_flat_1 + data: message: "Camera Snapshot 3" data: photo: - url: !secret dafangcam_02_snapshot_url - delay: seconds: 3 - - service: notify.telegram_group_flat_1 - data_template: + - action: notify.telegram_group_flat_1 + data: message: "Camera Snapshot 4" data: photo: @@ -203,60 +205,60 @@ cctv_pack: - alias: "DafangCam-02 Turn Off Night Mode by Light" id: ff6813b7-a4a7-4682-bacb-c28290e43f88 - trigger: - platform: state + triggers: + trigger: state entity_id: light.sonoff_1000f2f14a to: "on" - action: - - service: switch.turn_off - data: + actions: + - action: switch.turn_off + target: entity_id: switch.dafangcam02_night_mode - - service: switch.turn_on - data: + - action: switch.turn_on + target: entity_id: switch.dafangcam02_ir_filter - - service: switch.turn_off - data: + - action: switch.turn_off + target: entity_id: switch.dafangcam02_ir_led - alias: "Staircase - Person detected" id: 56d572c7-3750-4988-8294-aa241a4f4b31 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.reolinkcam_01_person_occupancy from: "off" to: "on" - action: + actions: - parallel: - sequence: - delay: seconds: 1 - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_staircase message: | {{ now().strftime('%d.%m.%Y, %H:%M:%S') }} Обнаружен человек на лестничной клетке: - - service: telegram_bot.send_photo + - action: telegram_bot.send_photo data: target: !secret tlg_group_staircase url: !secret reolinkcam_01_snapshot_url verify_ssl: false - sequence: - - service: telegram_bot.send_video + - 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 - trigger: - platform: event + triggers: + trigger: event event_type: folder_watcher event_data: event_type: deleted file: staircase_movement.mp4.tmp - action: - - service: telegram_bot.send_video + actions: + - action: telegram_bot.send_video data: target: !secret tlg_group_staircase file: /config/video/staircase_movement.mp4 @@ -267,8 +269,8 @@ cctv_pack: id: 1550b036-824f-47d8-9dcf-674b475c5060 mode: single max_exceeded: silent - trigger: - - platform: mqtt + triggers: + - trigger: mqtt topic: frigate_srv01/events payload: "reolinkcam_01" value_template: "{{ value_json['after']['camera'] }}" @@ -278,17 +280,17 @@ cctv_pack: target_chat: !secret tlg_group_staircase type: "{{ trigger.payload_json['type'] }}" base_url: !secret external_url - condition: + conditions: - "{{ type != 'end' }}" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: "{{ target_chat }}" message: | {{ now().strftime('%d.%m.%Y, %H:%M:%S') }} Обнаружено движение на лестничной клетке, (ID: {{ id }}): - - service: telegram_bot.send_photo + - action: telegram_bot.send_photo data: target: "{{ target_chat }}" url: >- @@ -296,7 +298,7 @@ cctv_pack: - repeat: sequence: - wait_for_trigger: - - platform: mqtt + - trigger: mqtt topic: frigate_srv01/events payload: "{{ id }}" value_template: "{{ value_json['after']['id'] }}" @@ -305,7 +307,7 @@ cctv_pack: continue_on_timeout: false - condition: template value_template: "{{ wait.trigger.payload_json['type'] == 'end' }}" - - service: telegram_bot.send_video + - action: telegram_bot.send_video data: target: "{{ target_chat }}" url: >- @@ -316,27 +318,27 @@ cctv_pack: id: 8431232f-319a-4184-94e9-bc070403eec4 mode: queued max: 5 - trigger: - - platform: state + triggers: + - trigger: state entity_id: sensor.double_take_alexander_b to: "dafangcam_02" id: "alex" - - platform: state + - trigger: state entity_id: sensor.double_take_irina_b to: "dafangcam_02" id: "irina" - condition: + conditions: - condition: template value_template: >- {{ (as_timestamp(now()) - as_timestamp(as_local(states['binary_sensor.0x158d00031c790f_contact'].last_changed))) < 90 }} - action: + 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: - - service: script.homecoming_greeting + - action: script.homecoming_greeting data: pers_name: "Александр" match_filename: "{{ trigger.to_state.attributes.match.filename }}" @@ -345,7 +347,7 @@ cctv_pack: - "{{ is_state('person.irina', 'home') }}" - "{{ (as_timestamp(now()) - as_timestamp(as_local(states.person.irina.last_changed))) < 600 }}" sequence: - - service: script.homecoming_greeting + - action: script.homecoming_greeting data: pers_name: "Ирина" match_filename: "{{ trigger.to_state.attributes.match.filename }}" diff --git a/packages/pack_climate.yaml b/packages/pack_climate.yaml index e1e746b4..976d1ff8 100644 --- a/packages/pack_climate.yaml +++ b/packages/pack_climate.yaml @@ -355,8 +355,8 @@ climate_pack: id: a50dc6a0-b2d1-45d9-bab8-7fc62e43fb05 mode: queued max: 10 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.central_heating_nursery id: nursery not_to: @@ -365,7 +365,7 @@ climate_pack: not_from: - unavailable - unknown - - platform: state + - trigger: state entity_id: binary_sensor.central_heating_livingroom id: livingroom not_to: @@ -374,7 +374,7 @@ climate_pack: not_from: - unavailable - unknown - - platform: state + - trigger: state entity_id: binary_sensor.central_heating_kitchen id: kitchen not_to: @@ -383,7 +383,7 @@ climate_pack: not_from: - unavailable - unknown - - platform: state + - trigger: state entity_id: binary_sensor.central_heating_bedroom id: bedroom not_to: @@ -392,9 +392,9 @@ climate_pack: not_from: - unavailable - unknown - condition: "{{ states('sensor.ha_uptime') != '0' }}" - action: - - service: telegram_bot.send_message + conditions: "{{ states('sensor.ha_uptime') != '0' }}" + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" @@ -411,18 +411,18 @@ climate_pack: # Детская ####################################### - alias: Thermo alert [Nursery] id: bb3a7df3-3e20-4ebe-8b49-bc9ba69ad2b6 - trigger: - - platform: template + triggers: + - trigger: template value_template: "{{ (states('sensor.temperature_in_nursery') | float(0)) < 22 }}" for: minutes: 5 - - platform: template + - trigger: template value_template: "{{ (states('sensor.temperature_in_nursery') | float(0)) > 25 }}" for: minutes: 5 - action: - - service: notify.telegram_group_flat_1 - data_template: + actions: + - action: notify.telegram_group_flat_1 + data: message: >- В *Детской* {% if (trigger.to_state.state | float(0)) > 23 -%} жарко, @@ -432,18 +432,18 @@ climate_pack: # Гостиная ###################################### - alias: Thermo alert [Living Room] id: 0e135e8d-3ad5-40cb-9d8f-9ab3df6b91bd - trigger: - - platform: template + triggers: + - trigger: template value_template: "{{ (states('sensor.temperature_in_livingroom') | float(0)) < 22 }}" for: minutes: 5 - - platform: template + - trigger: template value_template: "{{ (states('sensor.temperature_in_livingroom') | float(0)) > 25 }}" for: minutes: 5 - action: - - service: notify.telegram_group_flat_1 - data_template: + actions: + - action: notify.telegram_group_flat_1 + data: message: >- В *Гостиной* {% if (trigger.to_state.state | float(0)) > 23 -%} жарко, @@ -453,18 +453,18 @@ climate_pack: # Спальня ####################################### - alias: Thermo alert [Bedroom] id: 524b5b92-0f5d-4429-88d2-9903ec325389 - trigger: - - platform: template + triggers: + - trigger: template value_template: "{{ (states('sensor.temperature_in_bedroom') | float(0)) < 21 }}" for: minutes: 5 - - platform: template + - trigger: template value_template: "{{ (states('sensor.temperature_in_bedroom') | float(0)) > 24.5 }}" for: minutes: 5 - action: - - service: notify.telegram_group_flat_1 - data_template: + actions: + - action: notify.telegram_group_flat_1 + data: message: >- В *Спальне* {% if (trigger.to_state.state | float(0)) > 23 -%} жарко, @@ -475,8 +475,8 @@ climate_pack: # Оповещения о долгой работе кондиционеров ###### - alias: AC - long running [8h] id: 09f64418-db04-4327-a714-57d9ea39d1ed - trigger: - platform: state + triggers: + trigger: state entity_id: - binary_sensor.0x158d00039cf974_contact - binary_sensor.0x158d0003d54725_contact @@ -485,16 +485,16 @@ climate_pack: to: "on" for: hours: 8 - action: - service: notify.telegram_group_flat_1 - data_template: + 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 - trigger: - platform: state + triggers: + trigger: state entity_id: - binary_sensor.0x158d00039cf974_contact - binary_sensor.0x158d0003d54725_contact @@ -503,16 +503,16 @@ climate_pack: to: "on" for: hours: 16 - action: - service: notify.telegram_group_flat_1 - data_template: + 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 - trigger: - platform: state + triggers: + trigger: state entity_id: - binary_sensor.0x158d00039cf974_contact - binary_sensor.0x158d0003d54725_contact @@ -521,9 +521,9 @@ climate_pack: to: "on" for: hours: 24 - action: - service: notify.telegram_group_flat_1 - data_template: + actions: + action: notify.telegram_group_flat_1 + data: message: > Внимание, *{{ trigger.to_state.attributes.friendly_name.replace('Геркон ','').replace(' on_off','') }}* работает больше *24* часов. @@ -532,21 +532,21 @@ climate_pack: id: 5c2a3b8f-9bc7-4c73-a0b7-62f53e2d8d4a mode: queued max: 10 - trigger: - - platform: template + triggers: + - trigger: template value_template: "{{ (states('sensor.co2_in_nursery') | int(0)) >= 1000 }}" # Детская for: minutes: 10 - - platform: template + - trigger: template value_template: "{{ (states('sensor.co2_in_livingroom') | int(0)) >= 1000 }}" # Гостиная for: minutes: 10 - - platform: template + - trigger: template value_template: "{{ (states('sensor.co2_in_bedroom') | int(0)) >= 1000 }}" # Спальня for: minutes: 10 - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" diff --git a/packages/pack_domofon.yaml b/packages/pack_domofon.yaml index b0ec32e0..d3c26e5e 100644 --- a/packages/pack_domofon.yaml +++ b/packages/pack_domofon.yaml @@ -15,65 +15,65 @@ domofon_pack: - alias: Domofon - Opened by Button Notification id: cb5e25c1-dcb7-4b75-a6c4-6b12eb84f86b - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.domofon_button to: "on" - condition: + conditions: - condition: state entity_id: binary_sensor.domofon_incoming_call state: "on" - action: - service: notify.telegram_group_flat_1 + actions: + action: notify.telegram_group_flat_1 data: message: "_Домофон_: открыт кнопкой" - alias: Domofon - Incoming Call Notification id: 741a9858-1687-4b2d-8afd-73373e8cc8ba - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.domofon_incoming_call to: "on" - action: + actions: - parallel: - - service: notify.telegram_group_flat_1 + - 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' }}" - - service: script.domofon_alice_notify + - action: script.domofon_alice_notify - alias: Domofon - Alice Intent control - trigger: - - platform: event + triggers: + - trigger: event event_type: yandex_intent event_data: text: Открой домофон id: "open" - action: + actions: choose: - alias: Open Door conditions: - condition: trigger id: "open" sequence: - - service: esphome.domofon_accept_call + - action: esphome.domofon_accept_call - alias: Domofon - Telegram Control - domofon_open id: 99d5c580-c382-48b3-bd2d-f6eb00b62c31 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/domofon_open" - action: - - service: telegram_bot.answer_callback_query + 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 'Нет входящего звонка' }}" - - service: esphome.domofon_accept_call - - service: telegram_bot.edit_message + - 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 }}" @@ -83,18 +83,18 @@ domofon_pack: - alias: Domofon - Telegram Control - domofon_reject id: a50fb75b-0083-4866-8496-bdd013332a88 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/domofon_reject" - action: - - service: telegram_bot.answer_callback_query + 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 'Нет входящего звонка' }}" - - service: esphome.domofon_reject_call - - service: telegram_bot.edit_message + - 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 }}" @@ -104,13 +104,13 @@ domofon_pack: - alias: Domofon - Mute and UnMute by Time id: 97a74c5f-6a9f-4af6-9f8e-2a7fcd0a5070 - trigger: + triggers: - platform: time at: "21:00:00" - platform: time at: "08:00:00" - action: - - service: >- + actions: + - action: >- {% if trigger.now.hour == 21 -%} switch.turn_on {% elif trigger.now.hour == 8 -%} @@ -121,8 +121,8 @@ domofon_pack: - alias: Domofon - ESP Board Lost Connection id: 6cac01e7-945c-4f37-8b2d-d75e03107d76 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.domofon_status not_to: - unavailable @@ -130,15 +130,15 @@ domofon_pack: not_from: - unavailable - unknown - condition: + conditions: - condition: template value_template: >- {{ states('input_boolean.ha_shutdown') == 'off' }} - condition: template value_template: >- {{ states('sensor.ha_uptime') > '1' }} - action: - - service: notify.telegram_group_system + actions: + - action: notify.telegram_group_system data: message: | *Внимание!* @@ -150,14 +150,13 @@ domofon_pack: - alias: Domofon - Open Once for Couriers id: c916925d-cd33-4f30-882b-4049e52acf12 - trigger: - - platform: state + triggers: + - trigger: state entity_id: - sensor.kb2003_last_notification - sensor.2109119dg_last_notification condition: - condition: or - conditions: + - or: - condition: template value_template: >- {{ trigger.to_state.state | regex_search('Курьер .* будет у вас в течение .*') }} @@ -185,11 +184,11 @@ domofon_pack: - condition: template value_template: >- {{ trigger.to_state.state | regex_search('И уже спешит доставить его вам') }} - action: - - service: switch.turn_on - data: + actions: + - action: switch.turn_on + target: entity_id: switch.domofon_automatically_open_once - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 message: "_Домофон_: Курьер уже в пути, домофон откроется автоматически." @@ -198,20 +197,20 @@ domofon_pack: - alias: Domofon - Telegram Control - domofon_mute_once id: 97093f78-f059-4918-b451-ca50f698a49d - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/domofon_mute_once" - action: - - service: telegram_bot.answer_callback_query + actions: + - action: telegram_bot.answer_callback_query data: callback_query_id: "{{ trigger.event.data.id }}" message: "Команда отправлена" - - service: switch.turn_on - data: + - action: switch.turn_on + target: entity_id: switch.domofon_mute_sound_once - - service: telegram_bot.edit_message + - action: telegram_bot.edit_message data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" @@ -222,25 +221,25 @@ domofon_pack: - alias: Domofon - Open Once at Enter to Home Zone id: 40d4a1f6-576c-438a-b20f-ba161d9bd3ee max_exceeded: silent - trigger: - - platform: zone + triggers: + - trigger: zone entity_id: - person.alexander - person.irina zone: zone.domofon event: enter - action: - - service: switch.turn_on - data: + actions: + - action: switch.turn_on + target: entity_id: switch.domofon_automatically_open_once - - service: switch.turn_on - data: + - action: switch.turn_on + target: entity_id: switch.domofon_mute_sound_once - - service: notify.telegram_group_flat_1 + - action: notify.telegram_group_flat_1 data: message: "_Домофон_: включен режим однократного авто-открытия." - wait_for_trigger: - - platform: state + - trigger: state entity_id: binary_sensor.0x158d00031c790f_contact to: "on" timeout: "00:10:00" @@ -248,13 +247,13 @@ domofon_pack: - conditions: >- {{ is_state('switch.domofon_automatically_open_once', 'on') }} sequence: - - service: switch.turn_off - data: + - action: switch.turn_off + target: entity_id: switch.domofon_automatically_open_once - - service: switch.turn_off - data: + - action: switch.turn_off + target: entity_id: switch.domofon_mute_sound_once - - service: notify.telegram_group_flat_1 + - action: notify.telegram_group_flat_1 data: message: "_Домофон_: отключен режим однократного авто-открытия." @@ -262,9 +261,10 @@ domofon_pack: domofon_alice_notify: sequence: - - service: media_player.volume_set - data: + - action: media_player.volume_set + target: entity_id: media_player.yandex_station_mini2_gostinaia + data: volume_level: >- {% set time = now().hour -%} {% if time >= 21 or time < 9 -%} @@ -272,8 +272,9 @@ domofon_pack: {% else -%} 0.6 {% endif -%} - - service: media_player.play_media - entity_id: media_player.yandex_station_mini2_gostinaia + - action: media_player.play_media + target: + entity_id: media_player.yandex_station_mini2_gostinaia data: media_content_id: >- {% set time = now().hour -%} @@ -284,7 +285,7 @@ domofon_pack: {% endif -%} media_content_type: dialog:Домашний Ассистент:Домофон - wait_for_trigger: - platform: event + trigger: event event_type: yandex_intent event_data: session: @@ -296,24 +297,26 @@ domofon_pack: - conditions: "{{ wait.trigger.event.data.text in ['да','конечно' ,'открой', 'открыть', 'открывай'] }}" sequence: - parallel: - - service: esphome.domofon_accept_call - - service: media_player.play_media - entity_id: media_player.yandex_station_mini2_gostinaia + - action: esphome.domofon_accept_call + - action: media_player.play_media + target: + entity_id: media_player.yandex_station_mini2_gostinaia data: media_content_id: "Открываю" media_content_type: text - - service: notify.telegram_group_flat_1 + - action: notify.telegram_group_flat_1 data: message: "_Домофон_: открыт Алисой." - conditions: "{{ wait.trigger.event.data.text in ['нет'] }}" sequence: - parallel: - - service: esphome.domofon_reject_call - - service: media_player.play_media - entity_id: media_player.yandex_station_mini2_gostinaia + - action: esphome.domofon_reject_call + - action: media_player.play_media + target: + entity_id: media_player.yandex_station_mini2_gostinaia data: media_content_id: "Звонок сброшен" media_content_type: text - - service: notify.telegram_group_flat_1 + - action: notify.telegram_group_flat_1 data: message: "_Домофон_: звонок сброшен Алисой." \ No newline at end of file diff --git a/packages/pack_doorbell.yaml b/packages/pack_doorbell.yaml index d5746676..4b552452 100644 --- a/packages/pack_doorbell.yaml +++ b/packages/pack_doorbell.yaml @@ -37,33 +37,34 @@ doorbell_pack: id: 420fe43c-f00d-46b6-a787-032b0c58bd47 mode: single max_exceeded: silent - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.doorbell_ringing to: "on" - action: + actions: - choose: - alias: Mute On conditions: "{{ is_state('input_boolean.doorbell_mute', 'on') }}" sequence: - - service: switch.turn_on - data: + - action: switch.turn_on + target: entity_id: switch.galaxy_tab_a_8_0_2019_screen - - service: button.press + - action: button.press target: entity_id: button.galaxy_tab_a_8_0_2019_load_start_url - - service: telegram_bot.send_photo + - action: telegram_bot.send_photo data: target: !secret tlg_group_flat_1 url: !secret reolinkcam_01_snapshot_url verify_ssl: false caption: "*Внимание*, в дверь звонят! _(звонок отключен)_" - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 message: !secret look_at_cam_reolinkcam_01 - - service: media_player.play_media - entity_id: media_player.yandex_station_mini2_gostinaia + - action: media_player.play_media + target: + entity_id: media_player.yandex_station_mini2_gostinaia data: media_content_id: "Внимание, в дверь звонят!" media_content_type: text @@ -76,43 +77,43 @@ doorbell_pack: is_state('switch.sonoff_mini_r2_01_doorbell','off') }} sequence: - - service: switch.turn_on + - action: switch.turn_on target: entity_id: switch.sonoff_mini_r2_01_doorbell - - service: switch.turn_on - data: + - action: switch.turn_on + target: entity_id: switch.galaxy_tab_a_8_0_2019_screen - - service: button.press + - action: button.press target: entity_id: button.galaxy_tab_a_8_0_2019_load_start_url - - service: telegram_bot.send_photo + - action: telegram_bot.send_photo data: target: !secret tlg_group_flat_1 url: !secret reolinkcam_01_snapshot_url verify_ssl: false caption: "*Внимание*, в дверь звонят!" - - service: telegram_bot.send_message + - 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 - trigger: - - platform: time + triggers: + - trigger: time at: "21:00:00" id: "turn_on" - - platform: time + - trigger: time at: "08:00:00" id: "turn_off" - action: + actions: choose: - alias: Mute On conditions: - condition: trigger id: "turn_on" sequence: - - service: input_boolean.turn_on + - action: input_boolean.turn_on target: entity_id: input_boolean.doorbell_mute - alias: Mute Off @@ -120,20 +121,20 @@ doorbell_pack: - condition: trigger id: "turn_off" sequence: - - service: input_boolean.turn_off + - action: input_boolean.turn_off target: entity_id: input_boolean.doorbell_mute # - alias: "Doorbell - Send recorded video" # id: 0d35b362-6bf4-4741-94c0-c5ec852bd8c5 -# trigger: -# platform: event +# triggers: +# trigger: event # event_type: folder_watcher # event_data: # event_type: moved # dest_path: /config/video/doorbel.mp4 -# action: -# - service: telegram_bot.send_video +# actions: +# - action: telegram_bot.send_video # data: # target: !secret tlg_group_flat_1 # file: /config/video/doorbel.mp4 diff --git a/packages/pack_energy.yaml b/packages/pack_energy.yaml index 1b67eac2..423357a2 100644 --- a/packages/pack_energy.yaml +++ b/packages/pack_energy.yaml @@ -825,21 +825,21 @@ energy_pack: # --- Set energy tariffs start time --- - alias: Energy - Apartment - Set Start Time of Tariffs id: 7dc9e636-2951-407e-b50f-31d6b0b22961 - trigger: - - platform: time_pattern + triggers: + - trigger: time_pattern hours: "/1" minutes: "15" - condition: "{{ not states('sensor.mes_07762_153_47_account') in ('unavailable') }}" - action: + conditions: "{{ not states('sensor.mes_07762_153_47_account') in ('unavailable') }}" + actions: # Set Peak Time - - service: input_datetime.set_datetime + - 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 %} - - service: input_datetime.set_datetime + - action: input_datetime.set_datetime target: entity_id: input_datetime.apartment_enegry_start_time_peak_2 data: @@ -847,14 +847,14 @@ energy_pack: {% 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 %} # Set Halfpeak Time - - service: input_datetime.set_datetime + - 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 %} - - service: input_datetime.set_datetime + - action: input_datetime.set_datetime target: entity_id: input_datetime.apartment_enegry_start_time_halfpeak_2 data: @@ -862,7 +862,7 @@ energy_pack: {% 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 %} # Set Night Time - - service: input_datetime.set_datetime + - action: input_datetime.set_datetime target: entity_id: input_datetime.apartment_enegry_start_time_night data: @@ -875,21 +875,21 @@ energy_pack: # --- Set current energy tariff --- - alias: Energy - Apartment - Set Current Tariff id: 0266f51b-5a79-4c13-b925-f50952cc49ed - trigger: - - platform: time + triggers: + - trigger: time at: - input_datetime.apartment_enegry_start_time_peak_1 - input_datetime.apartment_enegry_start_time_peak_2 id: "peak" - - platform: time + - trigger: time at: - input_datetime.apartment_enegry_start_time_halfpeak_1 - input_datetime.apartment_enegry_start_time_halfpeak_2 id: "halfpeak" - - platform: time + - trigger: time at: input_datetime.apartment_enegry_start_time_night id: "night" - action: + actions: choose: # Set Peak Tariff - alias: Set Peak Tariff @@ -897,12 +897,12 @@ energy_pack: - condition: trigger id: "peak" sequence: - - service: input_number.set_value + - action: input_number.set_value target: entity_id: input_number.apartment_enegry_cost_current data: value: "{{ states('sensor.apartment_enegry_cost_peak') | float(0) }}" - - service: select.select_option + - action: select.select_option target: entity_id: group.all_energy_utility_meters data: @@ -913,12 +913,12 @@ energy_pack: - condition: trigger id: "halfpeak" sequence: - - service: input_number.set_value + - action: input_number.set_value target: entity_id: input_number.apartment_enegry_cost_current data: value: "{{ states('sensor.apartment_enegry_cost_halfpeak') | float(0) }}" - - service: select.select_option + - action: select.select_option target: entity_id: group.all_energy_utility_meters data: @@ -929,12 +929,12 @@ energy_pack: - condition: trigger id: "night" sequence: - - service: input_number.set_value + - action: input_number.set_value target: entity_id: input_number.apartment_enegry_cost_current data: value: "{{ states('sensor.apartment_enegry_cost_night') | float(0) }}" - - service: select.select_option + - action: select.select_option target: entity_id: group.all_energy_utility_meters data: diff --git a/packages/pack_feedreader.yaml b/packages/pack_feedreader.yaml index 4d5eb9ea..7072e4f0 100644 --- a/packages/pack_feedreader.yaml +++ b/packages/pack_feedreader.yaml @@ -18,10 +18,10 @@ feedreader_pack: id: 7acc6aec-3319-44e8-bf1c-dc36109f1b89 mode: queued max: 100 - trigger: - platform: event + triggers: + trigger: event event_type: feedreader - action: + actions: - choose: - alias: Home Assistant News and Blog Posts conditions: @@ -29,7 +29,7 @@ feedreader_pack: value_template: > {{ trigger.event.data.link | regex_search('www.home-assistant.io') and (states('sensor.ha_uptime') | int) > 1 }} sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system disable_web_page_preview: true @@ -45,7 +45,7 @@ feedreader_pack: value_template: > {{ trigger.event.data.link | regex_search('alerts.home-assistant.io') }} sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system disable_web_page_preview: true @@ -61,7 +61,7 @@ feedreader_pack: value_template: > {{ trigger.event.data.link | regex_search('moscow.mchs.gov.ru') }} sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html diff --git a/packages/pack_git.yaml b/packages/pack_git.yaml index f54d1113..7ef36896 100644 --- a/packages/pack_git.yaml +++ b/packages/pack_git.yaml @@ -52,21 +52,21 @@ git_pack: id: 816f1400-5e51-4e5c-bc3a-f07e1e4202dd mode: queued max: 5 - trigger: - - platform: state + triggers: + - trigger: state entity_id: input_button.git_commint_and_push id: "button" - - platform: event + - trigger: event event_type: timer.finished event_data: entity_id: timer.git_time_to_push id: "timer_finished" - - platform: state + - trigger: state entity_id: input_boolean.git_autocommit from: "off" to: "on" id: "enable" - - platform: state + - trigger: state entity_id: sensor.git_number_of_modified_files not_to: - unavailable @@ -75,12 +75,12 @@ git_pack: - unavailable - unknown id: "files" - action: + actions: choose: - conditions: "{{ trigger.id == 'button' }}" sequence: - - service: shell_command.git_commint_and_push - - service: homeassistant.update_entity + - action: shell_command.git_commint_and_push + - action: homeassistant.update_entity target: entity_id: sensor.git_number_of_modified_files - conditions: "{{ trigger.id == 'enable' }}" @@ -88,7 +88,7 @@ git_pack: - if: - "{{ (states('sensor.git_number_of_modified_files') | int(0)) > 0 }}" then: - - service: timer.start + - action: timer.start target: entity_id: timer.git_time_to_push - conditions: "{{ trigger.id == 'timer_finished' }}" @@ -96,12 +96,12 @@ git_pack: - if: - "{{ is_state('input_boolean.git_autocommit', 'on') }}" then: - - service: shell_command.git_commint_and_push - - service: homeassistant.update_entity + - action: shell_command.git_commint_and_push + - action: homeassistant.update_entity target: entity_id: sensor.git_number_of_modified_files else: - - service: timer.start + - action: timer.start target: entity_id: timer.git_time_to_push - conditions: "{{ trigger.id == 'files' }}" @@ -109,25 +109,25 @@ git_pack: choose: - conditions: "{{ (trigger.to_state.state | int(0)) == 0 }}" sequence: - - service: timer.cancel + - 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: - - service: timer.start + - action: timer.start target: entity_id: timer.git_time_to_push - alias: GitHub HA Repo - Stars id: b8a8f7d3-1875-4271-b576-1586f2ab425f - trigger: - - platform: webhook + triggers: + - trigger: webhook webhook_id: !secret github_ha_repo_stars_webhook local_only: false allowed_methods: - POST - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html diff --git a/packages/pack_humidifier.yaml b/packages/pack_humidifier.yaml index e37ce1a5..371dc1a3 100644 --- a/packages/pack_humidifier.yaml +++ b/packages/pack_humidifier.yaml @@ -128,9 +128,10 @@ humidifiers_pack: description: "Скорость работы увлажнителя" example: "Silent" sequence: - service: humidifier.set_mode - data_template: + action: humidifier.set_mode + target: entity_id: "{{ humidifier_entity }}" + data: mode: "{{ humidifier_mode }}" # Automations @@ -139,18 +140,18 @@ humidifiers_pack: - alias: "Smartmi Humidifier - Заданчивается вода" id: 992f84be-ee32-497c-833f-7ddc8eb574a4 - trigger: - platform: numeric_state + triggers: + trigger: numeric_state entity_id: - sensor.smartmi_humidifier_01_detskaia_water_level - sensor.smartmi_humidifier_02_spalnia_water_level below: 15 - condition: + conditions: condition: template value_template: "{{ (trigger.to_state.state | int) != 0 }}" - action: - - service: notify.telegram_group_system - data_template: + actions: + - action: notify.telegram_group_system + data: message: >- {% if '_01_' in trigger.entity_id -%} *Smartmi Humidifier 01* (Детская): заканчивается вода (осталось *{{ trigger.to_state.state }}*%)! @@ -160,25 +161,25 @@ humidifiers_pack: - alias: "Smartmi Humidifier - Выключение по остатку воды" id: 41f9fd8c-50e9-43d3-8f1a-777705683f72 - trigger: - platform: numeric_state + triggers: + trigger: numeric_state entity_id: - sensor.smartmi_humidifier_01_detskaia_water_level - sensor.smartmi_humidifier_02_spalnia_water_level below: 10 - condition: + conditions: condition: template value_template: "{{ (trigger.to_state.state | int) != 0 }}" - action: - - service: humidifier.turn_off - data: + 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 -%} - - service: notify.telegram_group_system + - action: notify.telegram_group_system data: message: >- {% if '_01_' in trigger.entity_id -%} @@ -191,19 +192,19 @@ humidifiers_pack: - alias: "Smartmi Humidifier 01 - Выбор режима" id: dd7a9cd6-0161-4af7-9dce-3359e27dfb7c - trigger: - platform: state + triggers: + trigger: state entity_id: input_select.smartmi_humidifier_01_detskaia_mode - action: - service: script.set_smartmi_humidifier_mode - data_template: + 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 - trigger: - - platform: state + triggers: + - trigger: state entity_id: sensor.smartmi_humidifier_01_detskaia_mode to: - Auto @@ -213,11 +214,11 @@ humidifiers_pack: not_from: - unavailable - unknown - action: + actions: - if: - "{{ states('sensor.smartmi_humidifier_01_detskaia_mode') != states('input_select.smartmi_humidifier_01_detskaia_mode') }}" then: - - service: input_select.select_option + - action: input_select.select_option target: entity_id: input_select.smartmi_humidifier_01_detskaia_mode data: @@ -225,10 +226,10 @@ humidifiers_pack: - alias: "Увлажнение детской - Старт [время]" id: cb8d8af5-8a41-4ed8-a1c1-05b4a823fcdd - trigger: - platform: time + triggers: + trigger: time at: "20:00:00" - condition: + conditions: - condition: state entity_id: humidifier.smartmi_humidifier_01_detskaia state: "off" @@ -238,35 +239,37 @@ humidifiers_pack: - condition: numeric_state entity_id: sensor.smartmi_humidifier_01_detskaia_water_level above: 25 - action: - service: humidifier.turn_on - entity_id: humidifier.smartmi_humidifier_01_detskaia + actions: + action: humidifier.turn_on + target: + entity_id: humidifier.smartmi_humidifier_01_detskaia - alias: "Увлажнение детской - Стоп [время]" id: e2a3cd54-5f73-4e8c-b110-483c2f6be654 - trigger: - platform: time + triggers: + trigger: time at: "07:00:00" - condition: + 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" - action: - service: humidifier.turn_off - entity_id: humidifier.smartmi_humidifier_01_detskaia + actions: + action: humidifier.turn_off + target: + entity_id: humidifier.smartmi_humidifier_01_detskaia - alias: "Увлажнение детской - Старт [Влажность]" id: c948d3e9-40c8-48f8-a8d8-dba65319d61b - trigger: - platform: state + triggers: + trigger: state entity_id: - sensor.humidity_in_nursery - input_number.target_humidity_01_detskaia - input_boolean.smartmi_humidifier_01_detskaia_autocontrol - condition: + conditions: - condition: state entity_id: input_boolean.smartmi_humidifier_01_detskaia_autocontrol state: "on" @@ -279,23 +282,24 @@ humidifiers_pack: - condition: numeric_state entity_id: sensor.smartmi_humidifier_01_detskaia_water_level above: 15 - action: - - service: humidifier.turn_on - entity_id: humidifier.smartmi_humidifier_01_detskaia -# - service: notify.telegram_group_system + actions: + - action: humidifier.turn_on + target: + entity_id: humidifier.smartmi_humidifier_01_detskaia +# - action: notify.telegram_group_system # data: # message: | # В *Детской* включен увлажнитель, текущая влажность {{ states('sensor.humidity_in_nursery') }}% - alias: "Увлажнение детской - Стоп [Влажность]" id: ce34b5e0-d1d9-45b0-8a66-65eb392383ec - trigger: - platform: state + triggers: + trigger: state entity_id: - sensor.humidity_in_nursery - input_number.target_humidity_01_detskaia - input_boolean.smartmi_humidifier_01_detskaia_autocontrol - condition: + conditions: - condition: state entity_id: input_boolean.smartmi_humidifier_01_detskaia_autocontrol state: "on" @@ -305,10 +309,11 @@ humidifiers_pack: - condition: state entity_id: humidifier.smartmi_humidifier_01_detskaia state: "on" - action: - - service: humidifier.turn_off - entity_id: humidifier.smartmi_humidifier_01_detskaia -# - service: notify.telegram_group_system + actions: + - action: humidifier.turn_off + target: + entity_id: humidifier.smartmi_humidifier_01_detskaia +# - action: notify.telegram_group_system # data: # message: | # В *Детской* выключен увлажнитель, текущая влажность {{ states('sensor.humidity_in_nursery') }}% @@ -317,19 +322,19 @@ humidifiers_pack: - alias: "Smartmi Humidifier 02 - Выбор режима" id: 23a943a3-9594-4392-bdb4-468eccc9a50b - trigger: - platform: state + triggers: + trigger: state entity_id: input_select.smartmi_humidifier_02_spalnia_mode - action: - service: script.set_smartmi_humidifier_mode - data_template: + 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 - trigger: - - platform: state + triggers: + - trigger: state entity_id: sensor.smartmi_humidifier_02_spalnia_mode to: - Auto @@ -339,11 +344,11 @@ humidifiers_pack: not_from: - unavailable - unknown - action: + actions: - if: - "{{ states('sensor.smartmi_humidifier_02_spalnia_mode') != states('input_select.smartmi_humidifier_02_spalnia_mode') }}" then: - - service: input_select.select_option + - action: input_select.select_option target: entity_id: input_select.smartmi_humidifier_02_spalnia_mode data: @@ -351,13 +356,13 @@ humidifiers_pack: - alias: "Увлажнение спальни - Старт [Влажность]" id: a9f8c4d8-7b10-4128-8411-1aa68a330760 - trigger: - platform: state + triggers: + trigger: state entity_id: - sensor.humidity_in_bedroom - input_number.target_humidity_02_spalnia - input_boolean.smartmi_humidifier_02_spalnia_autocontrol - condition: + conditions: - condition: state entity_id: input_boolean.smartmi_humidifier_02_spalnia_autocontrol state: "on" @@ -370,23 +375,24 @@ humidifiers_pack: - condition: numeric_state entity_id: sensor.smartmi_humidifier_02_spalnia_water_level above: 15 - action: - - service: humidifier.turn_on - entity_id: humidifier.smartmi_humidifier_02_spalnia -# - service: notify.telegram_group_system + actions: + - action: humidifier.turn_on + target: + entity_id: humidifier.smartmi_humidifier_02_spalnia +# - action: notify.telegram_group_system # data: # message: | # В *Спальне* включен увлажнитель, текущая влажность {{ states('sensor.humidity_in_bedroom') }}% - alias: "Увлажнение спальни - Стоп [Влажность]" id: ec2f9de0-dacb-4a84-b0c9-0b5eb8e2b4f9 - trigger: - platform: state + triggers: + trigger: state entity_id: - sensor.humidity_in_bedroom - input_number.target_humidity_02_spalnia - input_boolean.smartmi_humidifier_02_spalnia_autocontrol - condition: + conditions: - condition: state entity_id: input_boolean.smartmi_humidifier_02_spalnia_autocontrol state: "on" @@ -396,10 +402,11 @@ humidifiers_pack: - condition: state entity_id: humidifier.smartmi_humidifier_02_spalnia state: "on" - action: - - service: humidifier.turn_off - entity_id: humidifier.smartmi_humidifier_02_spalnia -# - service: notify.telegram_group_system + actions: + - action: humidifier.turn_off + target: + entity_id: humidifier.smartmi_humidifier_02_spalnia +# - action: notify.telegram_group_system # data: # message: | # В *Спальне* выключен увлажнитель, текущая влажность {{ states('sensor.humidity_in_bedroom') }}% diff --git a/packages/pack_kitchen_covers.yaml b/packages/pack_kitchen_covers.yaml index 437bca36..ed602beb 100644 --- a/packages/pack_kitchen_covers.yaml +++ b/packages/pack_kitchen_covers.yaml @@ -34,19 +34,19 @@ kitchen_covers_pack: - alias: "Kitchen Covers Control by Light" id: 24f83b60-8392-4278-8725-6d1a33a0a483 - trigger: - - platform: numeric_state + triggers: + - trigger: numeric_state entity_id: sensor.outdoor_illuminance below: input_number.kitchen_covers_illuminance_threshold for: "00:10:00" id: "dark" - - platform: numeric_state + - trigger: numeric_state entity_id: sensor.outdoor_illuminance above: input_number.kitchen_covers_illuminance_threshold for: "00:10:00" id: "lightly" - condition: "{{ is_state('input_boolean.kitchen_covers_auto', 'on') }}" - action: + conditions: "{{ is_state('input_boolean.kitchen_covers_auto', 'on') }}" + actions: choose: - alias: Darkens (Close) conditions: @@ -54,7 +54,7 @@ kitchen_covers_pack: id: "dark" sequence: - condition: "{{ states('cover.kitchen_covers') in ['open', 'opening'] }}" - - service: cover.close_cover + - action: cover.close_cover target: entity_id: cover.kitchen_covers - alias: Brightens (Open) @@ -63,7 +63,7 @@ kitchen_covers_pack: id: "lightly" sequence: - condition: "{{ states('cover.kitchen_covers') in ['closed', 'closing'] }}" - - service: cover.open_cover + - action: cover.open_cover target: entity_id: cover.kitchen_covers @@ -72,29 +72,29 @@ kitchen_covers_pack: mode: queued max: 5 max_exceeded: silent - trigger: - - platform: event + triggers: + - trigger: event event_type: zha_event event_data: device_ieee: "50:32:5f:ff:fe:70:d7:69" id: "ikea_sw_5" - action: + actions: choose: - alias: "command: on or move_with_on_off" conditions: "{{ trigger.event.data.command in ('on', 'move_with_on_off') }}" sequence: - - service: cover.open_cover + - action: cover.open_cover target: entity_id: cover.kitchen_covers - alias: "command: off or move" conditions: "{{ trigger.event.data.command in ('off', 'move') }}" sequence: - - service: cover.close_cover + - action: cover.close_cover target: entity_id: cover.kitchen_covers - alias: "command: stop" conditions: "{{ trigger.event.data.command == 'stop' }}" sequence: - - service: cover.stop_cover + - action: cover.stop_cover target: entity_id: cover.kitchen_covers \ No newline at end of file diff --git a/packages/pack_mgts_gpon.yaml b/packages/pack_mgts_gpon.yaml index dadd0e70..f7e64e1d 100644 --- a/packages/pack_mgts_gpon.yaml +++ b/packages/pack_mgts_gpon.yaml @@ -10,11 +10,11 @@ mgts_gpon_pack: mgts_gpon_reboot: alias: Reboot MGTS GPON Terminal sequence: - - service: switch.turn_off + - action: switch.turn_off target: entity_id: switch.nas_wr01b_02_switch - delay: "00:00:05" - - service: switch.turn_on + - action: switch.turn_on target: entity_id: switch.nas_wr01b_02_switch - wait_template: "{{ is_state('switch.nas_wr01b_02_switch', 'on') }}" @@ -22,7 +22,7 @@ mgts_gpon_pack: - if: - "{{ not wait.completed }}" then: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -30,7 +30,7 @@ mgts_gpon_pack: Перезагрузка терминал МГТС не удалась, устройство обесточено. Необходимо проверить работоспособность ZB сети и вручную включить терминал. else: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system message: "Терминал МГТС успешно перезагружен." \ No newline at end of file diff --git a/packages/pack_new_year.yaml b/packages/pack_new_year.yaml index d37c2204..fd991f99 100644 --- a/packages/pack_new_year.yaml +++ b/packages/pack_new_year.yaml @@ -43,52 +43,52 @@ new_year_holidays_pack: - alias: 'New Year Light [Scheduled]' id: 63ea7cdd-f8bc-4a4d-b3ce-72fc493e7392 - trigger: - - platform: time + triggers: + - trigger: time at: input_datetime.new_year_illumination_on id: "on" - - platform: time + - trigger: time at: input_datetime.new_year_illumination_off id: "off" - action: + actions: choose: - conditions: "{{ trigger.id == 'on' }}" sequence: - - service: scene.turn_on + - 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: - - service: scene.turn_on + - action: scene.turn_on target: entity_id: scene.new_year_light_off - alias: 'New Year Light [Home Presence]' id: e0299715-bb22-4667-b4ad-7cf0b72bd433 - trigger: - - platform: state + triggers: + - trigger: state entity_id: group.family_persons from: "not_home" to: "home" id: "home" - - platform: state + - trigger: state entity_id: group.family_persons to: "not_home" for: minutes: 5 id: not_home - action: + actions: choose: - conditions: "{{ trigger.id == 'home' }}" sequence: - - service: scene.turn_on + - action: scene.turn_on target: entity_id: scene.new_year_light_on - conditions: "{{ trigger.id == 'not_home' }}" sequence: - - service: scene.turn_on + - action: scene.turn_on target: entity_id: scene.new_year_light_off diff --git a/packages/pack_radio.yaml b/packages/pack_radio.yaml index e6981b66..38aa2a0c 100644 --- a/packages/pack_radio.yaml +++ b/packages/pack_radio.yaml @@ -67,7 +67,7 @@ ha_radio: - if: - "{{ '(TV)' in states('input_select.output_device') }}" then: - - service: shell_command.chromecast_tv_on + - action: shell_command.chromecast_tv_on data: ip_addr: >- {% if is_state("input_select.output_device", "Гостинная (TV)") -%} @@ -75,7 +75,7 @@ ha_radio: {% elif is_state("input_select.output_device", "Детская (TV)") -%} "172.16.16.212" {% endif %} - - service: media_player.volume_set + - action: media_player.volume_set target: entity_id: "{{ states('input_text.output_device_to_play') }}" data: @@ -83,24 +83,26 @@ ha_radio: - if: - "{{ '(Яндекс)' in states('input_select.output_device') }}" then: - - service: yandex_station.send_command - data: + - action: yandex_station.send_command + target: entity_id: "{{ states('input_text.output_device_to_play') }}" + data: command: sendText text: >- Включи радио {{ states('input_select.radio_station') }} else: - - service: media_player.play_media - data: + - action: media_player.play_media + target: entity_id: "{{ states('input_text.output_device_to_play') }}" + data: media_content_id: "{{ states('input_text.radio_url_to_play') }}" media_content_type: music radio_stop: alias: Stop Internet Radio sequence: - - service: media_player.turn_off - data: + - action: media_player.turn_off + target: entity_id: "{{ states('input_text.output_device_to_play') }}" # Automations @@ -108,15 +110,16 @@ ha_radio: - alias: "Radio - Selected Name to URL" id: 113d01d2-80b9-4a5e-9745-ad34cb66ea4d - trigger: - - platform: homeassistant + triggers: + - trigger: homeassistant event: start - - platform: state + - trigger: state entity_id: input_select.radio_station - action: - - service: input_text.set_value - data: + 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") -%} http://nashe1.hostingradio.ru/jazz-128.mp3 @@ -140,15 +143,16 @@ ha_radio: - alias: "Radio - Selected Name to Device" id: fda46b3d-2b94-4aeb-b58d-69d537756cd5 - trigger: - - platform: homeassistant + triggers: + - trigger: homeassistant event: start - - platform: state + - trigger: state entity_id: input_select.output_device action: - - service: input_text.set_value - data: + - action: input_text.set_value + target: entity_id: input_text.output_device_to_play + data: value: >- {% if is_state("input_select.output_device", "Гостинная (TV)") -%} media_player.gostinaia @@ -166,11 +170,12 @@ ha_radio: - alias: "Radio - Volume Control" id: a5915a17-ec28-4adf-a3c3-6ac08f71d11f - trigger: - platform: state + triggers: + trigger: state entity_id: input_number.volume_radio - action: - service: media_player.volume_set - data: + actions: + action: media_player.volume_set + target: entity_id: "{{ states('input_text.output_device_to_play') }}" + data: volume_level: "{{ states('input_number.volume_radio') }}" \ No newline at end of file diff --git a/packages/pack_samsungtv.yaml b/packages/pack_samsungtv.yaml index fb3ab7a6..a51a657e 100644 --- a/packages/pack_samsungtv.yaml +++ b/packages/pack_samsungtv.yaml @@ -8,28 +8,28 @@ samsungtv_pack: automation: # Turn On actions - alias: "Samsung TV ue43ru7470 Turn On" - trigger: - - platform: samsungtv.turn_on + triggers: + - trigger: samsungtv.turn_on entity_id: media_player.ue43ru7470 - action: - - service: wake_on_lan.send_magic_packet + actions: + - action: wake_on_lan.send_magic_packet data: mac: 8c:79:f5:51:2f:d1 - alias: "Samsung TV ue32es5500 Turn On" - trigger: - - platform: samsungtv.turn_on + triggers: + - trigger: samsungtv.turn_on entity_id: media_player.ue32es5500 - action: - - service: shell_command.chromecast_tv_on + actions: + - action: shell_command.chromecast_tv_on data: ip_addr: "172.16.16.194" - alias: "Samsung TV ue46es5507 Turn On" - trigger: - - platform: samsungtv.turn_on + triggers: + - trigger: samsungtv.turn_on entity_id: media_player.ue46es5507 - action: - - service: shell_command.chromecast_tv_on + actions: + - action: shell_command.chromecast_tv_on data: ip_addr: "172.16.16.211" diff --git a/packages/pack_scenes_nursery.yaml b/packages/pack_scenes_nursery.yaml index e4e2f2d5..092d7957 100644 --- a/packages/pack_scenes_nursery.yaml +++ b/packages/pack_scenes_nursery.yaml @@ -38,20 +38,20 @@ scenes_nursery_pack: sequence: - if: "{{ is_state('media_player.yandex_station_lite_detskaia', 'playing') }}" then: - - service: media_player.turn_off + - action: media_player.turn_off target: entity_id: - media_player.yandex_station_lite_detskaia - repeat: sequence: - wait_for_trigger: - - platform: state + - trigger: state entity_id: media_player.yandex_station_lite_detskaia to: "playing" timeout: "01:00:00" - if: "{{ wait.trigger is not none }}" then: - - service: media_player.turn_off + - action: media_player.turn_off target: entity_id: - media_player.yandex_station_lite_detskaia @@ -69,35 +69,35 @@ scenes_nursery_pack: - alias: "Scene: Children go to Bed" id: 4ecf7cf0-fc2e-4769-9d95-548dc4d52ba2 mode: restart - trigger: - - platform: event + triggers: + - trigger: event event_type: yandex_intent event_data: text: Дети ложатся спать id: "sleep" - action: + actions: choose: - alias: Go to Bed conditions: - condition: trigger id: "sleep" sequence: - - service: scene.turn_on + - action: scene.turn_on target: entity_id: scene.children_go_to_bed data: transition: 2 - - service: script.turn_off + - action: script.turn_off target: entity_id: script.nursery_alice_stop_watchdog_1h - wait_for_trigger: - - platform: state + - trigger: state entity_id: media_player.yandex_station_lite_detskaia to: - "off" - "paused" timeout: "01:00:00" continue_on_timeout: false - - service: script.turn_on + - action: script.turn_on target: entity_id: script.nursery_alice_stop_watchdog_1h \ No newline at end of file diff --git a/packages/pack_shopping_list.yaml b/packages/pack_shopping_list.yaml index 8f0e6f41..4ec492e0 100644 --- a/packages/pack_shopping_list.yaml +++ b/packages/pack_shopping_list.yaml @@ -10,20 +10,20 @@ shopping_list_pack: id: 930a85ab-d531-42e7-a1a6-86bdfe0a628f mode: single max_exceeded: silent - trigger: - - platform: time_pattern + triggers: + - trigger: time_pattern minutes: "35" id: time - - platform: event + - trigger: event event_type: shopping_list_updated id: event - - platform: state + - trigger: state entity_id: - person.alexander - person.irina to: "not_home" id: state - action: + actions: - wait_template: "{{ is_state_attr('media_player.yandex_station_lite_prikhozhaya', 'alice_state', 'IDLE') }}" - if: - alias: Event trigger @@ -37,9 +37,10 @@ shopping_list_pack: then: - repeat: sequence: - - service: media_player.volume_set - data: + - 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" @@ -52,7 +53,7 @@ shopping_list_pack: then: - repeat: sequence: - - service: media_player.volume_mute + - action: media_player.volume_mute target: entity_id: media_player.yandex_station_lite_prikhozhaya data: @@ -64,14 +65,15 @@ shopping_list_pack: - "{{ repeat.index <= 3 }}" - delay: "00:00:01" - - service: media_player.play_media - entity_id: media_player.yandex_station_lite_prikhozhaya + - 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') }}" - - service: media_player.volume_mute + - action: media_player.volume_mute target: entity_id: media_player.yandex_station_lite_prikhozhaya data: diff --git a/packages/pack_tablet_hallway.yaml b/packages/pack_tablet_hallway.yaml index 1fa2f485..932dcc92 100644 --- a/packages/pack_tablet_hallway.yaml +++ b/packages/pack_tablet_hallway.yaml @@ -10,8 +10,8 @@ tablet_hallway_pack: mode: queued max: 5 max_exceeded: silent - trigger: - - platform: state + triggers: + - trigger: state entity_id: light.sonoff_1000f2f14a not_to: - unavailable @@ -19,15 +19,15 @@ tablet_hallway_pack: not_from: - unavailable - unknown - action: + actions: choose: - alias: To On conditions: "{{ trigger.from_state.state == 'off' and trigger.to_state.state == 'on' }}" sequence: - - service: switch.turn_on - data: + - action: switch.turn_on + target: entity_id: switch.galaxy_tab_a_8_0_2019_screen - - service: media_player.volume_set + - action: media_player.volume_set target: entity_id: media_player.galaxy_tab_a_8_0_2019 data: @@ -40,25 +40,25 @@ tablet_hallway_pack: - alias: To Off conditions: "{{ trigger.from_state.state == 'on' and trigger.to_state.state == 'off' }}" sequence: - - service: switch.turn_off - data: + - action: switch.turn_off + target: entity_id: switch.galaxy_tab_a_8_0_2019_screen - - service: media_player.volume_set + - action: media_player.volume_set target: entity_id: media_player.galaxy_tab_a_8_0_2019 data: volume_level: 0 - - service: fully_kiosk.load_url - data: - url: about:blank + - action: fully_kiosk.load_url target: device_id: 41638a8b36f2ac6228aed99d142fd286 + data: + url: about:blank - alias: "Планшет в Прихожей - поддержание заряда" id: 82fb6789-4385-44cc-b721-90b892063447 max_exceeded: silent - trigger: - - platform: numeric_state + triggers: + - trigger: numeric_state entity_id: - sensor.galaxy_tab_a_8_0_2019_battery - sensor.sm_t295_hallway_battery_level @@ -66,7 +66,7 @@ tablet_hallway_pack: for: minutes: 5 id: "low" - - platform: numeric_state + - trigger: numeric_state entity_id: - sensor.galaxy_tab_a_8_0_2019_battery - sensor.sm_t295_hallway_battery_level @@ -74,7 +74,7 @@ tablet_hallway_pack: for: minutes: 5 id: "hight" - action: + actions: choose: - alias: Battery Low conditions: @@ -82,7 +82,7 @@ tablet_hallway_pack: id: "low" sequence: - condition: "{{ is_state('switch.sonoff_mini_r2_02_switch', 'off') }}" - - service: switch.turn_on + - action: switch.turn_on target: entity_id: switch.sonoff_mini_r2_02_switch - alias: Battery Charged @@ -91,6 +91,6 @@ tablet_hallway_pack: id: "hight" sequence: - condition: "{{ is_state('switch.sonoff_mini_r2_02_switch', 'on') }}" - - service: switch.turn_off + - action: switch.turn_off target: entity_id: switch.sonoff_mini_r2_02_switch \ No newline at end of file diff --git a/packages/pack_usb_conbee2.yaml.bak b/packages/pack_usb_conbee2.yaml.bak index e98765a4..192f50a0 100644 --- a/packages/pack_usb_conbee2.yaml.bak +++ b/packages/pack_usb_conbee2.yaml.bak @@ -28,12 +28,12 @@ usb_conbee2_pack: - alias: "ConBee2: Attach USB Stick to HA VM" id: 0103f99c-5100-43f5-8c08-b35ef3175ec5 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.conbee2_usb_stick_exist to: 'off' - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -41,7 +41,7 @@ usb_conbee2_pack: ConBee II отключен от VM, будет запущен процесс автоматического подключения. - repeat: sequence: - - service: shell_command.attach_conbee2_to_ha_vm + - action: shell_command.attach_conbee2_to_ha_vm - delay: "00:03:00" until: - condition: state @@ -50,13 +50,13 @@ usb_conbee2_pack: - alias: "ConBee2: USB Stick Attached to HA VM" id: 052b6f8e-a580-4470-9efa-4f097fb163aa - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.conbee2_usb_stick_exist from: 'off' to: 'on' - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -68,10 +68,10 @@ usb_conbee2_pack: - alias: "ConBee2: USB Device Errors in Log" id: 5cc751d0-a514-480f-9bdc-6c2bd17a7f0d mode: queued - trigger: - - platform: event + triggers: + - trigger: event event_type: system_log_event - condition: + conditions: - condition: template value_template: >- {{ @@ -82,8 +82,8 @@ usb_conbee2_pack: {{ trigger.event.data.message | regex_search('Lost connection: SerialException') }} - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system parse_mode: html @@ -96,38 +96,38 @@ usb_conbee2_pack: - alias: "ConBee2 - Restart HA" id: 7ab7e3b6-5674-4ece-a28b-80a96d0239eb - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/cb2_ha_restart" - action: - - service: telegram_bot.answer_callback_query - data_template: + actions: + - action: telegram_bot.answer_callback_query + data: callback_query_id: "{{ trigger.event.data.id }}" message: "Команда отправлена" - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" inline_keyboard: [] - - service: homeassistant.restart + - action: homeassistant.restart - alias: "ConBee2 - Reboot VM" id: 402ef2b9-e133-4eff-ba96-39a69f046be5 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/cb2_vm_reboot" - action: - - service: telegram_bot.answer_callback_query - data_template: + actions: + - action: telegram_bot.answer_callback_query + data: callback_query_id: "{{ trigger.event.data.id }}" message: "Команда отправлена" - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" inline_keyboard: [] - - service: hassio.host_reboot \ No newline at end of file + - action: hassio.host_reboot \ No newline at end of file diff --git a/packages/pack_usb_sonoff_dongle_e.yaml.bak b/packages/pack_usb_sonoff_dongle_e.yaml.bak index 814d2c40..472295e9 100644 --- a/packages/pack_usb_sonoff_dongle_e.yaml.bak +++ b/packages/pack_usb_sonoff_dongle_e.yaml.bak @@ -29,17 +29,17 @@ usb_sonoff_dongle_e_pack: - alias: "Sonoff Dongle E: Persistent Notifications" id: 2f4e6840-deb7-4629-80f1-8a34347e64e0 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist not_from: - unavailable - unknown - action: + actions: - choose: - conditions: "{{ trigger.to_state.state == 'off' }}" sequence: - - service: persistent_notification.create + - action: persistent_notification.create data: title: "Sonoff ZBDongle-E Disconnected" message: | @@ -48,10 +48,10 @@ usb_sonoff_dongle_e_pack: notification_id: "zbe_disconnected" - conditions: "{{ trigger.to_state.state == 'on' }}" sequence: - - service: persistent_notification.dismiss + - action: persistent_notification.dismiss data: notification_id: "zbe_disconnected" - - service: persistent_notification.create + - action: persistent_notification.create data: title: "Sonoff ZBDongle-E Connected" message: | @@ -61,12 +61,12 @@ usb_sonoff_dongle_e_pack: - alias: "Sonoff Dongle E: Attach USB Stick to HA VM" id: 165f7294-7880-4aaf-955c-d5f301bb1e72 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist to: 'off' - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -74,7 +74,7 @@ usb_sonoff_dongle_e_pack: Sonoff Dongle E отключен от VM, будет запущен процесс автоматического подключения. - repeat: sequence: - - service: shell_command.attach_sonoff_dongle_e_to_ha_vm + - action: shell_command.attach_sonoff_dongle_e_to_ha_vm - delay: "00:03:00" until: - condition: state @@ -83,13 +83,13 @@ usb_sonoff_dongle_e_pack: - alias: "Sonoff Dongle E: USB Stick Attached to HA VM" id: cc1601bd-a416-4fb1-9af9-4a436b7557e9 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist from: 'off' to: 'on' - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -100,38 +100,38 @@ usb_sonoff_dongle_e_pack: - alias: "Sonoff Dongle E - Restart HA" id: a5621d7e-91e5-4f14-a6b2-80c774d415ac - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/sde_ha_restart" - action: - - service: telegram_bot.answer_callback_query - data_template: + actions: + - action: telegram_bot.answer_callback_query + data: callback_query_id: "{{ trigger.event.data.id }}" message: "Команда отправлена" - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" inline_keyboard: [] - - service: homeassistant.restart + - action: homeassistant.restart - alias: "Sonoff Dongle E - Reboot VM" id: 08dfe08a-3901-46f3-b16a-e807edf80986 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/sde_vm_reboot" - action: - - service: telegram_bot.answer_callback_query - data_template: + actions: + - action: telegram_bot.answer_callback_query + data: callback_query_id: "{{ trigger.event.data.id }}" message: "Команда отправлена" - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" inline_keyboard: [] - - service: hassio.host_reboot \ No newline at end of file + - action: hassio.host_reboot \ No newline at end of file diff --git a/packages/pack_usb_sonoff_dongle_p.yaml.bak b/packages/pack_usb_sonoff_dongle_p.yaml.bak index 311ab2ee..cd70f386 100644 --- a/packages/pack_usb_sonoff_dongle_p.yaml.bak +++ b/packages/pack_usb_sonoff_dongle_p.yaml.bak @@ -29,17 +29,17 @@ usb_sonoff_dongle_p_pack: - alias: "Sonoff Dongle P: Persistent Notifications" id: 8bd58dd3-4b8f-4560-a053-4fd1824bf6f2 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist not_from: - unavailable - unknown - action: + actions: - choose: - conditions: "{{ trigger.to_state.state == 'off' }}" sequence: - - service: persistent_notification.create + - action: persistent_notification.create data: title: "Sonoff ZBDongle-P Disconnected" message: | @@ -48,10 +48,10 @@ usb_sonoff_dongle_p_pack: notification_id: "zbp_disconnected" - conditions: "{{ trigger.to_state.state == 'on' }}" sequence: - - service: persistent_notification.dismiss + - action: persistent_notification.dismiss data: notification_id: "zbp_disconnected" - - service: persistent_notification.create + - action: persistent_notification.create data: title: "Sonoff ZBDongle-P Connected" message: | @@ -61,12 +61,12 @@ usb_sonoff_dongle_p_pack: - alias: "Sonoff Dongle P: Attach USB Stick to HA VM" id: aca5235d-da05-4c20-b1e9-649ad8dae363 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist to: 'off' - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -74,7 +74,7 @@ usb_sonoff_dongle_p_pack: Sonoff Dongle P отключен от VM, будет запущен процесс автоматического подключения. - repeat: sequence: - - service: shell_command.attach_sonoff_dongle_p_to_ha_vm + - action: shell_command.attach_sonoff_dongle_p_to_ha_vm - delay: "00:03:00" until: - condition: state @@ -83,13 +83,13 @@ usb_sonoff_dongle_p_pack: - alias: "Sonoff Dongle P: USB Stick Attached to HA VM" id: bfa721e7-5313-4ef5-a35f-d4a90dcd7f4c - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist from: 'off' to: 'on' - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -100,38 +100,38 @@ usb_sonoff_dongle_p_pack: - alias: "Sonoff Dongle P - Restart HA" id: 13efa5f8-dbbd-4d5d-b758-eec0d2a5f3e3 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/sdp_ha_restart" - action: - - service: telegram_bot.answer_callback_query - data_template: + actions: + - action: telegram_bot.answer_callback_query + data: callback_query_id: "{{ trigger.event.data.id }}" message: "Команда отправлена" - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" inline_keyboard: [] - - service: homeassistant.restart + - action: homeassistant.restart - alias: "Sonoff Dongle P - Reboot VM" id: 9656aaf0-ea56-45bd-be42-4280f467d10f - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/sdp_vm_reboot" - action: - - service: telegram_bot.answer_callback_query - data_template: + actions: + - action: telegram_bot.answer_callback_query + data: callback_query_id: "{{ trigger.event.data.id }}" message: "Команда отправлена" - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" inline_keyboard: [] - - service: hassio.host_reboot \ No newline at end of file + - action: hassio.host_reboot \ No newline at end of file diff --git a/packages/pack_usb_sonoff_dongles.yaml b/packages/pack_usb_sonoff_dongles.yaml index ed1637d4..9ea93732 100644 --- a/packages/pack_usb_sonoff_dongles.yaml +++ b/packages/pack_usb_sonoff_dongles.yaml @@ -45,27 +45,27 @@ usb_sonoff_dongles_pack: id: 2f4e6840-deb7-4629-80f1-8a34347e64e0 mode: queued max: 5 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist not_from: - unavailable - unknown id: 'e' - - platform: state + - trigger: state entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist not_from: - unavailable - unknown id: 'p' - action: + actions: - choose: - conditions: "{{ trigger.id == 'e' }}" sequence: - choose: - conditions: "{{ trigger.to_state.state == 'off' }}" sequence: - - service: persistent_notification.create + - action: persistent_notification.create data: title: "Sonoff ZBDongle-E Disconnected" message: | @@ -74,10 +74,10 @@ usb_sonoff_dongles_pack: notification_id: "zbe_disconnected" - conditions: "{{ trigger.to_state.state == 'on' }}" sequence: - - service: persistent_notification.dismiss + - action: persistent_notification.dismiss data: notification_id: "zbe_disconnected" - - service: persistent_notification.create + - action: persistent_notification.create data: title: "Sonoff ZBDongle-E Connected" message: | @@ -89,7 +89,7 @@ usb_sonoff_dongles_pack: - choose: - conditions: "{{ trigger.to_state.state == 'off' }}" sequence: - - service: persistent_notification.create + - action: persistent_notification.create data: title: "Sonoff ZBDongle-P Disconnected" message: | @@ -98,10 +98,10 @@ usb_sonoff_dongles_pack: notification_id: "zbp_disconnected" - conditions: "{{ trigger.to_state.state == 'on' }}" sequence: - - service: persistent_notification.dismiss + - action: persistent_notification.dismiss data: notification_id: "zbp_disconnected" - - service: persistent_notification.create + - action: persistent_notification.create data: title: "Sonoff ZBDongle-P Connected" message: | @@ -113,21 +113,21 @@ usb_sonoff_dongles_pack: id: 165f7294-7880-4aaf-955c-d5f301bb1e72 mode: parallel max: 5 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist to: 'off' id: 'e' - - platform: state + - trigger: state entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist to: 'off' id: 'p' - action: + actions: - choose: - conditions: "{{ trigger.id == 'e' }}" sequence: - parallel: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -135,7 +135,7 @@ usb_sonoff_dongles_pack: Sonoff Dongle E отключен от VM, будет запущен процесс автоматического подключения. - repeat: sequence: - - service: shell_command.attach_sonoff_dongle_e_to_ha_vm + - action: shell_command.attach_sonoff_dongle_e_to_ha_vm - delay: "00:03:00" until: - condition: state @@ -144,7 +144,7 @@ usb_sonoff_dongles_pack: - conditions: "{{ trigger.id == 'p' }}" sequence: - parallel: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -152,7 +152,7 @@ usb_sonoff_dongles_pack: Sonoff Dongle P отключен от VM, будет запущен процесс автоматического подключения. - repeat: sequence: - - service: shell_command.attach_sonoff_dongle_p_to_ha_vm + - action: shell_command.attach_sonoff_dongle_p_to_ha_vm - delay: "00:03:00" until: - condition: state @@ -163,22 +163,22 @@ usb_sonoff_dongles_pack: id: cc1601bd-a416-4fb1-9af9-4a436b7557e9 mode: queued max: 5 - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.sonoff_dongle_e_usb_stick_exist from: 'off' to: 'on' id: 'e' - - platform: state + - trigger: state entity_id: binary_sensor.sonoff_dongle_p_usb_stick_exist from: 'off' to: 'on' id: 'p' - action: + actions: - choose: - conditions: "{{ trigger.id == 'e' }}" sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -188,7 +188,7 @@ usb_sonoff_dongles_pack: - "Перезапустить HA:/sd_ha_restart, Перезагрузить VM:/sd_vm_reboot" - conditions: "{{ trigger.id == 'p' }}" sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_system title: "*Внимание!*" @@ -200,38 +200,38 @@ usb_sonoff_dongles_pack: - alias: "Sonoff Dongles - Restart HA" id: a5621d7e-91e5-4f14-a6b2-80c774d415ac - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/sd_ha_restart" - action: - - service: telegram_bot.answer_callback_query - data_template: + actions: + - action: telegram_bot.answer_callback_query + data: callback_query_id: "{{ trigger.event.data.id }}" message: "Команда отправлена" - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" inline_keyboard: [] - - service: homeassistant.restart + - action: homeassistant.restart - alias: "Sonoff Dongles - Reboot VM" id: 08dfe08a-3901-46f3-b16a-e807edf80986 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/sd_vm_reboot" - action: - - service: telegram_bot.answer_callback_query - data_template: + actions: + - action: telegram_bot.answer_callback_query + data: callback_query_id: "{{ trigger.event.data.id }}" message: "Команда отправлена" - - service: telegram_bot.edit_replymarkup + - action: telegram_bot.edit_replymarkup data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" inline_keyboard: [] - - service: hassio.host_reboot \ No newline at end of file + - action: hassio.host_reboot \ No newline at end of file diff --git a/packages/pack_vacuum_cleaner.yaml b/packages/pack_vacuum_cleaner.yaml index 05a4193e..f54bcb4b 100644 --- a/packages/pack_vacuum_cleaner.yaml +++ b/packages/pack_vacuum_cleaner.yaml @@ -94,8 +94,8 @@ vacuum_cleaner: start_vacuum_room: alias: "Clean Selected Room [Mi Robot]" sequence: - - service: script.turn_on - data_template: + - action: script.turn_on + target: entity_id: >- {% if is_state("input_select.room_to_vacuum", "Прихожая") %} script.start_vacuum_hallway @@ -114,123 +114,138 @@ vacuum_cleaner: sequence: - delay: minutes: 8 - - service: vacuum.set_fan_speed - data: + - action: vacuum.set_fan_speed + target: entity_id: vacuum.xiaomi_vacuum_cleaner - fan_speed: Standard - - service: script.turn_on data: + fan_speed: Standard + - action: script.turn_on + target: entity_id: script.start_vacuum_hallway start_vacuum_hallway: alias: "Clean Hallway [Mi Robot]" sequence: - - service: vacuum.send_command - data: + - action: vacuum.send_command + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: command: app_segment_clean params: [17] start_vacuum_nursery: alias: "Clean Nursery [Mi Robot]" sequence: - - service: vacuum.send_command - data: + - action: vacuum.send_command + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: command: app_segment_clean params: [19] start_vacuum_living_room: alias: "Clean Living Room [Mi Robot]" sequence: - - service: vacuum.send_command - data: + - action: vacuum.send_command + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: command: app_segment_clean params: [16] start_vacuum_kitchen: alias: "Clean Kitchen [Mi Robot]" sequence: - - service: vacuum.send_command - data: + - action: vacuum.send_command + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: command: app_segment_clean params: [18] start_vacuum_bedroom: alias: "Clean Bedroom [Mi Robot]" sequence: - - service: vacuum.send_command - data: + - action: vacuum.send_command + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: command: app_segment_clean params: [20] set_vacuum_power_silent: sequence: - service: vacuum.set_fan_speed - data: + action: vacuum.set_fan_speed + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: fan_speed: Silent set_vacuum_power_standard: sequence: - service: vacuum.set_fan_speed - data: + action: vacuum.set_fan_speed + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: fan_speed: Standard set_vacuum_power_medium: sequence: - service: vacuum.set_fan_speed - data: + action: vacuum.set_fan_speed + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: fan_speed: Medium set_vacuum_power_turbo: sequence: - service: vacuum.set_fan_speed - data: + action: vacuum.set_fan_speed + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: fan_speed: Turbo set_vacuum_power_gentle: sequence: - service: vacuum.set_fan_speed - data: + action: vacuum.set_fan_speed + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: fan_speed: Gentle reset_main_brush_left: sequence: - - service: vacuum.send_command - data: + - action: vacuum.send_command + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: command: reset_consumable params: ["main_brush_work_time"] reset_side_brush_work_time: sequence: - - service: vacuum.send_command - data: + - action: vacuum.send_command + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: command: reset_consumable params: ["side_brush_work_time"] reset_filter_work_time: sequence: - - service: vacuum.send_command - data: + - action: vacuum.send_command + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: command: reset_consumable params: ["filter_work_time"] reset_sensor_dirty_time: sequence: - - service: vacuum.send_command - data: + - action: vacuum.send_command + target: entity_id: vacuum.xiaomi_vacuum_cleaner + data: command: reset_consumable params: ["sensor_dirty_time"] @@ -239,16 +254,16 @@ vacuum_cleaner: - alias: "Оповещение о начале уборки" id: 61fb954b-3450-4fc6-9848-cc5304b54a16 - trigger: - platform: state + triggers: + trigger: state entity_id: vacuum.xiaomi_vacuum_cleaner to: "cleaning" - condition: + conditions: condition: template value_template: > {{ trigger.from_state.state != 'unavailable'}} - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 message: "_Mi Robot_: начал уборку." @@ -257,19 +272,20 @@ vacuum_cleaner: - alias: "Vacuum - Telegram Control - Stop" id: 78e4ee4f-d0d7-4d23-9e3c-4ec125f19400 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/vacuum_stop" - action: - - service: vacuum.pause - entity_id: vacuum.xiaomi_vacuum_cleaner - - service: telegram_bot.answer_callback_query - data_template: + 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: "Команда отправлена" - - service: telegram_bot.edit_message + - action: telegram_bot.edit_message data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" @@ -281,22 +297,24 @@ vacuum_cleaner: - alias: "Vacuum - Telegram Control - Go to Base" id: 0b1fd434-4044-4ce7-ab8a-262d6250407a - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: "/vacuum_go_home" - action: - - service: vacuum.pause - entity_id: vacuum.xiaomi_vacuum_cleaner + actions: + - action: vacuum.pause + target: + entity_id: vacuum.xiaomi_vacuum_cleaner - delay: 1 - - service: vacuum.return_to_base - entity_id: vacuum.xiaomi_vacuum_cleaner - - service: telegram_bot.answer_callback_query - data_template: + - 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: "Команда отправлена" - - service: telegram_bot.edit_message + - action: telegram_bot.edit_message data: message_id: "{{ trigger.event.data.message.message_id }}" chat_id: "{{ trigger.event.data.chat_id }}" @@ -306,63 +324,62 @@ vacuum_cleaner: - alias: "Оповещение о возращении пылесоса на базу [notify to group flat]" id: 68311ec4-1030-4d7d-a2ea-e9cb21f7f40c - trigger: - platform: state + triggers: + trigger: state entity_id: vacuum.xiaomi_vacuum_cleaner to: "docked" - condition: + conditions: condition: template value_template: > {{ trigger.from_state.state != 'unavailable'}} - action: - - service: notify.telegram_group_flat_1 + actions: + - action: notify.telegram_group_flat_1 data: message: "_Mi Robot_: вернулся на базу (закончил уборку)." - alias: "Оповещение о забытом пылесосе [notify to group flat]" id: db76ec80-b5d6-4991-8a6c-9272b25c1a39 - trigger: - platform: state + triggers: + trigger: state entity_id: vacuum.xiaomi_vacuum_cleaner to: "idle" for: minutes: 15 - action: - - service: notify.telegram_group_flat_1 + actions: + - action: notify.telegram_group_flat_1 data: message: "_Mi Robot_: потерялся и бездельничает, отправляем на базу." - - service: vacuum.return_to_base - data: + - action: vacuum.return_to_base + target: entity_id: vacuum.xiaomi_vacuum_cleaner - alias: "Оповещение об ошибке [notify to group flat]" id: fe6bb5c1-f886-4161-bad7-4bf04be83258 - trigger: - platform: state + triggers: + trigger: state entity_id: vacuum.xiaomi_vacuum_cleaner to: "error" - condition: + conditions: condition: template value_template: > {{ trigger.from_state.state != 'unavailable'}} - action: - - service: notify.telegram_group_flat_1 - data_template: + 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 - trigger: - platform: state + triggers: + trigger: state entity_id: group.family_persons to: "not_home" for: minutes: 20 - condition: - condition: and - conditions: + conditions: + - and: - condition: time after: "08:30:00" before: "10:30:00" @@ -374,50 +391,49 @@ vacuum_cleaner: - fri - condition: template value_template: "{{ now().day != states.automation.ezhednevnaia_uborka_po_budniam_utro.attributes.last_triggered.day | default(0) }}" - action: - - service: vacuum.set_fan_speed - data: + actions: + - action: vacuum.set_fan_speed + target: entity_id: vacuum.xiaomi_vacuum_cleaner - fan_speed: Turbo - - service: vacuum.start data: + fan_speed: Turbo + - action: vacuum.start + target: entity_id: vacuum.xiaomi_vacuum_cleaner - alias: "Регулярная уборка прихожей" id: 6c64060c-0a65-4caf-8064-1d5cdfea50a3 - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.0x158d00031c790f_contact from: "on" to: "off" - condition: - condition: and - conditions: + 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) }}' - - condition: or - conditions: - - condition: state - entity_id: vacuum.xiaomi_vacuum_cleaner - state: "docked" - - condition: state - entity_id: vacuum.xiaomi_vacuum_cleaner - state: "idle" - action: - - service: script.turn_on - data: + - 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 - trigger: - platform: state + triggers: + trigger: state entity_id: input_select.vacuum_power - action: - - service: > + actions: + - action: > {% if trigger.to_state.state == 'Silent' %} script.set_vacuum_power_silent {% elif trigger.to_state.state == 'Standard' %} diff --git a/packages/pack_wakeup_radio.yaml b/packages/pack_wakeup_radio.yaml index 8e2dace8..a0021539 100644 --- a/packages/pack_wakeup_radio.yaml +++ b/packages/pack_wakeup_radio.yaml @@ -25,26 +25,27 @@ wakeup_radio_pack: - alias: "Wakeup Radio - Childrens" id: 75d1f4fc-c40b-433a-b6bc-ed480b53365e - trigger: - platform: time + triggers: + trigger: time at: input_datetime.wakeup_radio_in_nursery - condition: + conditions: - condition: state entity_id: binary_sensor.workday_sensor state: "on" - condition: state entity_id: calendar.semia_alexander_borsiov_school_vacation_egor state: "off" - action: + actions: - if: - "{{ state_attr('media_player.yandex_station_lite_detskaia', 'volume_level') != 0.1 }}" then: - repeat: sequence: - - service: media_player.volume_set - data: + - 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" @@ -57,7 +58,7 @@ wakeup_radio_pack: then: - repeat: sequence: - - service: media_player.volume_mute + - action: media_player.volume_mute target: entity_id: media_player.yandex_station_lite_detskaia data: @@ -70,9 +71,10 @@ wakeup_radio_pack: - delay: "00:00:01" - - service: yandex_station.send_command - data: + - 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') }} @@ -82,7 +84,7 @@ wakeup_radio_pack: - if: - "{{ state_attr('media_player.yandex_station_lite_detskaia', 'volume_level') != 0.1 }}" then: - - service: media_player.volume_set + - action: media_player.volume_set target: entity_id: media_player.yandex_station_lite_detskaia data: @@ -95,12 +97,13 @@ wakeup_radio_pack: value_template: "{{ repeat.index <= 4 }}" sequence: - delay: "00:03:00" - - service: media_player.volume_up + - action: media_player.volume_up target: entity_id: media_player.yandex_station_lite_detskaia - - service: yandex_station.send_command - data: + - action: yandex_station.send_command + target: entity_id: media_player.yandex_station_lite_detskaia + data: command: sendText text: Повтори за мной 'Доброе утро дети, пора вставать!' \ No newline at end of file diff --git a/packages/pack_water_leak.yaml b/packages/pack_water_leak.yaml index 895d0ad4..0afad5c8 100644 --- a/packages/pack_water_leak.yaml +++ b/packages/pack_water_leak.yaml @@ -27,18 +27,20 @@ water_leak_protection: neptun_state_reset: alias: Reset Neptun State in HA (TurnOff) sequence: - - service: input_boolean.turn_off - data: + - action: input_boolean.turn_off + target: entity_id: input_boolean.neptun_activated water_valves_close: alias: "Закрытие водопроводных кранов" sequence: - - service: switch.turn_on - entity_id: switch.rele_aqara_vodoprovodnye_krany_l2 + - action: switch.turn_on + target: + entity_id: switch.rele_aqara_vodoprovodnye_krany_l2 - delay: '00:00:30' - - service: switch.turn_off - entity_id: switch.rele_aqara_vodoprovodnye_krany_l2 + - action: switch.turn_off + target: + entity_id: switch.rele_aqara_vodoprovodnye_krany_l2 water_valves_open: alias: "Открытие водопроводных кранов" @@ -49,23 +51,30 @@ water_leak_protection: entity_id: binary_sensor.neptun_water_leakage state: 'on' sequence: - - service: switch.turn_off - entity_id: switch.sonoff_1000b68886 - - service: switch.turn_on - entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 + - action: switch.turn_off + target: + entity_id: switch.sonoff_1000b68886 + - action: switch.turn_on + target: + entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 - delay: '00:00:30' - - service: switch.turn_off - entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 - - service: switch.turn_on - entity_id: switch.sonoff_1000b68886 - - service: script.turn_on - entity_id: script.neptun_state_reset + - action: switch.turn_off + target: + entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 + - action: switch.turn_on + target: + entity_id: switch.sonoff_1000b68886 + - action: script.turn_on + target: + entity_id: script.neptun_state_reset default: - - service: switch.turn_on - entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 + - action: switch.turn_on + target: + entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 - delay: '00:00:30' - - service: switch.turn_off - entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 + - action: switch.turn_off + target: + entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 # Automations automation: @@ -73,8 +82,8 @@ water_leak_protection: # Защита от протечек - отключение подачи воды по датчикам - alias: Water Leak Detected id: 2eb96392-3d8a-41b7-87f2-7c6e5c5b6232 - trigger: - platform: state + triggers: + trigger: state entity_id: - binary_sensor.neptun_water_leakage - binary_sensor.0x158d000400e77d_moisture @@ -82,70 +91,69 @@ water_leak_protection: - binary_sensor.lumi_lumi_sensor_wleak_aq1_ias_zone from: 'off' to: 'on' - action: - - service: script.turn_on - data: + actions: + - action: script.turn_on + target: entity_id: script.water_valves_close # Получение активации Нептуна - alias: Catch Neptun Activated id: 0e013823-d5f8-4362-b7aa-2be3c25da064 mode: queued - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.lumi_lumi_sensor_magnet_opening from: 'on' to: 'off' for: "00:00:05" - condition: + conditions: condition: state entity_id: input_boolean.neptun_activated state: 'off' - action: - - service: input_boolean.turn_on - data: + 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 - trigger: - platform: state + triggers: + trigger: state entity_id: switch.sonoff_1000b68886 from: 'off' to: 'on' - condition: + conditions: condition: state entity_id: input_boolean.neptun_activated state: 'on' - action: - - service: input_boolean.turn_off - data: + actions: + - action: input_boolean.turn_off + target: entity_id: input_boolean.neptun_activated # Перезагрузка контроллера Нептун раз в 2 недели (обход проворота кранов раз в месяц) - alias: Restart Neptun [twice a month] id: 896b9256-93fc-41d2-8ffc-a4c6503f62e0 - trigger: - - platform: time + triggers: + - trigger: time at: "11:00:00" - condition: - condition: and - conditions: + conditions: + - and: - condition: time weekday: mon - condition: template value_template: "{{ (as_timestamp(now())|timestamp_custom ('%W') | int % 2) == 1 }}" - action: - - service: switch.turn_off - data: + actions: + - action: switch.turn_off + target: entity_id: switch.sonoff_1000b68886 - delay: 5 - - service: switch.turn_on - data: + - action: switch.turn_on + target: entity_id: switch.sonoff_1000b68886 - - service: notify.telegram_group_flat_1 + - action: notify.telegram_group_flat_1 data: message: | _INFO:_ Нептун был перезапущен. @@ -153,31 +161,31 @@ water_leak_protection: # Автоматическое отключение напряжения на кранах (работа >60 сек) - alias: PowerOff Valves After 60 Seconds id: ac6042cd-ab15-4ff2-a0ed-9f873830d221 - trigger: - - platform: state + triggers: + - trigger: state entity_id: - switch.rele_aqara_vodoprovodnye_krany_l1 - switch.rele_aqara_vodoprovodnye_krany_l2 to: 'on' for: "00:01:00" - action: - service: switch.turn_off - data: + actions: + action: switch.turn_off + target: entity_id: "{{ trigger.entity_id }}" # Software Interlock - alias: Valves Relay Software Interlock id: f16be388-8c31-43d0-905b-d9c31968414c - trigger: - - platform: state + triggers: + - trigger: state entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 to: "on" id: open - - platform: state + - trigger: state entity_id: switch.rele_aqara_vodoprovodnye_krany_l2 to: "on" id: close - action: + actions: - choose: - alias: "open_channel_to_on" conditions: @@ -187,7 +195,7 @@ water_leak_protection: - if: - "{{ is_state('switch.rele_aqara_vodoprovodnye_krany_l2', 'on') }}" then: - - service: switch.turn_off + - action: switch.turn_off target: entity_id: switch.rele_aqara_vodoprovodnye_krany_l2 - alias: "close_channel_to_on" @@ -198,41 +206,41 @@ water_leak_protection: - if: - "{{ is_state('switch.rele_aqara_vodoprovodnye_krany_l1', 'on') }}" then: - - service: switch.turn_off + - action: switch.turn_off target: entity_id: switch.rele_aqara_vodoprovodnye_krany_l1 # Оповещения - alias: Оповещения об активации датчиков [notify to group flat] id: 54d437ce-2ec6-4779-93cb-3f36fe99b44c - trigger: - - platform: state + triggers: + - trigger: state entity_id: binary_sensor.neptun_water_leakage to: "on" id: "neptun_on" - - platform: state + - trigger: state entity_id: binary_sensor.0x158d000400e77d_moisture from: "off" to: "on" id: "aqara_storeroom_on" - - platform: state + - trigger: state entity_id: binary_sensor.0x158d0004030d84_moisture from: "off" to: "on" id: "aqara_under_bath_on" - - platform: state + - trigger: state entity_id: binary_sensor.lumi_lumi_sensor_wleak_aq1_ias_zone from: "off" to: "on" id: "aqara_03_near_door" - action: + actions: - choose: - alias: "neptun_on" conditions: - condition: trigger id: "neptun_on" sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" @@ -247,7 +255,7 @@ water_leak_protection: - condition: trigger id: "aqara_storeroom_on" sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" @@ -262,7 +270,7 @@ water_leak_protection: - condition: trigger id: "aqara_under_bath_on" sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" @@ -277,7 +285,7 @@ water_leak_protection: - condition: trigger id: "aqara_03_near_door" sequence: - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" @@ -290,25 +298,25 @@ water_leak_protection: - alias: Оповещение о деактивации Нептуна [notify to group flat] id: 344fff46-b0f1-41c3-b6e7-6386b5bc1256 - trigger: - platform: state + triggers: + trigger: state entity_id: binary_sensor.neptun_water_leakage to: "off" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 message: Нептун деактивирован. - alias: Оповещение об отключенном Нептуне (>2 мин) id: 1a017a47-40b1-4315-892e-36760a8e86ec - trigger: - platform: state + triggers: + trigger: state entity_id: switch.sonoff_1000b68886 to: 'off' for: "00:02:00" - action: - - service: telegram_bot.send_message + actions: + - action: telegram_bot.send_message data: target: !secret tlg_group_flat_1 title: "*Внимание!*" @@ -319,19 +327,20 @@ water_leak_protection: - alias: 'Neptune - Telegram Control - Open' id: d42cd9f6-1a89-4116-8348-d99970407b75 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: '/neptune_poweron' - action: - - service: switch.turn_on - entity_id: switch.sonoff_1000b68886 - - service: telegram_bot.answer_callback_query - data_template: + 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: 'Команда отправлена' - - service: telegram_bot.edit_message + - action: telegram_bot.edit_message data: message_id: '{{ trigger.event.data.message.message_id }}' chat_id: '{{ trigger.event.data.chat_id }}' @@ -341,32 +350,33 @@ water_leak_protection: - alias: 'Water Valves - Telegram Control - Open' id: b5321723-bc10-4146-88a5-7080d0fe70a8 - trigger: - platform: event + triggers: + trigger: event event_type: telegram_callback event_data: data: '/water_valves_open' - action: - - service: script.turn_on - entity_id: script.water_valves_open - - service: telegram_bot.answer_callback_query - data_template: + 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: 'Команда отправлена' - - service: telegram_bot.edit_replymarkup + - 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: - - platform: state + - trigger: state entity_id: script.water_valves_open from: "on" to: "off" timeout: "00:00:40" continue_on_timeout: false - - service: telegram_bot.send_message + - action: telegram_bot.send_message data: target: '{{ trigger.event.data.chat_id }}' message: "Водопроводные краны открыты." \ No newline at end of file diff --git a/packages/pack_water_meters.yaml b/packages/pack_water_meters.yaml index ed2261c5..7f9e74cb 100644 --- a/packages/pack_water_meters.yaml +++ b/packages/pack_water_meters.yaml @@ -69,7 +69,7 @@ water_meters_pack: template: - trigger: - - platform: state + - trigger: state entity_id: - sensor.saures_water_meter_13193152_hot not_to: @@ -89,7 +89,7 @@ water_meters_pack: {% endif %} - trigger: - - platform: state + - trigger: state entity_id: - sensor.saures_water_meter_09_104476_cold not_to: @@ -112,11 +112,11 @@ water_meters_pack: automation: - alias: Update Saures Sensors after HA Start id: c0192c64-d64b-45b6-ab2e-91170c12f591 - trigger: - - platform: homeassistant + triggers: + - trigger: homeassistant event: start - action: + actions: - wait_template: "{{ has_value('sensor.saures_api_sid') }}" - - service: homeassistant.update_entity + - action: homeassistant.update_entity target: entity_id: sensor.saures_controller_1113513_battery \ No newline at end of file diff --git a/packages/pack_xiaomi_gtw3.yaml b/packages/pack_xiaomi_gtw3.yaml index d6130d53..ae124df9 100644 --- a/packages/pack_xiaomi_gtw3.yaml +++ b/packages/pack_xiaomi_gtw3.yaml @@ -35,41 +35,44 @@ # script: # mi_gw3_reboot: # sequence: -# - service: remote.send_command -# data: +# - action: remote.send_command +# target: # entity_id: "{{ states('input_text.xiaomi_gateway3_id') }}" +# data: # command: reboot # mi_gw3_enable_ftp: # sequence: -# - service: remote.send_command -# data: +# - action: remote.send_command +# target: # entity_id: "{{ states('input_text.xiaomi_gateway3_id') }}" +# data: # command: ftp # mi_gw3_pair_on: # sequence: -# - service: remote.turn_on -# data: +# - action: remote.turn_on +# target: # entity_id: "{{ states('input_text.xiaomi_gateway3_id') }}" # mi_gw3_pair_off: # sequence: -# - service: remote.turn_off -# data: +# - action: remote.turn_off +# target: # entity_id: "{{ states('input_text.xiaomi_gateway3_id') }}" # Automations # automation: # - alias: 'Mirror Gtw3 input_select Name to ID' # id: 1431ee14-08ae-4c0b-bb44-d55faa8e406c -# trigger: -# platform: state +# triggers: +# trigger: state # entity_id: input_select.xiaomi_gateway3_name -# action: -# - service: input_text.set_value -# data: +# actions: +# - action: input_text.set_value +# target: # entity_id: input_text.xiaomi_gateway3_id +# data: # value: > # {% if trigger.to_state.state == 'Gateway 3-1' %} # remote.0x588e81fffedca899_pair diff --git a/packages/pack_ya_music.yaml b/packages/pack_ya_music.yaml index 6de6887d..a73c2653 100644 --- a/packages/pack_ya_music.yaml +++ b/packages/pack_ya_music.yaml @@ -46,13 +46,15 @@ ya_music_pack: - if: - "{{ '(Яндекс)' in states('input_select.yandex_station_start_stream_to') }}" then: - - service: media_player.volume_set - data: + - action: media_player.volume_set + target: entity_id: "{{ states('input_text.yandex_station_device_to_play') }}" - volume_level: "{{ states('input_number.volume_ya_music') }}" - - service: yandex_station.send_command data: + volume_level: "{{ states('input_number.volume_ya_music') }}" + - action: yandex_station.send_command + target: entity_id: "{{ states('input_text.yandex_station_device_to_play') }}" + data: command: sendText text: >- Включи {{ states('input_text.yandex_station_start_stream_query') }} @@ -60,11 +62,12 @@ ya_music_pack: - if: - "{{ 'Мини в Ванной' in states('input_text.yandex_station_device_to_play') }}" then: - - service: media_player.volume_set - data: + - action: media_player.volume_set + target: entity_id: media_player.mini_v_vannoi + data: volume_level: "{{ states('input_number.volume_ya_music') }}" - - service: script.alice_start_stream_from_prikhozhaya + - action: script.alice_start_stream_from_prikhozhaya ya_music_stop: alias: Stop Ya Music @@ -72,12 +75,12 @@ ya_music_pack: - if: - "{{ 'Мини в Ванной' in states('input_text.yandex_station_device_to_play') }}" then: - - service: media_player.turn_off - data: + - action: media_player.turn_off + target: entity_id: media_player.mini_v_vannoi else: - - service: media_player.turn_off - data: + - action: media_player.turn_off + target: entity_id: "{{ states('input_text.yandex_station_device_to_play') }}" alice_start_stream_from_prikhozhaya: @@ -89,7 +92,7 @@ ya_music_pack: then: - repeat: sequence: - - service: media_player.select_source + - action: media_player.select_source target: entity_id: media_player.yandex_station_lite_prikhozhaya data: @@ -106,9 +109,10 @@ ya_music_pack: then: - repeat: sequence: - - service: media_player.volume_set - data: + - 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" @@ -121,7 +125,7 @@ ya_music_pack: then: - repeat: sequence: - - service: media_player.volume_mute + - action: media_player.volume_mute target: entity_id: media_player.yandex_station_lite_prikhozhaya data: @@ -132,7 +136,7 @@ ya_music_pack: - "{{ state_attr('media_player.yandex_station_lite_prikhozhaya', 'is_volume_muted') == true }}" - "{{ repeat.index <= 3 }}" - - service: yandex_station.send_command + - action: yandex_station.send_command target: entity_id: media_player.yandex_station_lite_prikhozhaya data: @@ -145,7 +149,7 @@ ya_music_pack: - if: - "{{ not wait.completed }}" then: - - service: media_player.media_pause + - action: media_player.media_pause target: entity_id: media_player.yandex_station_lite_prikhozhaya @@ -154,15 +158,16 @@ ya_music_pack: - alias: "Ya Music - Selected Name to Device" id: 2a16fa66-67a7-4960-95b0-9b766528f44d - trigger: - - platform: homeassistant + triggers: + - trigger: homeassistant event: start - - platform: state + - trigger: state entity_id: input_select.yandex_station_start_stream_to - action: - - service: input_text.set_value - data: + 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)") -%} Мини в Ванной @@ -176,40 +181,42 @@ ya_music_pack: - alias: "Ya Music - Volume Control" id: 0303b471-3e9c-436a-84c0-cc5784eee706 - trigger: - platform: state + triggers: + trigger: state entity_id: input_number.volume_ya_music - action: + actions: - if: - "{{ 'Мини в Ванной' in states('input_text.yandex_station_device_to_play') }}" then: - - service: media_player.volume_set - data: + - action: media_player.volume_set + target: entity_id: media_player.mini_v_vannoi + data: volume_level: "{{ states('input_number.volume_ya_music') }}" else: - - service: media_player.volume_set - data: + - 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 - trigger: - - platform: state + triggers: + - trigger: state entity_id: media_player.mini_v_vannoi from: playing to: "off" - condition: + conditions: condition: state entity_id: media_player.yandex_station_lite_prikhozhaya state: playing - action: - - service: media_player.media_pause + actions: + - action: media_player.media_pause target: entity_id: media_player.yandex_station_lite_prikhozhaya - delay: "00:00:01" - - service: media_player.select_source + - action: media_player.select_source target: entity_id: media_player.yandex_station_lite_prikhozhaya data: diff --git a/packages/pack_ya_station_stop.yaml b/packages/pack_ya_station_stop.yaml index 5ca467ee..47aafbca 100644 --- a/packages/pack_ya_station_stop.yaml +++ b/packages/pack_ya_station_stop.yaml @@ -40,51 +40,51 @@ ya_station_stop_pack: automation: - alias: Stop Yandex Station - trigger: - - platform: event + triggers: + - trigger: event event_type: yandex_intent event_data: text: Выключи колонку в детской id: nursery - - platform: event + - trigger: event event_type: yandex_intent event_data: text: Выключи колонку в гостиной id: livingroom - - platform: event + - trigger: event event_type: yandex_intent event_data: text: Выключи колонку на кухне id: livingroom - - platform: event + - trigger: event event_type: yandex_intent event_data: text: Выключи колонку в спальне id: bedroom - - platform: event + - trigger: event event_type: yandex_intent event_data: text: Выключи колонку в прихожей id: hallway - action: + actions: - choose: - conditions: "{{ trigger.id == 'nursery' }}" sequence: - - service: media_player.turn_off - data: + - action: media_player.turn_off + target: entity_id: media_player.yandex_station_lite_detskaia - conditions: "{{ trigger.id == 'livingroom' }}" sequence: - - service: media_player.turn_off - data: + - action: media_player.turn_off + target: entity_id: media_player.yandex_station_mini2_gostinaia - conditions: "{{ trigger.id == 'bedroom' }}" sequence: - - service: media_player.turn_off - data: + - action: media_player.turn_off + target: entity_id: media_player.yandex_station_mini2_spalnia - conditions: "{{ trigger.id == 'hallway' }}" sequence: - - service: media_player.turn_off - data: + - action: media_player.turn_off + target: entity_id: media_player.yandex_station_lite_prikhozhaya \ No newline at end of file diff --git a/scripts/scr_lights.yaml b/scripts/scr_lights.yaml index 15c8b566..4d84c807 100644 --- a/scripts/scr_lights.yaml +++ b/scripts/scr_lights.yaml @@ -5,7 +5,8 @@ toggle_kitchen_led_automation: alias: Переключение статуса автоматизации подсветки на кухне sequence: - - service: homeassistant.toggle - entity_id: - - automation.podsvetka_na_kukhne_sensor_dvizheniia_vkl - - automation.podsvetka_na_kukhne_sensor_dvizheniia_vykl \ No newline at end of file + - action: homeassistant.toggle + target: + entity_id: + - automation.podsvetka_na_kukhne_sensor_dvizheniia_vkl + - automation.podsvetka_na_kukhne_sensor_dvizheniia_vykl \ No newline at end of file diff --git a/scripts/scr_media.yaml b/scripts/scr_media.yaml index fad9ad9a..a74f2c68 100644 --- a/scripts/scr_media.yaml +++ b/scripts/scr_media.yaml @@ -8,6 +8,6 @@ power_off_samsungtv_40c5100: - condition: state entity_id: binary_sensor.samsungtv_40c5100 state: "on" - - service: switch.turn_on - data: + - action: switch.turn_on + target: entity_id: switch.smartir_01_tv_samsung_power diff --git a/scripts/scr_misc.yaml b/scripts/scr_misc.yaml index 1bd53354..08f016f6 100644 --- a/scripts/scr_misc.yaml +++ b/scripts/scr_misc.yaml @@ -5,25 +5,25 @@ reboot_beurer_carecam_01: alias: Reboot Beurer CareCam 01 sequence: - - service: shell_command.reboot_beurer_carecam - data_template: + - action: shell_command.reboot_beurer_carecam + data: ip_addr: 172.16.16.217 hass_restart: alias: Restart Home Assistant sequence: - - service: homeassistant.restart + - action: homeassistant.restart hass_check_config: alias: Check Config sequence: - - service: homeassistant.check_config + - action: homeassistant.check_config hass_errors_counter_set_at_startup: alias: Set Errors Counter at Startup sequence: - wait_template: "{{ (states('sensor.errors_in_system_log_command_line') | int(-1)) >= 0 }}" - - service: counter.set_value + - action: counter.set_value target: entity_id: counter.syslog_errors data: @@ -33,7 +33,7 @@ hass_warnings_counter_set_at_startup: alias: Set Warnings Counter at Startup sequence: - wait_template: "{{ (states('sensor.warnings_in_system_log_command_line') | int(-1)) >= 0 }}" - - service: counter.set_value + - action: counter.set_value target: entity_id: counter.syslog_warnings data: