- alias: system_set_radio_volume id: system_set_radio_volume initial_state: true triggers: - trigger: state entity_id: input_number.volume_radio to: null actions: - action: media_player.volume_set data: entity_id: '{% if is_state("input_select.chromecast_radio", "Kitchen") %} media_player.yandex_k {% elif is_state("input_select.chromecast_radio", "Vova room") %} media_player.yandex_v {% elif is_state("input_select.chromecast_radio", "Sasha room") %} media_player.yandex_s {% elif is_state("input_select.chromecast_radio", "Master Bedroom") %} media_player.yandex_mb {% elif is_state("input_select.chromecast_radio", "Hall big") %} media_player.yandex_hb {% endif %} ' volume_level: '{{ states(''input_number.volume_radio'') }}' - alias: master_bedroom_breather_auto_co2 id: master_bedroom_breather_auto_co2 initial_state: true triggers: - trigger: time_pattern minutes: /3 conditions: - condition: state entity_id: switch.system_breather_auto_mb state: 'on' - condition: not conditions: - condition: state entity_id: switch.system_breather_manual_mb state: 'on' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.0x00158d000200ad58_contact state: 'off' - condition: numeric_state entity_id: sensor.esp32_node_mb_co2 above: input_number.co2_high_limit - condition: state entity_id: binary_sensor.breather_mb state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: numeric_state entity_id: sensor.0x00158d000222c746_temperature above: 20 sequence: - action: fan.turn_on entity_id: fan.breather_mb - condition: numeric_state entity_id: sensor.esp32_node_mb_co2 above: input_number.co2_high_limit - condition: state entity_id: switch.system_breather_auto_speed_mb state: 'on' - action: fan.set_percentage entity_id: fan.breather_mb data: percentage: '{{states(''sensor.breather_set_speed_mb'')|int(0) }}' - conditions: - condition: state entity_id: binary_sensor.0x00158d000200ad58_contact state: 'off' - condition: numeric_state entity_id: sensor.esp32_node_mb_co2 above: input_number.co2_high_limit - condition: state entity_id: binary_sensor.breather_mb state: 'on' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: switch.system_breather_auto_speed_mb state: 'on' - condition: numeric_state entity_id: sensor.breather_set_speed_mb above: 0 sequence: - action: fan.set_percentage entity_id: fan.breather_mb data: percentage: '{{states(''sensor.breather_set_speed_mb'')|int(0) }}' - conditions: - or: - and: - condition: state entity_id: binary_sensor.0x00158d000200ad58_contact state: 'off' - condition: numeric_state entity_id: sensor.esp32_node_mb_co2 below: input_number.co2_low_limit - condition: state entity_id: binary_sensor.breather_mb state: 'on' - and: - or: - condition: numeric_state entity_id: sensor.0x00158d000222c746_temperature below: 20 - condition: state entity_id: binary_sensor.0x00158d000200ad58_contact state: 'on' - condition: state entity_id: binary_sensor.breather_mb state: 'on' sequence: - action: fan.turn_off entity_id: fan.breather_mb - alias: master_bedroom_breather_auto_timer id: master_bedroom_breather_auto_timer initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Выключи вентиляцию id: to_off_alice - trigger: event event_type: yandex_intent event_data: text: Включи вентиляцию id: to_on_alice - trigger: time at: 09:00:00 id: time_trigger_day conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: trigger id: to_off_alice sequence: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_mb'' }}' - if: - condition: state entity_id: binary_sensor.breather_mb state: 'on' then: - action: fan.turn_off entity_id: fan.breather_mb - action: switch.turn_on entity_id: switch.system_breather_auto_mb - conditions: - condition: trigger id: to_on_alice sequence: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_mb'' }}' - if: - condition: state entity_id: binary_sensor.breather_mb state: 'off' then: - action: fan.turn_on entity_id: fan.breather_mb - action: switch.turn_on entity_id: switch.system_breather_manual_mb - conditions: - condition: trigger id: time_trigger_night sequence: - action: switch.turn_on entity_id: switch.system_breather_manual_mb - action: fan.set_percentage entity_id: fan.breather_mb data: percentage: 50 - conditions: - condition: trigger id: time_trigger_day sequence: - action: fan.turn_off entity_id: fan.breather_mb - alias: master_bedroom_breather_switches_interlock id: master_bedroom_breather_switches_interlock triggers: - trigger: state entity_id: - switch.system_breather_auto_mb - switch.system_breather_manual_mb conditions: - condition: template value_template: '{{ trigger.to_state.state == ''on'' }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: homeassistant.turn_off target: entity_id: '{% if trigger.from_state.entity_id == ''switch.system_breather_auto_mb'' %} {{ ''switch.system_breather_manual_mb'' }} {% else %} {{ ''switch.system_breather_auto_mb'' }} {% endif %}' - alias: master_bedroom_breather_switches_default id: master_bedroom_breather_switches_default triggers: - trigger: template value_template: '{{ is_state(''switch.system_breather_auto_mb'',''off'') and is_state(''switch.system_breather_manual_mb'',''off'') }}' conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: switch.turn_on entity_id: switch.system_breather_auto_mb - alias: system_calendar_events_to_list id: system_calendar_events_to_list triggers: - event: start platform: homeassistant - trigger: time at: 00:00:00 actions: - action: input_select.set_options target: entity_id: input_select.calendar_events_list data: options: Нет событий - event: calendar_event_list_updated - action: script.calendar_events data: calendar: calendar.dima_tsymbal_gmail_com make_choice: true choice_word: день рождения response_variable: events - if: - condition: template value_template: '{{ events | length > 0 }}' then: - action: input_select.set_options target: entity_id: input_select.calendar_events_list data: options: '{{ (state_attr(''input_select.calendar_events_list'', ''options'') | join(''|'') + ''|'' + events.values() | list | join(''|'')).split(''|'') | select(''ne'', '''') | unique | list }}' - event: calendar_event_list_updated - action: script.calendar_events data: calendar: calendar.prazdniki_rossii_polnyi response_variable: events - if: - condition: template value_template: '{{ events | length > 0 }}' then: - action: input_select.set_options target: entity_id: input_select.calendar_events_list data: options: '{{ (state_attr(''input_select.calendar_events_list'', ''options'') | join(''|'') + ''|'' + events.values() | list | join(''|'')).split(''|'') | select(''ne'', '''') | unique | list }}' - event: calendar_event_list_updated - alias: system_snapshot_window id: system_snapshot_window initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.g5_bullet_window_motion from: 'off' to: 'on' conditions: - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.system_snapshot_window'', ''last_triggered''),0)|int(0)) > 10 }}' actions: - action: notify.telegram_cam data: message: Window data: photo: - url: http://localhost:1984/api/frame.jpeg?src=g5_window caption: 📷 Window {{states('sensor.time')}} {{states('sensor.date')}} - alias: system_snapshot_yard id: system_snapshot_yard initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.g5_bullet_yard_motion from: 'off' to: 'on' conditions: - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.system_snapshot_yard'', ''last_triggered''),0)|int(0)) > 10 }}' actions: - action: notify.telegram_cam data: message: Yard data: photo: - url: http://localhost:1984/api/frame.jpeg?src=g5_yard caption: 📷 Yard {{states('sensor.time')}} {{states('sensor.date')}} - alias: system_snapshot_dixy id: system_snapshot_dixy initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.g5_turret_dixy_motion from: 'off' to: 'on' conditions: - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.system_snapshot_dixy'', ''last_triggered''),0)|int(0)) > 10 }}' actions: - action: notify.telegram_cam data: message: Dixy data: photo: - url: http://localhost:1984/api/frame.jpeg?src=g5_dixy caption: 📷 Dixy {{states('sensor.time')}} {{states('sensor.date')}} - alias: system_snapshot_street id: system_snapshot_street initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.g5_turret_street_motion from: 'off' to: 'on' conditions: - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.system_snapshot_street'', ''last_triggered''),0)|int(0)) > 10 }}' actions: - action: notify.telegram_cam data: message: Street data: photo: - url: http://localhost:1984/api/frame.jpeg?src=g5_street caption: 📷 Street {{states('sensor.time')}} {{states('sensor.date')}} - alias: system_snaphot_outside id: system_snaphot_outside initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.g4_doorbell_motion from: 'off' to: 'on' conditions: - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.system_snaphot_outside'', ''last_triggered''),0)|int(0)) > 15 }}' actions: - action: notify.telegram_cam data: message: Doorbell data: photo: - url: http://localhost:1984/api/frame.jpeg?src=g4_doorbell caption: 📷 Doorbell {{states('sensor.time')}} {{states('sensor.date')}} - alias: hall_big_domofon_incoming_call id: hall_big_domofon_incoming_call initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.esp32_domofon_incomingcall to: 'on' from: 'off' actions: - parallel: - action: switch.turn_on entity_id: switch.kiosk_screen - parallel: - action: notify.telegram data: title: '{{states(''sensor.time'')}} {{states(''sensor.date'')}}' message: '{{states(''sensor.time'')}} {{states(''sensor.date'')}}' data: photo: - url: http://localhost:1984/api/frame.jpeg?src=g5_window caption: 📣 Звонок в домофон {{states('sensor.time')}} {{states('sensor.date')}} - action: notify.telegram_cam data: title: '{{states(''sensor.time'')}} {{states(''sensor.date'')}}' message: '{{states(''sensor.time'')}} {{states(''sensor.date'')}}' data: photo: - url: http://localhost:1984/api/frame.jpeg?src=g5_window caption: 📣 Звонок в домофон {{states('sensor.time')}} {{states('sensor.date')}} - if: - condition: state entity_id: person.sasha state: home then: - action: notify.hass_synochat data: message: Внимание Зконок в домофон data: file_url: http://localhost:1984/api/frame.jpeg?src=g5_window - or: - condition: state entity_id: switch.system_silent_mode state: 'on' - condition: state entity_id: switch.esp32_domofon_mute state: 'on' - action: light.turn_on data: entity_id: light.esp32_node_k_led effect: Green_Alarm brightness: 255 - delay: 00:00:20 - action: light.turn_off entity_id: light.esp32_node_k_led - alias: hall_big_domofon_open_from_iphone id: hall_big_domofon_open_from_iphone initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: mobile_app_notification_action event_data: service: Domofon_Open actions: - action: switch.turn_on entity_id: switch.esp32_domofon_open - action: notify.telegram data: message: 🔘 Домофон открыт с телефона - alias: hall_big_domofon_auto_message id: hall_big_domofon_auto_message initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.esp32_domofon_auto_opening from: 'off' to: 'on' actions: - action: notify.telegram data: message: 📞 Домофон открыт автоматически - alias: hall_big_domofon_auto_opening id: hall_big_domofon_auto_opening initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: switch.esp32_domofon_auto_open, switch.esp32_domofon_auto_open_once to: null conditions: - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ trigger.from_state.state\ \ not in ignore and\n trigger.to_state.state not in ignore and\n trigger.to_state.state\ \ = trigger.from_state.state\n}}" - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: notify.telegram data: message: '{% if is_state(''switch.esp32_domofon_auto_open'',''on'') and ''once'' not in trigger.to_state.entity_id %}{{''\U0001f513''}} Домофон: Автооткрытие включено {% elif is_state(''switch.esp32_domofon_auto_open_once'',''on'') and ''once'' in trigger.to_state.entity_id %}{{''\U0001f513''}} Домофон: Разовое автооткрытие включено {% else %}{{''\U0001f512''}} Домофон: Автооткрытие выключено{% endif %} ' - alias: hall_big_domofon_timer_on id: hall_big_domofon_timer_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: template value_template: '{{is_state(''switch.esp32_domofon_auto_open'',''on'') or is_state(''switch.esp32_domofon_auto_open_once'',''on'') }}' actions: - action: timer.cancel entity_id: timer.domofon - action: timer.start entity_id: timer.domofon - alias: hall_big_domofon_auto_open_turn_off id: hall_big_domofon_auto_open_turn_off initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.domofon actions: - action: switch.turn_off entity_id: switch.esp32_domofon_auto_open, switch.esp32_domofon_auto_open_once, switch.esp32_domofon_mute - alias: hall_big_domofon_timer_off id: hall_big_domofon_timer_off initial_state: true triggers: - trigger: template value_template: '{{not is_state(''switch.esp32_domofon_auto_open'',''on'') and not is_state(''switch.esp32_domofon_auto_open_once'',''on'') }}' actions: - action: timer.cancel entity_id: timer.domofon - alias: hall_big_domofon_button id: hall_big_domofon_button initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.esp32_domofon_button from: 'off' to: 'on' actions: - action: switch.turn_on entity_id: switch.kiosk_screen - action: telegram_bot.send_photo data: url: http://localhost:1984/api/frame.jpeg?src=g5_entrance caption: 🔘 Домофон открыт вручную target: secret tel_chat_id timeout: 180 - alias: hall_big_doorbell id: hall_big_doorbell initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: - binary_sensor.g4_doorbell_doorbell from: 'off' to: 'on' conditions: - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.hall_big_doorbell'', ''last_triggered''),0)|int(0)) > 10 }}' actions: - action: switch.turn_on entity_id: switch.kiosk_screen - parallel: - action: notify.telegram data: title: Doorbell photo message: 🔔 Внимание! Кто-то звонит в дверь! data: photo: - url: http://localhost:1984/api/frame.jpeg?src=g4_doorbell caption: 🔔 Внимание! Кто-то звонит в дверь! {{states('sensor.time')}} {{states('sensor.date')}} - if: - condition: state entity_id: person.sasha state: home then: - action: notify.hass_synochat data: message: Внимание! Кто-то звонит в дверь! data: file_url: http://localhost:1984/api/frame.jpeg?src=g4_doorbell - parallel: - action: light.turn_on data: entity_id: light.light_bar_s_ambilight effect: Police brightness: 255 - action: light.turn_on data: entity_id: light.esp32_node_k_led effect: Green_Alarm brightness: 255 - delay: 00:00:25 - wait_for_trigger: - trigger: state entity_id: - binary_sensor.582d344031f7_contact - binary_sensor.0x00158d0001e5d6be_contact from: 'on' to: 'off' timeout: seconds: 30 continue_on_timeout: true - action: light.turn_off entity_id: light.esp32_node_k_led, light.light_bar_s_ambilight - alias: emergency_backup id: emergency_backup initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.hass_backup_ping to: null - trigger: state entity_id: binary_sensor.hass_backup_state to: null actions: - action: notify.telegram data: message: '{% if is_state(''binary_sensor.hass_backup_ping'',''on'') and is_state(''binary_sensor.hass_backup_state'',''on'') %}{{''\U00002705''}} {% elif is_state(''binary_sensor.hass_backup_ping'',''on'') or is_state(''binary_sensor.hass_backup_state'',''on'') %}{{''\U000026a0''}} {% else %}{{''\U0000274C''}} {% endif %} Backup: HA - {{states(''binary_sensor.hass_backup_state'')|upper}}, host - {{states(''binary_sensor.hass_backup_ping'')|upper}}!' - alias: hall_big_fridge_not_closed_5m id: hall_big_fridge_not_closed_5m initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d000253722b_contact from: 'off' to: 'on' for: minutes: 5 actions: - action: notify.telegram data: message: 👁 Внимание! Холодильник не закрыт! - alias: hall_big_freezer_not_closed_5m id: hall_big_freezer_not_closed_5m initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d000252acba_contact from: 'off' to: 'on' for: minutes: 5 actions: - action: notify.telegram data: message: 👁 Внимание! Морозильник не закрыт! - alias: hall_big_fridge_temp_alarm id: hall_big_fridge_temp_alarm initial_state: true triggers: - trigger: time_pattern minutes: /15 conditions: - condition: numeric_state entity_id: sensor.ble_temperature_ble_fridge above: 15 actions: - action: notify.telegram data: message: 🌡 Внимание! Температура в холодильнике {{states('sensor.ble_temperature_ble_fridge')|int(0)}}°C! - alias: hall_big_freezer_temp_alarm id: hall_big_freezer_temp_alarm initial_state: true triggers: - trigger: time_pattern minutes: /15 conditions: - condition: numeric_state entity_id: sensor.ble_temperature_ble_freezer above: 0 actions: - action: notify.telegram data: message: 🌡 Внимание! Температура в морозилке {{states('sensor.ble_temperature_ble_freezer')|int(0)}}°C! - alias: hall_big_fridge_sensors_outage id: hall_big_fridge_sensors_outage mode: single max_exceeded: silent initial_state: true triggers: - trigger: time_pattern minutes: /30 conditions: - condition: template value_template: '{{ as_timestamp(now())- as_timestamp(states.sensor.ble_temperature_ble_fridge.last_updated) > 2*60*60 or as_timestamp(now())- as_timestamp(states.sensor.ble_temperature_ble_freezer.last_updated) > 2*60*60 or as_timestamp(now())- as_timestamp(states.sensor[''0x00158d000253722b_zigbee''].last_updated) > 2*60*60 or as_timestamp(now())- as_timestamp(states.sensor[''0x00158d000252acba_zigbee''].last_updated) > 2*60*60 }} ' actions: - action: notify.telegram data: message: '{{''\U0000274c''}} Внимание! Нет данных от датчика {%- if as_timestamp(now())- as_timestamp(states.sensor.ble_temperature_ble_fridge.last_updated) > 2*60*60 %} температуры холодильника {%- elif as_timestamp(now())- as_timestamp(states.sensor.ble_temperature_ble_freezer.last_updated) > 2*60*60 %} температуры морозилки {%- elif as_timestamp(now())- as_timestamp(states.sensor[''0x00158d000253722b_zigbee''].last_updated) > 2*60*60 %} двери холодильника {%- elif as_timestamp(now())- as_timestamp(states.sensor[''0x00158d000252acba_zigbee''].last_updated) > 2*60*60 %} двери морозилки {%-else%} ххх {%endif%}!' - alias: kitchen_briefing id: kitchen_briefing initial_state: true triggers: - trigger: time at: 07:05:00 - trigger: homeassistant event: start conditions: - condition: time after: 07:00:00 before: 07:15:00 - condition: template value_template: '{{(as_timestamp(now())|int(0) - as_timestamp(state_attr(''automation.kitchen_briefing'', ''last_triggered''),0)|int(0)) > 15*60 }}' - condition: state entity_id: binary_sensor.workday_sensor state: 'on' actions: - action: input_number.set_value data: entity_id: input_number.main_volume value: '0.4' - wait_for_trigger: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b4729d_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b48381_motion timeout: minutes: 15 continue_on_timeout: false - action: script.briefing_tts data: entity_id: media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - alias: kitchen_smoke_detected id: kitchen_smoke_detected initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d0002c92f31_smoke to: 'on' actions: - action: notify.telegram data: message: ⛔ Внимание! Сработал датчик дыма! - alias: kitchen_gas_detected id: kitchen_gas_detected initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d00024bcf85_gas to: 'on' actions: - action: notify.telegram data: message: ⛔ Внимание! Сработал датчик газа! - alias: kitchen_kettle_count id: kitchen_kettle_count initial_state: true triggers: - trigger: state entity_id: binary_sensor.kettle_boil_k from: 'off' to: 'on' actions: - action: counter.increment entity_id: counter.kettle_k - alias: kitchen_oven_notify id: kitchen_oven_notify initial_state: true triggers: - trigger: time_pattern minutes: /30 conditions: - condition: numeric_state entity_id: sensor.esp8266_oven_temp_k_temperature above: 100 - condition: state entity_id: binary_sensor.motion_k state: 'off' for: 00:30:00 actions: - action: notify.telegram data: message: 🌡 Внимание! Духовка включена ({{states('sensor.esp8266_oven_temp_k_temperature')|int(0)}}°C)! - alias: kitchen_tv_plug_off id: kitchen_tv_plug_off initial_state: true triggers: - trigger: state entity_id: binary_sensor.presence_k to: 'off' for: minutes: 30 conditions: - condition: time after: 00:00:00 before: 06:00:00 - condition: state entity_id: switch.0x00158d0001e85086_plug state: 'on' actions: - action: switch.turn_off entity_id: switch.0x00158d0001e85086_plug - alias: kitchen_tv_plug_on id: kitchen_tv_plug_on initial_state: true triggers: - trigger: state entity_id: binary_sensor.presence_k to: 'on' from: 'off' conditions: - condition: time after: 06:00:00 - condition: time before: 08:00:00 - condition: state entity_id: switch.0x00158d0001e85086_plug state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' actions: - action: switch.turn_on entity_id: switch.0x00158d0001e85086_plug - alias: kitchen_oven_notify_target_temp id: kitchen_oven_notify_target_temp initial_state: true triggers: - trigger: event event_type: automation_reloaded - trigger: state entity_id: binary_sensor.esp8266_oven_temp_k_oven_state to: 'on' conditions: - condition: template value_template: '{{ states(''sensor.oven_target_temperature'')|int(0) > 100 }}' - condition: template value_template: '{{as_timestamp(now()) - as_timestamp(state_attr(''automation.kitchen_oven_notify_target_temp'', ''last_triggered''),0) > 60*60 }}' - condition: state entity_id: binary_sensor.esp8266_oven_temp_k_oven_state state: 'on' actions: - wait_for_trigger: - trigger: template value_template: '{{ states(''sensor.esp8266_oven_temp_k_temperature'')|int(0) >= states(''sensor.oven_target_temperature'')|int(0) }}' timeout: minutes: 60 continue_on_timeout: false - action: notify.telegram data: message: 🌡 Духовка нагрелась до {{states('sensor.esp8266_oven_temp_k_temperature')|int(0)}}°C! - if: - condition: state entity_id: binary_sensor.tod_day state: 'on' - condition: state entity_id: switch.system_dark_mode state: 'off' then: - action: media_player.volume_set data: entity_id: media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: media_player.yandex_k media_content_id: Температура в духовке ({{states('sensor.esp8266_oven_temp_k_temperature')|int(0)}}°C - alias: kitchen_oven_notify_to_alice id: kitchen_oven_notify_to_alice initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Какая температура в духовке actions: - action: media_player.volume_set data: entity_id: media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: media_player.yandex_k media_content_id: Температура в духовке ({{states('sensor.esp8266_oven_temp_k_temperature')|int(0)}}°C - alias: kitchen_today_dishwasher id: kitchen_today_dishwasher initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Кто моет посуду actions: - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: '{{ trigger.event.data.entity_id }}' media_content_id: Сегодня посуду моет {% if is_state('input_select.dishwasher','Vova') %}{{['Вова','Володя','Владимир','Вовчик','Вовка']|random}}{%else%}{{['Саша','Санёк','Александр','Сашка']|random}}{%endif%} extra: volume_level: '{{states("input_number.main_volume")|float(0)}}' - alias: kitchen_tv_plug_toggle_button id: kitchen_tv_plug_toggle_button initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001ef61be_action click_type: single actions: - action: switch.toggle entity_id: switch.0x00158d0001e85086_plug - alias: system_fan_control_alice id: system_fan_control_alice initial_state: true mode: parallel triggers: - trigger: event event_type: yandex_intent event_data: text: Выключи вентиляцию id: 'off' - trigger: event event_type: yandex_intent event_data: text: Включи вентиляцию id: 'on' conditions: - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_k'' }}' actions: - action: fan.turn_{{ trigger.id }} entity_id: fan.esp8266_hood_k_fan - alias: system_location_notify id: system_location_notify initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: state entity_id: person.sandra, person.vova, person.sasha to: null conditions: - condition: template value_template: '{{ trigger.from_state.state != trigger.to_state.state }}' actions: - action: notify.telegram data: message: "{%- set from = trigger.from_state.state |replace('_',' ') | title\ \ %} {%- set to = trigger.to_state.state |replace('_',' ') | title %} {%-\ \ set person = trigger.to_state.attributes.friendly_name %} {%- if from ==\ \ 'Not Home' %}\n {%- set event = 'прибыл' %}\n{%- elif to == 'Not Home'\ \ %}\n {%- set event = 'покинул' %}\n{%- else %}\n {%- set event = 'переместился'\ \ %}\n{%- endif %} {%- if from == \"Not Home\" %} {{'\\U0001f30d'}} {{ person\ \ + ' ' + event + ' в ' + to }} {%- elif to == \"Not Home\" %} {{'\\U0001f30d'}}\ \ {{ person + ' ' + event + ' ' + from }} {%- else %} {{'\\U0001f30d'}} {{\ \ person + ' ' + event + ' из ' + from + ' в ' + to }} {%- endif %}" - alias: system_person_came_left_home id: system_person_came_left_home mode: parallel max: 10 max_exceeded: silent triggers: - trigger: state entity_id: - person.dima - person.sandra - person.sasha - person.vova to: null conditions: - condition: state entity_id: input_boolean.ha_shutdown state: 'off' for: seconds: 15 - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ trigger.from_state.state\ \ not in ignore and\n trigger.to_state.state not in ignore and\n trigger.to_state.state\ \ != trigger.from_state.state }} \n" actions: - choose: - conditions: - condition: template value_template: '{{ trigger.to_state.state == ''home'' and trigger.from_state.state != ''home'' }}' sequence: - event: person_came_home - action: logbook.log data: name: Person Came Home message: ' - {{ trigger.entity_id }}' entity_id: '{{ trigger.entity_id }}' - conditions: - condition: template value_template: '{{ trigger.to_state.state != ''home'' and trigger.from_state.state == ''home'' }}' sequence: - event: person_left_home - action: logbook.log data: name: Person Left Home message: ' - {{ trigger.entity_id }}' entity_id: '{{ trigger.entity_id }}' - alias: system_location_home_mode id: system_location_home_mode triggers: - trigger: state entity_id: sensor.people_home to: '1' id: non_vac - trigger: state entity_id: sensor.people_home to: '0' for: hours: 24 id: vac actions: - choose: - conditions: - condition: trigger id: non_vac sequence: - variables: txt: '{% if states(''sensor.people_home'')|int(0) > 0 %} Home {% elif states(''sensor.people_home'')|int(0) == 0 %} Away {% endif %}' - action: input_select.select_option entity_id: input_select.home_mode data: option: '{{ txt }}' - conditions: - condition: trigger id: vac sequence: - action: input_select.select_option entity_id: input_select.home_mode data: option: Vacation - alias: hall_big_main_door_locks id: hall_big_main_door_locks initial_state: true triggers: - trigger: state entity_id: binary_sensor.top_lock to: null id: lock_top - trigger: state entity_id: binary_sensor.bottom_lock to: null id: lock_bottom conditions: - condition: numeric_state entity_id: sensor.ha_uptime above: 2 - condition: state entity_id: input_boolean.ha_shutdown state: 'off' - condition: template value_template: '{{ states(''binary_sensor.top_lock'') in [''on'',''off''] and states(''binary_sensor.top_lock'') in [''on'',''off''] }}' - condition: template value_template: '{{ trigger.from_state.state != trigger.to_state.state }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: trigger id: lock_top sequence: - action: notify.telegram data: message: '{% if is_state(''binary_sensor.top_lock'',''on'') %}🔓🔼 Верхний замок открыт!{% else %}🔒🔼 Верхний замок закрыт!{% endif %}' - conditions: - condition: trigger id: lock_bottom sequence: - action: notify.telegram data: message: '{% if is_state(''binary_sensor.bottom_lock'',''on'') %}🔓🔽 Нижний замок открыт!{% else %}🔒🔽 Нижний замок закрыт!{% endif %}' - action: script.turn_on entity_id: script.domofon_locks_indicator - alias: hall_big_main_door_not_closed_3m id: hall_big_main_door_not_closed_3m initial_state: true triggers: - trigger: time_pattern minutes: /3 conditions: - condition: state entity_id: - binary_sensor.0x00158d0001e5d6be_contact state: 'on' for: minutes: 3 actions: - if: - condition: state entity_id: binary_sensor.tod_day state: 'on' then: - action: media_player.volume_set data: entity_id: - media_player.yandex_hb volume_level: '0.7' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: media_player.yandex_hb media_content_id: Вним+ание! Входн+ая дв+ерь н+е закр+ыта! Входн+ая дв+ерь н+е закр+ыта! - action: notify.telegram data: message: 👁 Внимание! Входная дверь НЕ закрыта! - action: script.turn_on entity_id: script.open_door_photo - action: media_player.volume_set data: entity_id: media_player.yandex_hb volume_level: '{{states("input_number.main_volume")|float(0)}}' - alias: hall_big_main_door_closed id: hall_big_main_door_closed initial_state: true triggers: - trigger: state entity_id: - binary_sensor.0x00158d0001e5d6be_contact from: 'on' to: 'off' actions: - action: notify.telegram data: title: Doorbell photo message: 🔔 Входная дверь закрыта! data: photo: - url: http://localhost:1984/api/frame.jpeg?src=g4_doorbell caption: 🚪 Входная дверь закрыта {{ states('sensor.time') }}, была открыта {{(as_timestamp(now())|int(0)-states('input_number.main_door_open')|int(0)) | timestamp_custom('%H:%M:%S',false,0)}} - action: timer.cancel entity_id: timer.main_door_open_hb - id: mqtt_sensors_discovery alias: mqtt_sensors_discovery initial_state: true triggers: - trigger: state entity_id: binary_sensor.mqtt_broker_main to: 'on' - event: start platform: homeassistant - trigger: event event_type: automation_reloaded conditions: - condition: state entity_id: binary_sensor.mqtt_broker_main state: 'on' actions: - action: mqtt.publish data: topic: homeassistant/binary_sensor/lxc_plex_media_mount/config retain: true payload: "{ \n \"name\":\"LXC Plex Media Mount\", \n \"state_topic\":\"lxc_plex/binary\"\ ,\n \"unique_id\":\"lxc_plex_media_mount\",\n \"device_class\":\"connectivity\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"device\":{\"\ identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"\ }\n}" - action: mqtt.publish data: topic: homeassistant/sensor/config_line_count/config retain: true payload: "{ \n \"name\":\"Config Line Count\", \n \"state_topic\":\"hp600g6/config_linecount\"\ ,\n \"unique_id\":\"config_line_count\",\n \"icon\":\"mdi:format-list-bulleted\"\ ,\n \"unit_of_measurement\":\"lines\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} value|int(0) {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"\ System\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/config_line_count_code/config retain: true payload: "{ \n \"name\":\"Config Line Count Code\", \n \"state_topic\":\"\ hp600g6/config_linecount_code\",\n \"unique_id\":\"config_line_count_code\"\ ,\n \"icon\":\"mdi:format-list-numbered\",\n \"unit_of_measurement\":\"\ lines\",\n \"entity_category\": \"diagnostic\",\n \"value_template\":\"\ {{ '{{' }} value|int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"\ sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/music_allowed/config retain: true payload: "{ \n \"name\":\"Music Allowed\",\n \"command_topic\":\"servers/main_states/music_allowed\"\ ,\n \"state_topic\":\"servers/main_states/music_allowed\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"music_allowed\",\n \"icon\":\"mdi:volume-high\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/guest_mode/config retain: true payload: "{ \n \"name\":\"Guest Mode\",\n \"command_topic\":\"servers/main_states/guest_mode\"\ ,\n \"state_topic\":\"servers/main_states/guest_mode\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"guest_mode\",\n \"icon\":\"mdi:account-question\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/main_lead/config retain: true payload: "{ \n \"name\":\"Main Lead\",\n \"command_topic\":\"servers/main_states/main_lead\"\ ,\n \"state_topic\":\"servers/main_states/main_lead\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"main_lead\",\n \"icon\":\"mdi:server-network\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/led_strip_bed_v_restart_key/config retain: true payload: "{ \n \"name\":\"LED Strip Bed V Restart Key\",\n \"command_topic\"\ :\"servers/main_states/led_strip_bed_v_restart_key\",\n \"state_topic\":\"\ servers/main_states/led_strip_bed_v_restart_key\",\n \"payload_on\":\"ON\"\ ,\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\":\"\ OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"led_strip_bed_v_restart_key\",\n \"icon\":\"mdi:restart\",\n \"device\"\ :{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"\ System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/square_led_v_restart_key/config retain: true payload: "{ \n \"name\":\"Square LED V Restart Key\",\n \"command_topic\"\ :\"servers/main_states/square_led_v_restart_key\",\n \"state_topic\":\"servers/main_states/square_led_v_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"square_led_v_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/led_color_v_restart_key/config retain: true payload: "{ \n \"name\":\"LED Color V Restart Key\",\n \"command_topic\":\"\ servers/main_states/led_color_v_restart_key\",\n \"state_topic\":\"servers/main_states/led_color_v_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"led_color_v_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/led_color_s_restart_key/config retain: true payload: "{ \n \"name\":\"LED Color S Restart Key\",\n \"command_topic\":\"\ servers/main_states/led_color_s_restart_key\",\n \"state_topic\":\"servers/main_states/led_color_s_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"led_color_s_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/led_white_s_restart_key/config retain: true payload: "{ \n \"name\":\"LED White S Restart Key\",\n \"command_topic\":\"\ servers/main_states/led_white_s_restart_key\",\n \"state_topic\":\"servers/main_states/led_white_s_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"led_white_s_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/led_white_mb_restart_key/config retain: true payload: "{ \n \"name\":\"LED White MB Restart Key\",\n \"command_topic\"\ :\"servers/main_states/led_white_mb_restart_key\",\n \"state_topic\":\"servers/main_states/led_white_mb_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"led_white_mb_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/square_led_s_restart_key/config retain: true payload: "{ \n \"name\":\"Square LED S Restart Key\",\n \"command_topic\"\ :\"servers/main_states/square_led_s_restart_key\",\n \"state_topic\":\"servers/main_states/square_led_s_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"square_led_s_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/light_bar_s_restart_key/config retain: true payload: "{ \n \"name\":\"Light Bar S Restart Key\",\n \"command_topic\":\"\ servers/main_states/light_bar_s_restart_key\",\n \"state_topic\":\"servers/main_states/light_bar_s_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"light_bar_s_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/bedside_restart_key/config retain: true payload: "{ \n \"name\":\"Bedside Restart Key\",\n \"command_topic\":\"servers/main_states/bedside_restart_key\"\ ,\n \"state_topic\":\"servers/main_states/bedside_restart_key\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"bedside_restart_key\",\n \"icon\":\"mdi:restart\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/round_led_mb_restart_key/config retain: true payload: "{ \n \"name\":\"Round LED MB Restart Key\",\n \"command_topic\"\ :\"servers/main_states/round_led_mb_restart_key\",\n \"state_topic\":\"servers/main_states/round_led_mb_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"round_led_mb_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/round_led_k_restart_key/config retain: true payload: "{ \n \"name\":\"Round LED K Restart Key\",\n \"command_topic\":\"\ servers/main_states/round_led_k_restart_key\",\n \"state_topic\":\"servers/main_states/round_led_k_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"round_led_k_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/round_led_hs_restart_key/config retain: true payload: "{ \n \"name\":\"Round LED HS Restart Key\",\n \"command_topic\"\ :\"servers/main_states/round_led_hs_restart_key\",\n \"state_topic\":\"servers/main_states/round_led_hs_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"round_led_hs_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/round_led_st_restart_key/config retain: true payload: "{ \n \"name\":\"Round LED St Restart Key\",\n \"command_topic\"\ :\"servers/main_states/round_led_st_restart_key\",\n \"state_topic\":\"servers/main_states/round_led_st_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"round_led_st_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/mirror_light_b_restart_key/config retain: true payload: "{ \n \"name\":\"Mirror Light B Restart Key\",\n \"command_topic\"\ :\"servers/main_states/mirror_light_b_restart_key\",\n \"state_topic\":\"\ servers/main_states/mirror_light_b_restart_key\",\n \"payload_on\":\"ON\"\ ,\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\":\"\ OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"mirror_light_b_restart_key\",\n \"icon\":\"mdi:restart\",\n \"device\"\ :{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"\ System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/led_strip_entrance_hb_restart_key/config retain: true payload: "{ \n \"name\":\"LED Strip Entrance HB Restart Key\",\n \"command_topic\"\ :\"servers/main_states/led_strip_entrance_hb_restart_key\",\n \"state_topic\"\ :\"servers/main_states/led_strip_entrance_hb_restart_key\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"led_strip_entrance_hb_restart_key\",\n \"icon\":\"mdi:restart\",\n \"\ device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"\ name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/led_strip_hb_restart_key/config retain: true payload: "{ \n \"name\":\"LED Strip HB Restart Key\",\n \"command_topic\"\ :\"servers/main_states/led_strip_hb_restart_key\",\n \"state_topic\":\"servers/main_states/led_strip_hb_restart_key\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"led_strip_hb_restart_key\",\n \"icon\":\"mdi:restart\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/maintenance_mode/config retain: true payload: "{ \n \"name\":\"Maintenance Mode\",\n \"command_topic\":\"servers/main_states/maintenance_mode\"\ ,\n \"state_topic\":\"servers/main_states/maintenance_mode\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"maintenance_mode\",\n \"icon\":\"mdi:hammer-wrench\",\n \"device\":{\"\ identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"\ } \n}" - action: mqtt.publish data: topic: homeassistant/switch/security_mode/config retain: true payload: "{ \n \"name\":\"Security Mode\",\n \"command_topic\":\"servers/main_states/security_mode\"\ ,\n \"state_topic\":\"servers/main_states/security_mode\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"security_mode\",\n \"icon\":\"mdi:police-badge\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/select/mode_breather_v/config retain: true payload: "{ \n \"name\":\"Mode Breather V\",\n \"command_topic\":\"servers/main_states/mode_breather_v\"\ ,\n \"state_topic\":\"servers/main_states/mode_breather_v\",\n \"options\"\ : [\"Auto\", \"Manual\", \"Programm\", \"Off\"],\n \"optimistic\":\"false\"\ ,\n \"retain\":\"true\",\n \"unique_id\":\"mode_breather_v\",\n \"icon\"\ :\"mdi:fan\",\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\"\ :\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/select/mode_breather_s/config retain: true payload: "{ \n \"name\":\"Mode Breather S\",\n \"command_topic\":\"servers/main_states/mode_breather_s\"\ ,\n \"state_topic\":\"servers/main_states/mode_breather_s\",\n \"options\"\ : [\"Auto\", \"Manual\", \"Programm\", \"Off\"],\n \"optimistic\":\"false\"\ ,\n \"retain\":\"true\",\n \"unique_id\":\"mode_breather_s\",\n \"icon\"\ :\"mdi:fan\",\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\"\ :\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/select/mode_breather_mb/config retain: true payload: "{ \n \"name\":\"Mode Breather MB\",\n \"command_topic\":\"servers/main_states/mode_breather_mb\"\ ,\n \"state_topic\":\"servers/main_states/mode_breather_mb\",\n \"options\"\ : [\"Auto\", \"Manual\", \"Programm\", \"Off\"],\n \"optimistic\":\"false\"\ ,\n \"retain\":\"true\",\n \"unique_id\":\"mode_breather_mb\",\n \"icon\"\ :\"mdi:fan\",\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\"\ :\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/hourly_mode_breather_v/config retain: true payload: "{ \n \"name\":\"Hourly Mode Breather V\",\n \"command_topic\":\"\ servers/main_states/hourly_mode_breather_v\",\n \"state_topic\":\"servers/main_states/hourly_mode_breather_v\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"hourly_mode_breather_v\",\n \"icon\":\"mdi:flash-auto\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/breather_auto_v/config retain: true payload: "{ \n \"name\":\"Breather Auto V\",\n \"command_topic\":\"servers/main_states/breather_auto_v\"\ ,\n \"state_topic\":\"servers/main_states/breather_auto_v\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"breather_auto_v\",\n \"icon\":\"mdi:flash-auto\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/breather_auto_mb/config retain: true payload: "{ \n \"name\":\"Breather Auto MB\",\n \"command_topic\":\"servers/main_states/breather_auto_mb\"\ ,\n \"state_topic\":\"servers/main_states/breather_auto_mb\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"breather_auto_mb\",\n \"icon\":\"mdi:flash-auto\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/breather_auto_s/config retain: true payload: "{ \n \"name\":\"Breather Auto S\",\n \"command_topic\":\"servers/main_states/breather_auto_s\"\ ,\n \"state_topic\":\"servers/main_states/breather_auto_s\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"breather_auto_s\",\n \"icon\":\"mdi:flash-auto\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/breather_speed_auto_v/config retain: true payload: "{ \n \"name\":\"Breather Auto Speed V\",\n \"command_topic\":\"\ servers/main_states/breather_speed_auto_v\",\n \"state_topic\":\"servers/main_states/breather_speed_auto_v\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"retain\":\"true\"\ ,\n \"state_on\":\"ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\"\ ,\n \"unique_id\":\"breather_speed_auto_v\",\n \"icon\":\"mdi:fan-auto\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/breather_speed_auto_mb/config retain: true payload: "{ \n \"name\":\"Breather Auto Speed MB\",\n \"command_topic\":\"\ servers/main_states/breather_speed_auto_mb\",\n \"state_topic\":\"servers/main_states/breather_speed_auto_mb\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"breather_speed_auto_mb\",\n \"icon\":\"mdi:fan-auto\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/breather_speed_auto_s/config retain: true payload: "{ \n \"name\":\"Breather Auto Speed S\",\n \"command_topic\":\"\ servers/main_states/breather_speed_auto_s\",\n \"state_topic\":\"servers/main_states/breather_speed_auto_s\"\ ,\n \"payload_on\":\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"\ ON\",\n \"state_off\":\"OFF\",\n \"optimistic\":\"false\",\n \"retain\"\ :\"true\",\n \"unique_id\":\"breather_speed_auto_s\",\n \"icon\":\"mdi:fan-auto\"\ ,\n \"device\":{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\"\ ,\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/breather_manual_v/config retain: true payload: "{ \n \"name\":\"Breather Manual V\",\n \"command_topic\":\"servers/main_states/breather_manual_v\"\ ,\n \"state_topic\":\"servers/main_states/breather_manual_v\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"breather_manual_v\",\n \"icon\":\"mdi:flash-red-eye\",\n \"device\":{\"\ identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"\ } \n}" - action: mqtt.publish data: topic: homeassistant/switch/breather_manual_s/config retain: true payload: "{ \n \"name\":\"Breather Manual S\",\n \"command_topic\":\"servers/main_states/breather_manual_s\"\ ,\n \"state_topic\":\"servers/main_states/breather_manual_s\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"breather_manual_s\",\n \"icon\":\"mdi:flash-red-eye\",\n \"device\":{\"\ identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"\ } \n}" - action: mqtt.publish data: topic: homeassistant/switch/breather_manual_mb/config retain: true payload: "{ \n \"name\":\"Breather Manual MB\",\n \"command_topic\":\"servers/main_states/breather_manual_mb\"\ ,\n \"state_topic\":\"servers/main_states/breather_manual_mb\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"breather_manual_mb\",\n \"icon\":\"mdi:flash-red-eye\",\n \"device\"\ :{\"identifiers\":[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"\ System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/silent_mode/config retain: true payload: "{ \n \"name\":\"Silent Mode\",\n \"command_topic\":\"servers/main_states/silent_mode\"\ ,\n \"state_topic\":\"servers/main_states/silent_mode\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"silent_mode\",\n \"icon\":\"mdi:volume-off\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/switch/dark_mode/config retain: true payload: "{ \n \"name\":\"Dark Mode\",\n \"command_topic\":\"servers/main_states/dark_mode\"\ ,\n \"state_topic\":\"servers/main_states/dark_mode\",\n \"payload_on\"\ :\"ON\",\n \"payload_off\":\"OFF\",\n \"state_on\":\"ON\",\n \"state_off\"\ :\"OFF\",\n \"optimistic\":\"false\",\n \"retain\":\"true\",\n \"unique_id\"\ :\"dark_mode\",\n \"icon\":\"mdi:weather-night\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/binary_sensor/main_server_state/config retain: true payload: "{ \n \"name\":\"Main Server State\", \n \"state_topic\":\"servers/main_server\"\ ,\n \"device_class\":\"connectivity\",\n \"payload_on\":\"ON\",\n \"payload_off\"\ :\"OFF\",\n \"unique_id\":\"main_server_state\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/binary_sensor/backup_server_state/config retain: true payload: "{ \n \"name\":\"Backup Server State\", \n \"state_topic\":\"servers/backup_server\"\ ,\n \"device_class\":\"connectivity\",\n \"payload_on\":\"ON\",\n \"payload_off\"\ :\"OFF\",\n \"unique_id\":\"backup_server_state\",\n \"device\":{\"identifiers\"\ :[\"sys_info\"],\"manufacturer\":\"DTsymbal\",\"name\":\"System\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_fan_speed/config retain: true payload: "{ \n \"name\":\"Fan Speed\", \n \"state_topic\":\"1621/fan_speed\"\ ,\n \"unique_id\":\"ds1621plus_fan_speed\",\n \"icon\":\"mdi:fan\",\n \"\ entity_category\": \"diagnostic\",\n \"value_template\":\"{{ '{{' }} value\ \ | capitalize {{ '}}' }}\",\n \"device\":{\"identifiers\":[\"1621\"],\"\ manufacturer\":\"Synology\",\"model\":\"DS1621+\",\"name\":\"ds1621plus\"\ }\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_fan1_rpm/config retain: true payload: "{ \n \"name\":\"Fan1 RPM\", \n \"state_topic\":\"1621/fan1\", \n\ \ \"icon\":\"mdi:fan\", \n \"unit_of_measurement\": \"RPM\",\n \"unique_id\"\ :\"ds1621plus_fan1\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} ( value|int(0) ) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"1621\"],\"manufacturer\":\"Synology\",\"model\":\"DS1621+\",\"name\":\"\ ds1621plus\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_fan2_rpm/config retain: true payload: "{ \n \"name\":\"Fan2 RPM\", \n \"state_topic\":\"1621/fan2\", \n\ \ \"icon\":\"mdi:fan\", \n \"unit_of_measurement\": \"RPM\",\n \"unique_id\"\ :\"ds1621plus_fan2\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} ( value|int(0) ) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"1621\"],\"manufacturer\":\"Synology\",\"model\":\"DS1621+\",\"name\":\"\ ds1621plus\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_nvme0_data_units_read/config retain: true payload: "{ \n \"name\":\"Data Units Read\", \n \"state_topic\":\"1621/nvme0/read\"\ ,\n \"unique_id\":\"ds1621plus_nvme0_data_units_read\",\n \"icon\":\"mdi:alpha-r-circle\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} ( value|int(0) * 512 / 1024 / 1024 /\ \ 1024 ) | round(2) {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"1621_nvme0\"\ ],\"manufacturer\":\"Silicon Power\",\"model\":\"A80 1Tb\",\"name\":\"ds1621plus\ \ nvme0\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_nvme0_data_units_written/config retain: true payload: "{ \n \"name\":\"Data Units Written\", \n \"state_topic\":\"1621/nvme0/write\"\ ,\n \"unique_id\":\"ds1621plus_nvme0_data_units_written\",\n \"icon\":\"\ mdi:alpha-w-circle\",\n \"unit_of_measurement\":\"Gb\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) * 512\ \ / 1024 / 1024 / 1024 ) | round(2) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"1621_nvme0\"],\"manufacturer\":\"Silicon Power\",\"model\":\"A80 1Tb\"\ ,\"name\":\"ds1621plus nvme0\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_nvme0_power_on_hours/config retain: true payload: "{ \n \"name\":\"Power On Hours\", \n \"state_topic\":\"1621/nvme0/power_on_hours\"\ ,\n \"unique_id\":\"ds1621plus_nvme0_power_on_hours\",\n \"icon\":\"mdi:calendar-clock\"\ ,\n \"unit_of_measurement\":\"hr\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}' }}\", \n \"\ device\":{\"identifiers\":[\"1621_nvme0\"],\"manufacturer\":\"Silicon Power\"\ ,\"model\":\"A80 1Tb\",\"name\":\"ds1621plus nvme0\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_nvme0_wear_leveling_count/config retain: true payload: "{ \n \"name\":\"Wear Leveling Count\", \n \"state_topic\":\"1621/nvme0/percent\"\ ,\n \"unique_id\":\"ds1621plus_nvme0_wear_leveling_count\",\n \"icon\":\"\ mdi:percent-circle\",\n \"unit_of_measurement\":\"%\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"1621_nvme0\"],\"manufacturer\"\ :\"Silicon Power\",\"model\":\"A80 1Tb\",\"name\":\"ds1621plus nvme0\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_nvme1_data_units_read/config retain: true payload: "{ \n \"name\":\"Data Units Read\", \n \"state_topic\":\"1621/nvme1/read\"\ ,\n \"unique_id\":\"ds1621plus_nvme1_data_units_read\",\n \"icon\":\"mdi:alpha-r-circle\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} ( value|int(0) * 512 / 1024 / 1024 /\ \ 1024 ) | round(2) {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"1621_nvme1\"\ ],\"manufacturer\":\"Silicon Power\",\"model\":\"A80 1Tb\",\"name\":\"ds1621plus\ \ nvme1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_nvme1_data_units_written/config retain: true payload: "{ \n \"name\":\"Data Units Written\", \n \"state_topic\":\"1621/nvme1/write\"\ ,\n \"unique_id\":\"ds1621plus_nvme1_data_units_written\",\n \"icon\":\"\ mdi:alpha-w-circle\",\n \"unit_of_measurement\":\"Gb\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) * 512\ \ / 1024 / 1024 / 1024 ) | round(2) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"1621_nvme1\"],\"manufacturer\":\"Silicon Power\",\"model\":\"A80 1Tb\"\ ,\"name\":\"ds1621plus nvme1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_nvme1_power_on_hours/config retain: true payload: "{ \n \"name\":\"Power On Hours\", \n \"state_topic\":\"1621/nvme1/power_on_hours\"\ ,\n \"unique_id\":\"ds1621plus_nvme1_power_on_hours\",\n \"icon\":\"mdi:calendar-clock\"\ ,\n \"unit_of_measurement\":\"hr\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}' }}\", \n \"\ device\":{\"identifiers\":[\"1621_nvme1\"],\"manufacturer\":\"Silicon Power\"\ ,\"model\":\"A80 1Tb\",\"name\":\"ds1621plus nvme1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_nvme1_wear_leveling_count/config retain: true payload: "{ \n \"name\":\"Wear Leveling Count\", \n \"state_topic\":\"1621/nvme1/percent\"\ ,\n \"unique_id\":\"ds1621plus_nvme1_wear_leveling_count\",\n \"icon\":\"\ mdi:percent-circle\",\n \"unit_of_measurement\":\"%\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"1621_nvme1\"],\"manufacturer\"\ :\"Silicon Power\",\"model\":\"A80 1Tb\",\"name\":\"ds1621plus nvme1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_usb1_wear_leveling_count/config retain: true payload: "{ \n \"name\":\"Wear Leveling Count\", \n \"state_topic\":\"1621/usb1/wear_leveling_count\"\ ,\n \"unique_id\":\"ds1621plus_usb1_wear_leveling_count\",\n \"icon\":\"\ mdi:percent-circle\",\n \"unit_of_measurement\":\"%\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"1621_usb1\"],\"manufacturer\":\"\ Samsung\",\"model\":\"PM883 960Gb\",\"name\":\"ds1621plus usb1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_usb1_total_lbas_written/config retain: true payload: "{ \n \"name\":\"Total LBAs Written\", \n \"state_topic\":\"1621/usb1/total_lbas_written\"\ ,\n \"unique_id\":\"ds1621plus_usb1_total_lbas_written\",\n \"icon\":\"\ mdi:alpha-w-circle\",\n \"unit_of_measurement\":\"Tb\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) * 512000\ \ / 1024 / 1024 / 1024 / 1024 / 1024 ) | round(2) {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"1621_usb1\"],\"manufacturer\":\"Samsung\",\"model\":\"\ PM883 960Gb\",\"name\":\"ds1621plus usb1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_usb1_power_on_hours/config retain: true payload: "{ \n \"name\":\"Power On Hours\", \n \"state_topic\":\"1621/usb1/power_on_hours\"\ ,\n \"unique_id\":\"ds1621plus_usb1_power_on_hours\",\n \"unit_of_measurement\"\ :\"hr\",\n \"entity_category\": \"diagnostic\",\n \"value_template\":\"\ {{ '{{' }} ( value|int(0) ) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"1621_usb1\"],\"manufacturer\":\"Samsung\",\"model\":\"PM883 960Gb\",\"\ name\":\"ds1621plus usb1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds1621plus_usb1_temperature/config retain: true payload: "{ \n \"name\":\"Temperature\", \n \"state_topic\":\"1621/usb1/temperature\"\ ,\n \"unique_id\":\"ds1621plus_usb1_temperature\",\n \"unit_of_measurement\"\ :\"°C\",\n \"device_class\":\"temperature\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}' }}\", \n \"\ device\":{\"identifiers\":[\"1621_usb1\"],\"manufacturer\":\"Samsung\",\"\ model\":\"PM883 960Gb\",\"name\":\"ds1621plus usb1\"}\n}" - action: mqtt.publish data: topic: homeassistant/binary_sensor/kiosk_motion/config retain: true payload: "{ \n \"name\":\"Motion\", \n \"state_topic\":\"xiaoxin/event\",\n\ \ \"unique_id\":\"kisok_motion\",\n \"device_class\":\"motion\",\n \"payload_on\"\ :\"onMotion\",\n \"payload_off\":\" \",\n \"off_delay\": \"2\",\n \"value_template\"\ :\"{{ '{{' }} value_json.event {{ '}}' }}\",\n \"device\":{\"identifiers\"\ :[\"Xiaoxin Kiosk\"],\"manufacturer\":\"Fully Kiosk Broser\",\"name\":\"Xiaoxin\ \ Kiosk\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds920plus_nvme0_data_units_read/config retain: true payload: "{ \n \"name\":\"Data Units Read\", \n \"state_topic\":\"920/nvme0/read\"\ ,\n \"unique_id\":\"ds920plus_nvme0_data_units_read\",\n \"icon\":\"mdi:alpha-r-circle\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} ( value|int(0) * 512 / 1024 / 1024 /\ \ 1024 ) | round(2) {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"920_nvme0\"\ ],\"manufacturer\":\"A-Data\",\"model\":\"SX6000 Lite 256Gb\",\"name\":\"\ ds920plus nvme0\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds920plus_nvme0_data_units_written/config retain: true payload: "{ \n \"name\":\"Data Units Written\", \n \"state_topic\":\"920/nvme0/write\"\ ,\n \"unique_id\":\"ds920plus_nvme0_data_units_written\",\n \"icon\":\"\ mdi:alpha-w-circle\",\n \"unit_of_measurement\":\"Gb\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) * 512\ \ / 1024 / 1024 / 1024 ) | round(2) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"920_nvme0\"],\"manufacturer\":\"A-Data\",\"model\":\"SX6000 Lite 256Gb\"\ ,\"name\":\"ds920plus nvme0\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds920plus_nvme0_power_on_hours/config retain: true payload: "{ \n \"name\":\"Power On Hours\", \n \"state_topic\":\"920/nvme0/power_on_hours\"\ ,\n \"unique_id\":\"ds920plus_nvme0_power_on_hours\",\n \"icon\":\"mdi:calendar-clock\"\ ,\n \"unit_of_measurement\":\"hr\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}' }}\", \n \"\ device\":{\"identifiers\":[\"920_nvme0\"],\"manufacturer\":\"A-Data\",\"model\"\ :\"SX6000 Lite 256Gb\",\"name\":\"ds920plus nvme0\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds920plus_nvme0_wear_leveling_count/config retain: true payload: "{ \n \"name\":\"Wear Leveling Count\", \n \"state_topic\":\"920/nvme0/percent\"\ ,\n \"unique_id\":\"ds920plus_nvme0_wear_leveling_count\",\n \"icon\":\"\ mdi:percent-circle\",\n \"unit_of_measurement\":\"%\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"920_nvme0\"],\"manufacturer\":\"\ A-Data\",\"model\":\"SX6000 Lite 256Gb\",\"name\":\"ds920plus nvme0\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds920plus_nvme1_data_units_read/config retain: true payload: "{ \n \"name\":\"Data Units Read\", \n \"state_topic\":\"920/nvme1/read\"\ ,\n \"unique_id\":\"ds920plus_nvme1_data_units_read\",\n \"icon\":\"mdi:alpha-r-circle\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} ( value|int(0) * 512 / 1024 / 1024 /\ \ 1024 ) | round(2) {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"920_nvme1\"\ ],\"manufacturer\":\"A-Data\",\"model\":\"SX6000 Lite 256Gb\",\"name\":\"\ ds920plus nvme1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds920plus_nvme1_data_units_written/config retain: true payload: "{ \n \"name\":\"Data Units Written\", \n \"state_topic\":\"920/nvme1/write\"\ ,\n \"unique_id\":\"ds920plus_nvme1_data_units_written\",\n \"icon\":\"\ mdi:alpha-w-circle\",\n \"unit_of_measurement\":\"Gb\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) * 512\ \ / 1024 / 1024 / 1024 ) | round(2) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"920_nvme1\"],\"manufacturer\":\"A-Data\",\"model\":\"SX6000 Lite 256Gb\"\ ,\"name\":\"ds920plus nvme1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds920plus_nvme1_power_on_hours/config retain: true payload: "{ \n \"name\":\"Power On Hours\", \n \"state_topic\":\"920/nvme1/power_on_hours\"\ ,\n \"unique_id\":\"ds920plus_nvme1_power_on_hours\",\n \"icon\":\"mdi:calendar-clock\"\ ,\n \"unit_of_measurement\":\"hr\",\n \"entity_category\": \"diagnostic\"\ ,\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}' }}\", \n \"\ device\":{\"identifiers\":[\"920_nvme1\"],\"manufacturer\":\"A-Data\",\"model\"\ :\"SX6000 Lite 256Gb\",\"name\":\"ds920plus nvme1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ds920plus_nvme1_wear_leveling_count/config retain: true payload: "{ \n \"name\":\"Wear Leveling Count\", \n \"state_topic\":\"920/nvme1/percent\"\ ,\n \"unique_id\":\"ds920plus_nvme1_wear_leveling_count\",\n \"icon\":\"\ mdi:percent-circle\",\n \"unit_of_measurement\":\"%\",\n \"entity_category\"\ : \"diagnostic\",\n \"value_template\":\"{{ '{{' }} ( value|int(0) ) {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"920_nvme1\"],\"manufacturer\":\"\ A-Data\",\"model\":\"SX6000 Lite 256Gb\",\"name\":\"ds920plus nvme1\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/pikvm_telemetry_last_update/config retain: true payload: "{ \n \"name\":\"Telemetry Last Update\", \n \"state_topic\":\"pikvm/last_update\"\ , \n \"icon\":\"mdi:calendar\", \n \"unique_id\":\"pikvm_telemetry_last_update\"\ ,\n \"entity_category\": \"diagnostic\",\n \"value_template\":\"{{ '{{'\ \ }} value {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"pikvm\"],\"manufacturer\"\ :\"BLICUBE\",\"model\":\"PIKVM V3 HAT\",\"name\":\"PIKVM\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/pikvm_uptime/config retain: true payload: "{\n \"name\":\"Uptime\",\n \"state_topic\":\"pikvm/system_uptime\"\ ,\n \"icon\":\"mdi:clock-digital\",\n \"unit_of_measurement\": \"h\",\n\ \ \"unique_id\":\"blikvm_uptime\",\n \"entity_category\": \"diagnostic\"\ ,\n \"expire_after\":\"150\",\n \"value_template\":\"{{ '{{' }} ((value\ \ | float(0))/3600) | round(2, 'common') {{ '}}' }}\",\n \"device\":{\"identifiers\"\ :[\"pikvm\"],\"manufacturer\":\"BLICUBE\",\"model\":\"BLIKVM V3 HAT\",\"name\"\ :\"PIKVM\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/pikvm_cpu_load/config retain: true payload: "{ \n \"name\":\"CPU Load\", \n \"state_topic\":\"pikvm/psmqtt/cpu_percent\"\ , \n \"icon\":\"mdi:cpu-64-bit\", \n \"unit_of_measurement\": \"%\",\n\ \ \"unique_id\":\"pikvm_cpu_load\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"pikvm\"],\"manufacturer\":\"BLICUBE\",\"model\":\"PIKVM\ \ V3 HAT\",\"name\":\"PIKVM\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/pikvm_cpu_temp/config retain: true payload: "{ \n \"name\":\"CPU Temp\", \n \"state_topic\":\"pikvm/psmqtt/sensors_temperatures/cpu_thermal\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"pikvm_cpu_temp\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} value | float(0) | round(1, 'common') {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"pikvm\"],\"manufacturer\":\"BLICUBE\"\ ,\"model\":\"PIKVM V3 HAT\",\"name\":\"PIKVM\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/pikvm2w_telemetry_last_update/config retain: true payload: "{ \n \"name\":\"Telemetry Last Update\", \n \"state_topic\":\"pikvm2w/last_update\"\ , \n \"icon\":\"mdi:calendar\", \n \"unique_id\":\"pikvm2w_telemetry_last_update\"\ ,\n \"entity_category\": \"diagnostic\",\n \"value_template\":\"{{ '{{'\ \ }} value {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"pikvm2w\"],\"\ manufacturer\":\"DIY\",\"model\":\"PIKVM DIY\",\"name\":\"PIKVM 2w\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/pikvm2w_uptime/config retain: true payload: "{\n \"name\":\"Uptime\",\n \"state_topic\":\"pikvm2w/system_uptime\"\ ,\n \"icon\":\"mdi:clock-digital\",\n \"unit_of_measurement\": \"h\",\n\ \ \"unique_id\":\"pikvm2w_uptime\",\n \"entity_category\": \"diagnostic\"\ ,\n \"expire_after\":\"150\",\n \"value_template\":\"{{ '{{' }} ((value\ \ | float(0))/3600) | round(2, 'common') {{ '}}' }}\",\n \"device\":{\"identifiers\"\ :[\"pikvm2w\"],\"manufacturer\":\"DIY\",\"model\":\"PIKVM DIY\",\"name\":\"\ PIKVM 2w\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/pikvm2w_cpu_load/config retain: true payload: "{ \n \"name\":\"CPU Load\", \n \"state_topic\":\"pikvm2w/psmqtt/cpu_percent\"\ , \n \"icon\":\"mdi:cpu-64-bit\", \n \"unit_of_measurement\": \"%\",\n\ \ \"unique_id\":\"pikvm2w_cpu_load\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"pikvm2w\"],\"manufacturer\":\"\ DIY\",\"model\":\"PIKVM DIY\",\"name\":\"PIKVM 2w\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/pikvm2w_cpu_temp/config retain: true payload: "{ \n \"name\":\"CPU Temp\", \n \"state_topic\":\"pikvm2w/psmqtt/sensors_temperatures/cpu_thermal\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"pikvm2w_cpu_temp\", \n \"expire_after\":\"150\",\n \ \ \"value_template\":\"{{ '{{' }} value | float(0) | round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"pikvm2w\"],\"manufacturer\"\ :\"DIY\",\"model\":\"PIKVM DIY\",\"name\":\"PIKVM 2w\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/rpi3_telemetry_last_update/config retain: true payload: "{ \n \"name\":\"Telemetry Last Update\", \n \"state_topic\":\"rpi3/last_update\"\ , \n \"icon\":\"mdi:calendar\", \n \"unique_id\":\"rpi3_telemetry_last_update\"\ ,\n \"entity_category\": \"diagnostic\",\n \"value_template\":\"{{ '{{'\ \ }} value {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"rpi3\"],\"manufacturer\"\ :\"Raspberry\",\"model\":\"3 B+\",\"name\":\"RPI3\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/rpi3_uptime/config retain: true payload: "{\n \"name\":\"Uptime\",\n \"state_topic\":\"rpi3/system_uptime\"\ ,\n \"icon\":\"mdi:clock-digital\",\n \"unit_of_measurement\": \"h\",\n\ \ \"unique_id\":\"rpi3_uptime\",\n \"entity_category\": \"diagnostic\",\n\ \ \"expire_after\":\"150\",\n \"value_template\":\"{{ '{{' }} ((value |\ \ float(0))/3600) | round(2, 'common') {{ '}}' }}\",\n \"device\":{\"identifiers\"\ :[\"rpi3\"],\"manufacturer\":\"Raspberry\",\"model\":\"3 B+\",\"name\":\"\ RPI3\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/rpi3_cpu_load/config retain: true payload: "{ \n \"name\":\"CPU Load\", \n \"state_topic\":\"rpi3/psmqtt/cpu_percent\"\ , \n \"icon\":\"mdi:cpu-64-bit\", \n \"unit_of_measurement\": \"%\",\n\ \ \"unique_id\":\"rpi3_cpu_load\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"rpi3\"],\"manufacturer\":\"Raspberry\",\"model\":\"3\ \ B+\",\"name\":\"RPI3\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/rpi3_cpu_temp/config retain: true payload: "{ \n \"name\":\"CPU Temp\", \n \"state_topic\":\"rpi3/psmqtt/sensors_temperatures/cpu_thermal\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"rpi3_cpu_temp\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} value | float(0) | round(1, 'common') {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"rpi3\"],\"manufacturer\":\"Raspberry\"\ ,\"model\":\"3 B+\",\"name\":\"RPI3\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/rpi3_memory_used/config retain: true payload: "{ \n \"name\":\"Memory Used\", \n \"state_topic\":\"rpi3/psmqtt/virtual_memory/percent\"\ ,\n \"value_template\":\"{{ '{{' }} value | float(100) | round(1, 'common')\ \ {{ '}}' }}\", \n \"unique_id\":\"rpi3_memory_used\",\n \"unit_of_measurement\"\ :\"%\",\n \"icon\":\"mdi:memory\",\n \"device\":{\"identifiers\":[\"rpi3\"\ ],\"manufacturer\":\"Raspberry\",\"model\":\"3 B+\",\"name\":\"RPI3\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_telemetry_last_update/config retain: true payload: "{ \n \"name\":\"Telemetry Last Update\", \n \"state_topic\":\"ms01a/last_update\"\ , \n \"icon\":\"mdi:calendar\", \n \"unique_id\":\"ms01a_telemetry_last_update\"\ ,\n \"entity_category\": \"diagnostic\",\n \"value_template\":\"{{ '{{'\ \ }} value {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_uptime/config retain: true payload: "{ \n \"name\":\"Uptime\", \n \"state_topic\":\"ms01a/system_uptime\"\ , \n \"icon\":\"mdi:clock-digital\", \n \"unit_of_measurement\": \"m\"\ ,\n \"unique_id\":\"ms01a_uptime\", \n \"entity_category\": \"diagnostic\"\ ,\n \"expire_after\":\"150\",\n \"value_template\":\"{{ '{{' }} ((value\ \ | float(0))/60) | round(2, 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_iowait/config retain: true payload: "{ \n \"name\":\"IoWait\", \n \"state_topic\":\"ms01a/kernel_stat\"\ , \n \"icon\":\"mdi:speedometer-medium\", \n \"unit_of_measurement\": \"\ %\",\n \"unique_id\":\"ms01a_iowait\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} ((value_json.sysstat.hosts[0].statistics[0]['avg-cpu'].iowait)\ \ | float(0)) | round(2, 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme0_usage/config retain: true payload: "{ \n \"name\":\"NVME0 Usage\", \n \"state_topic\":\"ms01a/disk_usage/nvme0\"\ , \n \"icon\":\"mdi:chip\", \n \"unit_of_measurement\": \"%\",\n \"unique_id\"\ :\"ms01a_nvme0_usage\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"\ MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme0_temp/config retain: true payload: "{ \n \"name\":\"NVME0 Temp\", \n \"state_topic\":\"ms01a/disk_temp/nvme0\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"ms01a_nvme0_temp\", \n \"expire_after\":\"150\",\n \ \ \"value_template\":\"{{ '{{' }} value | float(0) | round(0, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme0_tb_written/config retain: true payload: "{ \n \"name\":\"NVME0 TB Written\", \n \"state_topic\":\"ms01a/ssd_smart/nvme0_lba_written\"\ ,\n \"unit_of_measurement\":\"Tb\",\n \"icon\":\"mdi:chip\",\n \"unique_id\"\ :\"ms01a_nvme0_tb_written\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} ( value | float(0) * 512000 / 1024 / 1024 / 1024 / 1024) |round(1,\ \ 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme0_power_on_hours/config retain: true payload: "{ \n \"name\":\"NVME0 Power On Hours\", \n \"state_topic\":\"ms01a/ssd_smart/nvme0_power_on_hours\"\ ,\n \"unit_of_measurement\":\"h\",\n \"icon\":\"mdi:clock-alert-outline\"\ ,\n \"unique_id\":\"ms01a_nvme0_power_on_hours\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme0_life_left_smart/config retain: true payload: "{ \n \"name\":\"NVME0 Life Left Smart\", \n \"state_topic\":\"ms01a/ssd_smart/nvme0_life_left\"\ ,\n \"unit_of_measurement\":\"%\",\n \"icon\":\"mdi:calendar-heart\",\n\ \ \"unique_id\":\"ms01a_nvme0_life_left_smart\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme0_gb_write/config retain: true payload: "{ \n \"name\":\"NVME0 Session Write\", \n \"state_topic\":\"ms01a/disk_stat/nvme0_gb_write\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-w-box\",\n \"\ unique_id\":\"ms01a_nvme0_session_write\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme0_gb_read/config retain: true payload: "{ \n \"name\":\"NVME0 Session Read\", \n \"state_topic\":\"ms01a/disk_stat/nvme0_gb_read\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-r-box\",\n \"\ unique_id\":\"ms01a_nvme0_session_read\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme1_usage/config retain: true payload: "{ \n \"name\":\"NVME1 Usage\", \n \"state_topic\":\"ms01a/disk_usage/nvme1\"\ , \n \"icon\":\"mdi:chip\", \n \"unit_of_measurement\": \"%\",\n \"unique_id\"\ :\"ms01a_nvme1_usage\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"\ MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme1_temp/config retain: true payload: "{ \n \"name\":\"NVME1 Temp\", \n \"state_topic\":\"ms01a/disk_temp/nvme1\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"ms01a_nvme1_temp\", \n \"expire_after\":\"150\",\n \ \ \"value_template\":\"{{ '{{' }} value | float(0) | round(0, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme1_tb_written/config retain: true payload: "{ \n \"name\":\"NVME1 TB Written\", \n \"state_topic\":\"ms01a/ssd_smart/nvme1_lba_written\"\ ,\n \"unit_of_measurement\":\"Tb\",\n \"icon\":\"mdi:chip\",\n \"unique_id\"\ :\"ms01a_nvme1_tb_written\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} ( value | float(0) * 512000 / 1024 / 1024 / 1024 / 1024) |round(1,\ \ 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme1_power_on_hours/config retain: true payload: "{ \n \"name\":\"NVME1 Power On Hours\", \n \"state_topic\":\"ms01a/ssd_smart/nvme1_power_on_hours\"\ ,\n \"unit_of_measurement\":\"h\",\n \"icon\":\"mdi:clock-alert-outline\"\ ,\n \"unique_id\":\"ms01a_nvme1_power_on_hours\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme1_life_left_smart/config retain: true payload: "{ \n \"name\":\"NVME1 Life Left Smart\", \n \"state_topic\":\"ms01a/ssd_smart/nvme1_life_left\"\ ,\n \"unit_of_measurement\":\"%\",\n \"icon\":\"mdi:calendar-heart\",\n\ \ \"unique_id\":\"ms01a_nvme1_life_left_smart\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme1_gb_write/config retain: true payload: "{ \n \"name\":\"NVME1 Session Write\", \n \"state_topic\":\"ms01a/disk_stat/nvme1_gb_write\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-w-box\",\n \"\ unique_id\":\"ms01a_nvme1_session_write\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_nvme1_gb_read/config retain: true payload: "{ \n \"name\":\"NVME1 Session Read\", \n \"state_topic\":\"ms01a/disk_stat/nvme1_gb_read\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-r-box\",\n \"\ unique_id\":\"ms01a_nvme1_session_read\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_cpu_temp/config retain: true payload: "{ \n \"name\":\"CPU Temp\", \n \"state_topic\":\"ms01a/psmqtt/sensors_temperatures/coretemp\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"ms01a_cpu_temp\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} value_json[0] | float(0) | round(0, 'common')\ \ {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_cpu_load/config retain: true payload: "{ \n \"name\":\"CPU Load\", \n \"state_topic\":\"ms01a/psmqtt/cpu_percent\"\ , \n \"unit_of_measurement\":\"%\",\n \"unique_id\":\"ms01a_cpu_load\",\n\ \ \"icon\":\"mdi:cpu-64-bit\",\n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(1, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"\ MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_memory_used/config retain: true payload: "{ \n \"name\":\"Memory Used\", \n \"state_topic\":\"ms01a/psmqtt/virtual_memory/percent\"\ ,\n \"value_template\":\"{{ '{{' }} value | float(100) | round(1, 'common')\ \ {{ '}}' }}\", \n \"unique_id\":\"ms01a_memory_used\",\n \"unit_of_measurement\"\ :\"%\",\n \"icon\":\"mdi:memory\",\n \"device\":{\"identifiers\":[\"ms01a\"\ ],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01a\"}\n\ }" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_enp88s0_speed/config retain: true payload: "{ \n \"name\":\"enp88s0 Speed\", \n \"state_topic\":\"ms01a/net/enp88s0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01a_enp88s0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_enp90s0_speed/config retain: true payload: "{ \n \"name\":\"enp90s0 Speed\", \n \"state_topic\":\"ms01a/net/enp90s0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01a_enp90s0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_enp3s0f0np0_speed/config retain: true payload: "{ \n \"name\":\"enp3s0f0np0 Speed\", \n \"state_topic\":\"ms01a/net/enp3s0f0np0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01a_enp3s0f0np0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_enp3s0f1np1_speed/config retain: true payload: "{ \n \"name\":\"enp3s0f1np1 Speed\", \n \"state_topic\":\"ms01a/net/enp3s0f1np1\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01a_enp3s0f1np1_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_enp1s0f0_speed/config retain: true payload: "{ \n \"name\":\"enp1s0f0 Speed\", \n \"state_topic\":\"ms01a/net/enp1s0f0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01a_enp1s0f0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_enp1s0f1_speed/config retain: true payload: "{ \n \"name\":\"enp1s0f1 Speed\", \n \"state_topic\":\"ms01a/net/enp1s0f1\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01a_enp1s0f1_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_enp1s0f2_speed/config retain: true payload: "{ \n \"name\":\"enp1s0f2 Speed\", \n \"state_topic\":\"ms01a/net/enp1s0f2\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01a_enp1s0f2_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_enp1s0f3_speed/config retain: true payload: "{ \n \"name\":\"enp1s0f3 Speed\", \n \"state_topic\":\"ms01a/net/enp1s0f3\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01a_enp1s0f3_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01a\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01a\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_fan1/config retain: true payload: "{ \n \"name\":\"Fan 1\", \n \"state_topic\":\"ms01a/psmqtt/sensors_fans/nct6798\"\ , \n \"unit_of_measurement\":\"rpm\",\n \"unique_id\":\"ms01a_fan_1\", \n\ \ \"icon\":\"mdi:fan\",\n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value_json[0] | float(0) | round(0, 'common') {{ '}}' }}\",\ \ \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01a_fan2/config retain: true payload: "{ \n \"name\":\"Fan 2\", \n \"state_topic\":\"ms01a/psmqtt/sensors_fans/nct6798\"\ , \n \"unit_of_measurement\":\"rpm\",\n \"unique_id\":\"ms01a_fan_2\", \n\ \ \"icon\":\"mdi:fan\",\n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value_json[1] | float(0) | round(0, 'common') {{ '}}' }}\",\ \ \n \"device\":{\"identifiers\":[\"ms01a\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01a\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_telemetry_last_update/config retain: true payload: "{ \n \"name\":\"Telemetry Last Update\", \n \"state_topic\":\"ms01b/last_update\"\ , \n \"icon\":\"mdi:calendar\", \n \"unique_id\":\"ms01b_telemetry_last_update\"\ ,\n \"entity_category\": \"diagnostic\",\n \"value_template\":\"{{ '{{'\ \ }} value {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_uptime/config retain: true payload: "{ \n \"name\":\"Uptime\", \n \"state_topic\":\"ms01b/system_uptime\"\ , \n \"icon\":\"mdi:clock-digital\", \n \"unit_of_measurement\": \"m\"\ ,\n \"unique_id\":\"ms01b_uptime\", \n \"entity_category\": \"diagnostic\"\ ,\n \"expire_after\":\"150\",\n \"value_template\":\"{{ '{{' }} ((value\ \ | float(0))/60) | round(2, 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_iowait/config retain: true payload: "{ \n \"name\":\"IoWait\", \n \"state_topic\":\"ms01b/kernel_stat\"\ , \n \"icon\":\"mdi:speedometer-medium\", \n \"unit_of_measurement\": \"\ %\",\n \"unique_id\":\"ms01b_iowait\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} ((value_json.sysstat.hosts[0].statistics[0]['avg-cpu'].iowait)\ \ | float(0)) | round(2, 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme0_usage/config retain: true payload: "{ \n \"name\":\"NVME0 Usage\", \n \"state_topic\":\"ms01b/disk_usage/nvme0\"\ , \n \"icon\":\"mdi:chip\", \n \"unit_of_measurement\": \"%\",\n \"unique_id\"\ :\"ms01b_nvme0_usage\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"\ MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme0_temp/config retain: true payload: "{ \n \"name\":\"NVME0 Temp\", \n \"state_topic\":\"ms01b/disk_temp/nvme0\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"ms01b_nvme0_temp\", \n \"expire_after\":\"150\",\n \ \ \"value_template\":\"{{ '{{' }} value | float(0) | round(0, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme0_tb_written/config retain: true payload: "{ \n \"name\":\"NVME0 TB Written\", \n \"state_topic\":\"ms01b/ssd_smart/nvme0_lba_written\"\ ,\n \"unit_of_measurement\":\"Tb\",\n \"icon\":\"mdi:chip\",\n \"unique_id\"\ :\"ms01b_nvme0_tb_written\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} ( value | float(0) * 512000 / 1024 / 1024 / 1024 / 1024) |round(1,\ \ 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme0_power_on_hours/config retain: true payload: "{ \n \"name\":\"NVME0 Power On Hours\", \n \"state_topic\":\"ms01b/ssd_smart/nvme0_power_on_hours\"\ ,\n \"unit_of_measurement\":\"h\",\n \"icon\":\"mdi:clock-alert-outline\"\ ,\n \"unique_id\":\"ms01b_nvme0_power_on_hours\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme0_life_left_smart/config retain: true payload: "{ \n \"name\":\"NVME0 Life Left Smart\", \n \"state_topic\":\"ms01b/ssd_smart/nvme0_life_left\"\ ,\n \"unit_of_measurement\":\"%\",\n \"icon\":\"mdi:calendar-heart\",\n\ \ \"unique_id\":\"ms01b_nvme0_life_left_smart\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme0_gb_write/config retain: true payload: "{ \n \"name\":\"NVME0 Session Write\", \n \"state_topic\":\"ms01b/disk_stat/nvme0_gb_write\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-w-box\",\n \"\ unique_id\":\"ms01b_nvme0_session_write\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme0_gb_read/config retain: true payload: "{ \n \"name\":\"NVME0 Session Read\", \n \"state_topic\":\"ms01b/disk_stat/nvme0_gb_read\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-r-box\",\n \"\ unique_id\":\"ms01b_nvme0_session_read\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme1_usage/config retain: true payload: "{ \n \"name\":\"NVME1 Usage\", \n \"state_topic\":\"ms01b/disk_usage/nvme1\"\ , \n \"icon\":\"mdi:chip\", \n \"unit_of_measurement\": \"%\",\n \"unique_id\"\ :\"ms01b_nvme1_usage\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"\ MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme1_temp/config retain: true payload: "{ \n \"name\":\"NVME1 Temp\", \n \"state_topic\":\"ms01b/disk_temp/nvme1\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"ms01b_nvme1_temp\", \n \"expire_after\":\"150\",\n \ \ \"value_template\":\"{{ '{{' }} value | float(0) | round(0, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme1_tb_written/config retain: true payload: "{ \n \"name\":\"NVME1 TB Written\", \n \"state_topic\":\"ms01b/ssd_smart/nvme1_lba_written\"\ ,\n \"unit_of_measurement\":\"Tb\",\n \"icon\":\"mdi:chip\",\n \"unique_id\"\ :\"ms01b_nvme1_tb_written\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} ( value | float(0) * 512000 / 1024 / 1024 / 1024 / 1024) |round(1,\ \ 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme1_power_on_hours/config retain: true payload: "{ \n \"name\":\"NVME1 Power On Hours\", \n \"state_topic\":\"ms01b/ssd_smart/nvme1_power_on_hours\"\ ,\n \"unit_of_measurement\":\"h\",\n \"icon\":\"mdi:clock-alert-outline\"\ ,\n \"unique_id\":\"ms01b_nvme1_power_on_hours\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme1_life_left_smart/config retain: true payload: "{ \n \"name\":\"NVME1 Life Left Smart\", \n \"state_topic\":\"ms01b/ssd_smart/nvme1_life_left\"\ ,\n \"unit_of_measurement\":\"%\",\n \"icon\":\"mdi:calendar-heart\",\n\ \ \"unique_id\":\"ms01b_nvme1_life_left_smart\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme1_gb_write/config retain: true payload: "{ \n \"name\":\"NVME1 Session Write\", \n \"state_topic\":\"ms01b/disk_stat/nvme1_gb_write\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-w-box\",\n \"\ unique_id\":\"ms01b_nvme1_session_write\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_nvme1_gb_read/config retain: true payload: "{ \n \"name\":\"NVME1 Session Read\", \n \"state_topic\":\"ms01b/disk_stat/nvme1_gb_read\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-r-box\",\n \"\ unique_id\":\"ms01b_nvme1_session_read\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_cpu_temp/config retain: true payload: "{ \n \"name\":\"CPU Temp\", \n \"state_topic\":\"ms01b/psmqtt/sensors_temperatures/coretemp\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"ms01b_cpu_temp\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} value_json[0] | float(0) | round(0, 'common')\ \ {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\"\ :\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_cpu_load/config retain: true payload: "{ \n \"name\":\"CPU Load\", \n \"state_topic\":\"ms01b/psmqtt/cpu_percent\"\ , \n \"unit_of_measurement\":\"%\",\n \"unique_id\":\"ms01b_cpu_load\",\n\ \ \"icon\":\"mdi:cpu-64-bit\",\n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(1, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"\ MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_memory_used/config retain: true payload: "{ \n \"name\":\"Memory Used\", \n \"state_topic\":\"ms01b/psmqtt/virtual_memory/percent\"\ ,\n \"value_template\":\"{{ '{{' }} value | float(100) | round(1, 'common')\ \ {{ '}}' }}\", \n \"unique_id\":\"ms01b_memory_used\",\n \"unit_of_measurement\"\ :\"%\",\n \"icon\":\"mdi:memory\",\n \"device\":{\"identifiers\":[\"ms01b\"\ ],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"ms01b\"}\n\ }" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_enp88s0_speed/config retain: true payload: "{ \n \"name\":\"enp88s0 Speed\", \n \"state_topic\":\"ms01b/net/enp88s0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01b_enp88s0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_enp90s0_speed/config retain: true payload: "{ \n \"name\":\"enp90s0 Speed\", \n \"state_topic\":\"ms01b/net/enp90s0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01b_enp90s0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_enp3s0f0np0_speed/config retain: true payload: "{ \n \"name\":\"enp3s0f0np0 Speed\", \n \"state_topic\":\"ms01b/net/enp3s0f0np0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01b_enp3s0f0np0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_enp3s0f1np1_speed/config retain: true payload: "{ \n \"name\":\"enp3s0f1np1 Speed\", \n \"state_topic\":\"ms01b/net/enp3s0f1np1\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01b_enp3s0f1np1_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_enp1s0f0_speed/config retain: true payload: "{ \n \"name\":\"enp1s0f0 Speed\", \n \"state_topic\":\"ms01b/net/enp1s0f0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01b_enp1s0f0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_enp1s0f1_speed/config retain: true payload: "{ \n \"name\":\"enp1s0f1 Speed\", \n \"state_topic\":\"ms01b/net/enp1s0f1\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01b_enp1s0f1_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_enp1s0f2_speed/config retain: true payload: "{ \n \"name\":\"enp1s0f2 Speed\", \n \"state_topic\":\"ms01b/net/enp1s0f2\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01b_enp1s0f2_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_enp1s0f3_speed/config retain: true payload: "{ \n \"name\":\"enp1s0f3 Speed\", \n \"state_topic\":\"ms01b/net/enp1s0f3\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"ms01b_enp1s0f3_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"ms01b\"],\"manufacturer\":\"Minisforum\",\"model\":\"MS01\",\"name\":\"\ ms01b\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_fan1/config retain: true payload: "{ \n \"name\":\"Fan 1\", \n \"state_topic\":\"ms01b/psmqtt/sensors_fans/nct6798\"\ , \n \"unit_of_measurement\":\"rpm\",\n \"unique_id\":\"ms01b_fan_1\", \n\ \ \"icon\":\"mdi:fan\",\n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value_json[0] | float(0) | round(0, 'common') {{ '}}' }}\",\ \ \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/ms01b_fan2/config retain: true payload: "{ \n \"name\":\"Fan 2\", \n \"state_topic\":\"ms01b/psmqtt/sensors_fans/nct6798\"\ , \n \"unit_of_measurement\":\"rpm\",\n \"unique_id\":\"ms01b_fan_2\", \n\ \ \"icon\":\"mdi:fan\",\n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value_json[1] | float(0) | round(0, 'common') {{ '}}' }}\",\ \ \n \"device\":{\"identifiers\":[\"ms01b\"],\"manufacturer\":\"Minisforum\"\ ,\"model\":\"MS01\",\"name\":\"ms01b\"}\n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_telemetry_last_update/config retain: true payload: "{ \n \"name\":\"Telemetry Last Update\", \n \"state_topic\":\"pbs100/last_update\"\ , \n \"icon\":\"mdi:calendar\", \n \"unique_id\":\"pbs100_telemetry_last_update\"\ ,\n \"entity_category\": \"diagnostic\",\n \"value_template\":\"{{ '{{'\ \ }} value {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\"\ :\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_uptime/config retain: true payload: "{ \n \"name\":\"Uptime\", \n \"state_topic\":\"pbs100/system_uptime\"\ , \n \"icon\":\"mdi:clock-digital\", \n \"unit_of_measurement\": \"m\"\ ,\n \"unique_id\":\"pbs100_uptime\", \n \"entity_category\": \"diagnostic\"\ ,\n \"expire_after\":\"150\",\n \"value_template\":\"{{ '{{' }} ((value\ \ | float(0))/60) | round(2, 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"pbs100\"],\"manufacturer\":\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"\ } \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_iowait/config retain: true payload: "{ \n \"name\":\"IoWait\", \n \"state_topic\":\"pbs100/kernel_stat\"\ , \n \"icon\":\"mdi:speedometer-medium\", \n \"unit_of_measurement\": \"\ %\",\n \"unique_id\":\"pbs100_iowait\", \n \"expire_after\":\"150\",\n \ \ \"value_template\":\"{{ '{{' }} ((value_json.sysstat.hosts[0].statistics[0]['avg-cpu'].iowait)\ \ | float(0)) | round(2, 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"pbs100\"],\"manufacturer\":\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"\ } \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_nvme0_usage/config retain: true payload: "{ \n \"name\":\"NVME0 Usage\", \n \"state_topic\":\"pbs100/disk_usage/nvme0\"\ , \n \"icon\":\"mdi:chip\", \n \"unit_of_measurement\": \"%\",\n \"unique_id\"\ :\"pbs100_nvme0_usage\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\",\"model\":\"4500u\"\ ,\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_nvme0_temp/config retain: true payload: "{ \n \"name\":\"NVME0 Temp\", \n \"state_topic\":\"pbs100/disk_temp/nvme0\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"pbs100_nvme0_temp\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value | float(0) | round(0, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\"\ :\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_nvme0_tb_written/config retain: true payload: "{ \n \"name\":\"NVME0 TB Written\", \n \"state_topic\":\"pbs100/ssd_smart/nvme0_lba_written\"\ ,\n \"unit_of_measurement\":\"Tb\",\n \"icon\":\"mdi:chip\",\n \"unique_id\"\ :\"pbs100_nvme0_tb_written\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} ( value | float(0) * 512000 / 1024 / 1024 / 1024 / 1024) |round(1,\ \ 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"\ manufacturer\":\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_nvme0_power_on_hours/config retain: true payload: "{ \n \"name\":\"NVME0 Power On Hours\", \n \"state_topic\":\"pbs100/ssd_smart/nvme0_power_on_hours\"\ ,\n \"unit_of_measurement\":\"h\",\n \"icon\":\"mdi:clock-alert-outline\"\ ,\n \"unique_id\":\"pbs100_nvme0_power_on_hours\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\",\"\ model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_nvme0_life_left_smart/config retain: true payload: "{ \n \"name\":\"NVME0 Life Left Smart\", \n \"state_topic\":\"pbs100/ssd_smart/nvme0_life_left\"\ ,\n \"unit_of_measurement\":\"%\",\n \"icon\":\"mdi:calendar-heart\",\n\ \ \"unique_id\":\"pbs100_nvme0_life_left_smart\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\",\"\ model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_nvme0_gb_write/config retain: true payload: "{ \n \"name\":\"NVME0 Session Write\", \n \"state_topic\":\"pbs100/disk_stat/nvme0_gb_write\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-w-box\",\n \"\ unique_id\":\"pbs100_nvme0_session_write\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\"\ :\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_nvme0_gb_read/config retain: true payload: "{ \n \"name\":\"NVME0 Session Read\", \n \"state_topic\":\"pbs100/disk_stat/nvme0_gb_read\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-r-box\",\n \"\ unique_id\":\"pbs100_nvme0_session_read\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\"\ :\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_sda_usage/config retain: true payload: "{ \n \"name\":\"SDA Usage\", \n \"state_topic\":\"pbs100/disk_usage/sda\"\ , \n \"icon\":\"mdi:chip\", \n \"unit_of_measurement\": \"%\",\n \"unique_id\"\ :\"pbs100_sda_usage\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\",\"model\":\"4500u\"\ ,\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_sda_temp/config retain: true payload: "{ \n \"name\":\"SDA Temp\", \n \"state_topic\":\"pbs100/disk_temp/sda\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"pbs100_sda_temp\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\"\ ,\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_sda_tb_written/config retain: true payload: "{ \n \"name\":\"SDA TB Written\", \n \"state_topic\":\"pbs100/ssd_smart/sda_lba_written\"\ ,\n \"unit_of_measurement\":\"Tb\",\n \"icon\":\"mdi:chip\",\n \"unique_id\"\ :\"pbs100_sda_tb_written\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} ( value | float(0) * 512 / 1024 / 1024 / 1024 / 1024) |round(1,\ \ 'common') {{ '}}' }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"\ manufacturer\":\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_sda_power_on_hours/config retain: true payload: "{ \n \"name\":\"SDA Power On Hours\", \n \"state_topic\":\"pbs100/ssd_smart/sda_power_on_hours\"\ ,\n \"unit_of_measurement\":\"h\",\n \"icon\":\"mdi:clock-alert-outline\"\ ,\n \"unique_id\":\"pbs100_sda_power_on_hours\", \n \"expire_after\":\"\ 150\",\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n\ \ \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\",\"\ model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_sda_life_left_smart/config retain: true payload: "{ \n \"name\":\"SDA Life Left Smart\", \n \"state_topic\":\"pbs100/ssd_smart/sda_life_left\"\ ,\n \"unit_of_measurement\":\"%\",\n \"icon\":\"mdi:calendar-heart\",\n\ \ \"unique_id\":\"pbs100_sda_life_left_smart\", \n \"expire_after\":\"150\"\ ,\n \"value_template\":\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\",\"model\":\"4500u\"\ ,\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_sda_gb_write/config retain: true payload: "{ \n \"name\":\"SDA Session Write\", \n \"state_topic\":\"pbs100/disk_stat/sda_gb_write\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-w-box\",\n \"\ unique_id\":\"pbs100_sda_session_write\", \n \"expire_after\":\"150\",\n\ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{\ \ '}}' }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\"\ :\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_sda_gb_read/config retain: true payload: "{ \n \"name\":\"SDA Session Read\", \n \"state_topic\":\"pbs100/disk_stat/sda_gb_read\"\ ,\n \"unit_of_measurement\":\"Gb\",\n \"icon\":\"mdi:alpha-r-box\",\n \"\ unique_id\":\"pbs100_sda_session_read\", \n \"expire_after\":\"150\",\n \ \ \"value_template\":\"{{ '{{' }} value| float(0)| round(1, 'common') {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\"\ ,\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_cpu_temp/config retain: true payload: "{ \n \"name\":\"CPU Temp\", \n \"state_topic\":\"pbs100/psmqtt/sensors_temperatures/k10temp\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"pbs100_cpu_temp\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\"\ ,\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_gpu_temp/config retain: true payload: "{ \n \"name\":\"GPU Temp\", \n \"state_topic\":\"pbs100/psmqtt/sensors_temperatures/amdgpu\"\ , \n \"unit_of_measurement\":\"°C\",\n \"device_class\":\"temperature\"\ ,\n \"unique_id\":\"pbs100_gpu_temp\", \n \"expire_after\":\"150\",\n \"\ value_template\":\"{{ '{{' }} value | float(0) | round(0, 'common') {{ '}}'\ \ }}\", \n \"device\":{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\"\ ,\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_cpu_load/config retain: true payload: "{ \n \"name\":\"CPU Load\", \n \"state_topic\":\"pbs100/psmqtt/cpu_percent\"\ , \n \"unit_of_measurement\":\"%\",\n \"unique_id\":\"pbs100_cpu_load\"\ ,\n \"icon\":\"mdi:cpu-64-bit\",\n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | float(0) | round(1, 'common') {{ '}}' }}\", \n \"device\"\ :{\"identifiers\":[\"pbs100\"],\"manufacturer\":\"zxipc\",\"model\":\"4500u\"\ ,\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_memory_used/config retain: true payload: "{ \n \"name\":\"Memory Used\", \n \"state_topic\":\"pbs100/psmqtt/virtual_memory/percent\"\ ,\n \"value_template\":\"{{ '{{' }} value | float(100) | round(1, 'common')\ \ {{ '}}' }}\", \n \"unique_id\":\"pbs100_memory_used\",\n \"unit_of_measurement\"\ :\"%\",\n \"icon\":\"mdi:memory\",\n \"device\":{\"identifiers\":[\"pbs100\"\ ],\"manufacturer\":\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"} \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_enp1s0_speed/config retain: true payload: "{ \n \"name\":\"enp1s0 Speed\", \n \"state_topic\":\"pbs100/net/enp1s0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"pbs100_enp1s0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"pbs100\"],\"manufacturer\":\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"\ } \n}" - action: mqtt.publish data: topic: homeassistant/sensor/pbs100_enp3s0_speed/config retain: true payload: "{ \n \"name\":\"enp3s0 Speed\", \n \"state_topic\":\"pbs100/net/enp3s0\"\ ,\n \"unit_of_measurement\":\"MB/s\",\n \"icon\":\"mdi:speedometer\",\n\ \ \"device_class\":\"data_rate\",\n \"force_update\": true,\n \"unique_id\"\ :\"pbs100_enp3s0_speed\", \n \"expire_after\":\"150\",\n \"value_template\"\ :\"{{ '{{' }} value | int(0) {{ '}}' }}\", \n \"device\":{\"identifiers\"\ :[\"pbs100\"],\"manufacturer\":\"zxipc\",\"model\":\"4500u\",\"name\":\"pbs100\"\ } \n}" - alias: bathroom_button_b_single id: bathroom_button_b_single initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001b94abe_action click_type: single actions: - choose: - conditions: - condition: state entity_id: group.lights_b state: 'off' sequence: - action: xiaomi_miio.light_set_scene data: entity_id: light.mirror_light_b scene: 4 - conditions: - condition: state entity_id: fan.esp32_node_b_fan_b state: 'off' - condition: state entity_id: group.lights_b state: 'on' - condition: state entity_id: switch.esp32_node_b_fan_b_force_mode state: 'off' sequence: - action: fan.turn_off entity_id: fan.esp32_node_b_fan_t - action: timer.pause entity_id: timer.fan_t - action: switch.turn_on entity_id: switch.esp32_node_b_fan_b_manual_mode - conditions: - condition: state entity_id: fan.esp32_node_b_fan_b state: 'on' - condition: state entity_id: switch.esp32_node_b_fan_b_force_mode state: 'off' sequence: - action: switch.turn_off entity_id: switch.esp32_node_b_fan_b_manual_mode - action: switch.turn_on entity_id: switch.esp32_node_b_fan_b_auto_mode - alias: bathroom_button_b_double id: bathroom_button_b_double initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001b94abe_action click_type: double actions: - choose: - conditions: - condition: state entity_id: group.lights_b state: 'off' sequence: - action: xiaomi_miio.light_set_scene data: entity_id: light.mirror_light_b scene: 1 - conditions: - condition: state entity_id: group.lights_b state: 'on' sequence: - action: fan.toggle entity_id: fan.sonoff_pow_r2_1_bottom_fan - alias: bathroom_fan_with_light id: bathroom_fan_with_light initial_state: true triggers: - trigger: state entity_id: light.0x00158d0002a36433_channel_2 to: 'on' id: to_on - trigger: state entity_id: light.0x00158d0002a36433_channel_2 to: 'off' id: to_off actions: - choose: - conditions: - condition: trigger id: to_on sequence: - action: switch.turn_off entity_id: switch.esp32_node_b_fan_b_auto_mode - action: fan.turn_off entity_id: fan.esp32_node_b_fan_b, fan.sonoff_pow_r2_1_bottom_fan - conditions: - condition: trigger id: to_off sequence: - action: switch.turn_on entity_id: switch.esp32_node_b_fan_b_auto_mode - alias: bathroom_fan_night_mode id: bathroom_fan_night_mode initial_state: true triggers: - trigger: time_pattern minutes: /5 conditions: - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ states(''fan.esp32_node_b_fan_b'') in [''on'',''off''] }}' - condition: template value_template: '{{ 1 <= now().hour < 6 }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.0x00158d0002a14c5e_contact state: 'off' for: minutes: 3 sequence: - action: number.set_value data: value: '30' target: entity_id: number.esp32_node_b_humidity_set - conditions: - condition: state entity_id: binary_sensor.0x00158d0002a14c5e_contact state: 'on' for: minutes: 3 sequence: - action: number.set_value data: value: '65' target: entity_id: number.esp32_node_b_humidity_set - alias: bathroom_fan_to_normal_mode id: bathroom_fan_to_normal_mode initial_state: true triggers: - trigger: time at: 06:20:00 conditions: - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ states(''fan.esp32_node_b_fan_b'') in [''on'',''off''] }}' - condition: template value_template: '{{states(''number.esp32_node_b_humidity_set'')|int(0) < 50 }}' actions: - action: number.set_value data: value: '65' target: entity_id: number.esp32_node_b_humidity_set - action: switch.turn_off entity_id: switch.esp32_node_b_fan_b_force_mode - alias: bathroom_bottom_fan_with_fan id: bathroom_bottom_fan_with_fan initial_state: true triggers: - trigger: state entity_id: fan.esp32_node_b_fan_b to: null conditions: - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ states(''fan.esp32_node_b_fan_b'') in [''on'',''off''] }}' actions: - action: fan.turn_{{ states('fan.esp32_node_b_fan_b') }} entity_id: fan.sonoff_pow_r2_1_bottom_fan - alias: bathroom_bottom_fan id: bathroom_bottom_fan initial_state: true triggers: - trigger: time at: 07:00:03 - trigger: time at: '23:00:03' conditions: - condition: state entity_id: switch.system_security_mode state: 'off' actions: - action: fan.turn_{%if states('binary_sensor.tod_day')%}off{%else%}on{%endif%} entity_id: fan.sonoff_pow_r2_1_bottom_fan - alias: bathroom_bottom_fan_toggle id: bathroom_bottom_fan_toggle initial_state: true triggers: - trigger: time_pattern minutes: /30 conditions: - condition: state entity_id: binary_sensor.tod_day state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: switch.esp32_node_b_fan_b_force_mode state: 'off' actions: - condition: template value_template: '{{ is_state(''group.lights_b'',''off'') or is_state(''fan.sonoff_pow_r2_1_bottom_fan'',''on'') }}' - action: fan.toggle entity_id: fan.sonoff_pow_r2_1_bottom_fan - alias: bathroom_fan_off_by_timer id: bathroom_fan_off_by_timer initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.fan_b conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: fan.turn_off entity_id: fan.esp32_node_b_fan_b - action: switch.turn_off entity_id: switch.esp32_node_b_fan_b_manual_mode - condition: state entity_id: timer.fan_t state: paused - action: fan.turn_on entity_id: fan.esp32_node_b_fan_t - action: timer.start entity_id: timer.fan_t - alias: bathroom_main_fan_timer_with_switch id: bathroom_main_fan_timer_with_switch mode: single max_exceeded: silent initial_state: true triggers: - trigger: state entity_id: fan.esp32_node_b_fan_b to: null conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: template value_template: '{{ states(''fan.esp32_node_b_fan_b'') in [''on'',''off''] }}' - condition: state entity_id: switch.esp32_node_b_fan_b_force_mode state: 'off' actions: - if: - condition: state entity_id: fan.esp32_node_b_fan_b state: 'on' then: - action: timer.start entity_id: timer.fan_b - alias: bathroom_light_off_auto id: bathroom_light_off_auto initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.main_light_b conditions: - condition: state entity_id: binary_sensor.presence_b state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: group.lights_b state: 'on' actions: - action: light.turn_off entity_id: light.0x00158d0002a36433_channel_2 - action: light.turn_off entity_id: light.mirror_light_b data: transition: 5 - alias: bathroom_light_timer_on id: bathroom_light_timer_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.presence_b from: 'on' to: 'off' - trigger: state entity_id: group.lights_b to: 'on' conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: timer.cancel entity_id: timer.main_light_b - action: timer.start entity_id: timer.main_light_b - alias: bathroom_timer_stop id: bathroom_timer_stop initial_state: true triggers: - trigger: state entity_id: binary_sensor.presence_b from: 'off' to: 'on' - trigger: state entity_id: group.lights_b to: 'off' conditions: - condition: state entity_id: timer.main_light_b state: active actions: - action: timer.cancel entity_id: timer.main_light_b, timer.door_b - alias: bathroom_timer_stop_motion_with_light_presence id: bathroom_timer_stop_motion_with_light_presence initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d000236bc6d_motion to: 'on' conditions: and: - condition: state entity_id: binary_sensor.presence_b state: 'on' - condition: state entity_id: group.lights_b state: 'on' - or: - condition: state entity_id: timer.main_light_b state: active - condition: state entity_id: timer.door_b state: active actions: - action: timer.cancel entity_id: timer.main_light_b, timer.door_b - alias: bathroom_input_on_off id: bathroom_input_on_off mode: queued max: 10 max_exceeded: silent initial_state: true triggers: - trigger: state entity_id: binary_sensor.wasp_b to: 'on' id: id_to_on - trigger: state entity_id: binary_sensor.wasp_b to: 'off' id: id_to_off actions: - choose: - conditions: - condition: trigger id: id_to_on - condition: state entity_id: group.lights_b state: 'on' - condition: state entity_id: switch.system_security_mode state: 'off' sequence: - action: timer.pause entity_id: timer.main_light_b - action: input_boolean.turn_on data: entity_id: input_boolean.bathroom_occupancy - conditions: - condition: trigger id: id_to_off sequence: - action: input_boolean.turn_off data: entity_id: input_boolean.bathroom_occupancy - alias: bathroom_auto_light_on_soft id: bathroom_auto_light_on_soft initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d000236bc6d_motion conditions: - condition: state entity_id: group.lights_b state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: xiaomi_miio.light_set_scene data: entity_id: light.mirror_light_b scene: '{{4 if (is_state(''binary_sensor.tod_day'',''off'') or is_state(''switch.system_dark_mode'',''on'')) else 1}}' - alias: bathroom_light_toggle_repeater id: bathroom_light_toggle_repeater initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x54ef4410005054cc_action click_type: button_1_single actions: - choose: - conditions: - condition: state entity_id: group.lights_b state: 'on' sequence: - action: light.turn_off entity_id: light.0x00158d0002a36433_channel_2, light.mirror_light_b - conditions: - condition: state entity_id: group.lights_b state: 'off' sequence: - action: light.turn_on entity_id: light.0x00158d0002a36433_channel_2 - alias: bathroom_mirror_light_manual id: bathroom_mirror_light_manual initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001ef6089_action conditions: - condition: template value_template: '{{ states(''light.mirror_light_b'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: state entity_id: light.mirror_light_b state: 'on' - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' }}' sequence: - action: light.turn_off entity_id: light.mirror_light_b - conditions: - condition: state entity_id: light.mirror_light_b state: 'off' - condition: state entity_id: light.0x00158d0002a36433_channel_2 state: 'off' - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' }}' sequence: - action: xiaomi_miio.light_set_scene data: entity_id: light.mirror_light_b scene: 4 - conditions: - condition: state entity_id: light.mirror_light_b state: 'off' - condition: state entity_id: light.0x00158d0002a36433_channel_2 state: 'on' - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' }}' sequence: - action: xiaomi_miio.light_set_scene data: entity_id: light.mirror_light_b scene: 1 - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''double'' }}' sequence: - action: xiaomi_miio.light_set_scene data: entity_id: light.mirror_light_b scene: 1 - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''hold'' }}' sequence: - action: xiaomi_miio.light_set_scene data: entity_id: light.mirror_light_b scene: 4 - alias: bathroom_mirror_light_restart id: bathroom_mirror_light_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.mirror_light_b state: unavailable for: minutes: 2 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_mirror_light_b_restart_key state: 'on' - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ states('switch.esp32_node_b_relay_5')\ \ not in ignore }} \n" actions: - repeat: while: - condition: state entity_id: light.mirror_light_b state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.esp32_node_b_relay_5 - delay: seconds: 15 - action: switch.turn_on entity_id: switch.esp32_node_b_relay_5 - action: notify.telegram data: message: 🚨 Mirror LED B restart done({{repeat.index}})! - delay: seconds: 30 - condition: state entity_id: light.mirror_light_b state: unavailable - action: notify.telegram data: message: 🚨 Mirror LED B restart unsuccessful! - action: switch.turn_off entity_id: switch.system_mirror_light_b_restart_key - alias: bathroom_mirror_led_restart_key_toggle id: bathroom_mirror_led_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.mirror_light_b from: unavailable actions: - action: switch.turn_on entity_id: switch.system_mirror_light_b_restart_key - alias: bathroom_indicator id: bathroom_indicator initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: input_boolean.bathroom_occupancy to: null conditions: - condition: template value_template: '{{ states(''input_boolean.bathroom_occupancy'') in [''on'',''off''] }}' actions: - choose: - conditions: - condition: state entity_id: input_boolean.bathroom_occupancy state: 'off' sequence: - action: light.turn_off entity_id: light.esp32_node_hs_bathroom - conditions: - condition: state entity_id: input_boolean.bathroom_occupancy state: 'on' sequence: - action: light.turn_on data: entity_id: light.esp32_node_hs_bathroom effect: Color Wipe brightness: 100 - alias: bathroom_mirror_light_sync id: bathroom_mirror_light_sync initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: state entity_id: light.0x00158d0002a36433_channel_2 to: 'off' from: 'on' id: to_off - trigger: state entity_id: light.0x00158d0002a36433_channel_2 to: 'on' from: 'off' id: to_on actions: - choose: - conditions: - condition: trigger id: to_off - condition: state entity_id: light.mirror_light_b state: 'on' sequence: - action: light.turn_off entity_id: light.mirror_light_b data: transition: 5 - conditions: - condition: trigger id: to_on - condition: state entity_id: light.mirror_light_b state: 'on' sequence: - action: xiaomi_miio.light_set_scene data: entity_id: light.mirror_light_b scene: 1 - alias: hall_big_auto_night_light_on id: hall_big_auto_night_light_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001e05856_motion conditions: - or: - condition: state entity_id: binary_sensor.tod_day state: 'off' - condition: state entity_id: switch.system_dark_mode state: 'on' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: group.lights_hb state: 'off' actions: - action: light.turn_on entity_id: light.esp32_strip_1s_entrance_hb_rgb data: brightness: 10 rgb_color: - 250 - 95 - 85 - alias: hall_big_auto_light_on id: hall_big_auto_light_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001e05856_motion id: entr - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b482e9_motion id: fridge conditions: - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: binary_sensor.tod_day state: 'on' - condition: state entity_id: switch.system_dark_mode state: 'off' - condition: state entity_id: group.lights_main_hb state: 'off' actions: - action: script.hall_big_led_strip_on data: strips: '{{ trigger.id }}' - alias: hall_big_night_mode_preparation id: hall_big_night_mode_preparation initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.tod_day from: 'on' to: 'off' actions: - action: light.turn_off entity_id: light.esp32_strip_1s_wadrobe_hb_rgb, light.esp32_strip_1s_entrance_hb_rgb data: transition: 5 - action: switch.turn_off entity_id: switch.system_dark_mode - alias: hall_big_main_door_open id: hall_big_main_door_open initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: - binary_sensor.0x00158d0001e5d6be_contact from: 'off' to: 'on' actions: - action: script.hall_big_led_strip_on data: strips: both - action: input_number.set_value data: entity_id: input_number.main_door_open value: '{{as_timestamp(now())|int(0) }}' - action: counter.increment entity_id: counter.main_door_hb - action: notify.telegram data: message: 🚪 Внимание! Входная дверь открыта! ({{states('sensor.time')}} {{states('sensor.date')}}, {{ states('counter.main_door_hb') }}) - action: notify.telegram_cam data: message: 🚪 Внимание! Входная дверь открыта! ({{states('sensor.time')}} {{states('sensor.date')}}, {{ states('counter.main_door_hb') }}) - delay: 00:00:09 - action: script.turn_on entity_id: script.open_door_photo - alias: hall_big_timer_on id: hall_big_timer_on initial_state: true triggers: - trigger: state entity_id: light.0x00158d000223921b_channel_1 to: 'on' from: 'off' - trigger: state entity_id: light.0x00158d000253f04a_channel_2 to: 'on' from: 'off' actions: - action: timer.cancel entity_id: timer.main_light_hb - action: timer.start entity_id: timer.main_light_hb - alias: hall_big_timer_off id: hall_big_timer_off initial_state: true triggers: - trigger: template value_template: '{{not is_state(''light.0x00158d000253f04a_channel_2'',''on'') and not is_state(''light.0x00158d000223921b_channel_1'',''on'') }}' actions: - action: timer.cancel entity_id: timer.main_light_hb - alias: hall_big_led_strip_with_main_off id: hall_big_led_strip_with_main_off initial_state: true triggers: - trigger: state entity_id: group.lights_main_hb to: 'off' from: 'on' - trigger: state entity_id: group.lights_main_hb to: 'on' from: 'off' actions: - choose: - conditions: - condition: state entity_id: group.lights_main_hb state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' sequence: - action: script.hall_big_led_strip_on data: strips: both - conditions: - condition: state entity_id: group.lights_main_hb state: 'on' sequence: - action: light.turn_off entity_id: light.esp32_strip_1s_entrance_hb_rgb, light.esp32_strip_1s_wadrobe_hb_rgb data: transition: 5 - alias: hall_big_auto_off_10m id: hall_big_auto_off_10m initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.main_light_hb actions: - action: light.turn_off entity_id: light.0x00158d000223921b_channel_1, light.0x00158d000253f04a_channel_2 - alias: hall_big_timer_restart id: hall_big_timer_restart initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001e05856_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b482e9_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.582d34609600_motion conditions: - condition: state entity_id: group.lights_main_hb state: 'on' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: timer.cancel entity_id: timer.main_light_hb - action: timer.start entity_id: timer.main_light_hb - alias: hall_big_entrance_light_on_from_fridge id: hall_big_entrance_light_on_from_fridge initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d000253f04a_action click_type: button_1_single - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001e0784e_action click_type: button_1_single conditions: - condition: numeric_state entity_id: sensor.ha_uptime above: 0 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.toggle entity_id: light.0x00158d000223921b_channel_1 - alias: hall_big_fridge_light_on_from_entrance id: hall_big_fridge_light_on_from_entrance initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d000223921b_action click_type: button_2_single - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001e0784e_action click_type: button_2_single conditions: - condition: numeric_state entity_id: sensor.ha_uptime above: 0 actions: - action: light.toggle entity_id: light.0x00158d000253f04a_channel_2 - alias: hall_big_led_strip_restart id: hall_big_led_strip_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.esp32_strip_1s_wadrobe_hb_rgb state: unavailable for: minutes: 2 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_led_strip_hb_restart_key state: 'on' - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ states('switch.0x00158d00023e5812_outlet')\ \ not in ignore }} \n" actions: - repeat: while: - condition: state entity_id: light.esp32_strip_1s_wadrobe_hb_rgb state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.0x00158d00023e5812_outlet - delay: seconds: 15 - action: switch.turn_on entity_id: switch.0x00158d00023e5812_outlet - action: notify.telegram data: message: 🚨 LED Strip HB restart done({{repeat.index}})! - delay: seconds: 15 - condition: state entity_id: light.esp32_strip_1s_wadrobe_hb_rgb state: unavailable - action: notify.telegram data: message: 🚨 LED Strip HB restart unsuccessful! - action: switch.turn_off entity_id: switch.system_led_strip_hb_restart_key - alias: hall_big_led_strip_restart_key_toggle id: hall_big_led_strip_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.esp32_strip_1s_wadrobe_hb_rgb from: unavailable actions: - action: switch.turn_on entity_id: switch.system_led_strip_hb_restart_key - alias: hall_big_led_strip_entrance_restart id: hall_big_led_strip_entrance_restart initial_state: true mode: single max_exceeded: silent triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.esp32_strip_1s_entrance_hb_rgb state: unavailable for: minutes: 2 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_led_strip_entrance_hb_restart_key state: 'on' - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ states('switch.digma_strip_hb_relay1')\ \ not in ignore }} \n" actions: - repeat: while: - condition: state entity_id: light.esp32_strip_1s_entrance_hb_rgb state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.digma_strip_hb_relay1 - delay: seconds: 15 - action: switch.turn_on entity_id: switch.digma_strip_hb_relay1 - action: notify.telegram data: message: 🚨 LED Strip Entrance HB restart done({{repeat.index}})! - delay: seconds: 15 - condition: state entity_id: light.esp32_strip_1s_entrance_hb_rgb state: unavailable - action: notify.telegram data: message: 🚨 LED Strip Entrance HB restart unsuccessful! - action: switch.turn_off entity_id: switch.system_led_strip_entrance_hb_restart_key - alias: hall_big_led_strip_entrance_restart_key_toggle id: hall_big_led_strip_entrance_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.esp32_strip_1s_entrance_hb_rgb from: unavailable actions: - action: switch.turn_on entity_id: switch.system_led_strip_entrance_hb_restart_key - alias: hall_big_led_entance_manual id: hall_big_led_entance_manual initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0003991051_action conditions: - condition: template value_template: '{{ states(''light.esp32_strip_1s_entrance_hb_rgb'') in [''on'',''off''] }}' actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' }}' sequence: - action: light.toggle entity_id: light.esp32_strip_1s_entrance_hb_rgb - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''double'' }}' sequence: - action: light.turn_on entity_id: light.esp32_strip_1s_entrance_hb_rgb data: brightness: 255 color_temp_kelvin: 5000 - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''hold'' }}' sequence: - action: light.turn_on entity_id: light.esp32_strip_1s_entrance_hb_rgb data: brightness: 40 color_temp_kelvin: 3000 - alias: hall_big_led_strips_timer_on id: hall_big_led_strips_timer_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.esp32_strip_1s_entrance_hb_rgb, light.esp32_strip_1s_wadrobe_hb_rgb to: 'on' from: 'off' conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: timer.cancel entity_id: timer.led_strip_day_hb, timer.led_strip_night_hb - action: timer.start data: entity_id: 'timer.{% if is_state(''binary_sensor.tod_day'',''on'') %}led_strip_day_hb{%else%}led_strip_night_hb{%endif%} ' - alias: hall_big_led_strips_auto_led_off id: hall_big_led_strips_auto_led_off initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.led_strip_day_hb - trigger: event event_type: timer.finished event_data: entity_id: timer.led_strip_night_hb actions: - action: light.turn_off entity_id: light.esp32_strip_1s_entrance_hb_rgb, light.esp32_strip_1s_wadrobe_hb_rgb data: transition: 5 - alias: hall_big_led_strips_timer_restart id: hall_big_led_strips_timer_restart initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001e05856_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b482e9_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001d5995e_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.582d34609600_motion - trigger: state entity_id: binary_sensor.g5_flex_entrance_motion from: 'off' to: 'on' conditions: - condition: state entity_id: group.lights_strips_hb state: 'on' - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.hall_big_led_strips_timer_restart'', ''last_triggered''),0)|int(0)) > 5 }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.tod_day state: 'on' sequence: - action: timer.cancel entity_id: timer.led_strip_day_hb - action: timer.start entity_id: timer.led_strip_day_hb - conditions: - condition: state entity_id: binary_sensor.tod_day state: 'off' sequence: - action: timer.cancel entity_id: timer.led_strip_night_hb - action: timer.start entity_id: timer.led_strip_night_hb - alias: hall_big_main_light_off_with_occupancy id: hall_big_main_light_off_with_occupancy initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.occupancy_hb to: 'off' for: hours: 1 conditions: - condition: state entity_id: group.lights_main_hb state: 'on' actions: - action: light.turn_off entity_id: light.0x00158d000223921b_channel_1, light.0x00158d000253f04a_channel_2 - alias: hall_big_bedside_lamp_restart id: hall_big_bedside_lamp_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.bedside state: unavailable for: minutes: 2 - condition: state entity_id: switch.system_bedside_restart_key state: 'on' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: template value_template: '{% set ignore = [''unknown'', ''unavailable'', ''none''] %} {{ states(''switch.0x00158d00039bd56d_plug'') not in ignore }} ' actions: - repeat: while: - condition: state entity_id: light.bedside state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.0x00158d00039bd56d_plug - delay: seconds: 15 - action: switch.turn_on entity_id: switch.0x00158d00039bd56d_plug - action: notify.telegram data: message: 🚨 Bedside restart done({{repeat.index}})! - delay: seconds: 30 - condition: state entity_id: light.bedside state: unavailable - action: notify.telegram data: message: 🚨 Bedside restart unsuccessful! - action: switch.turn_off entity_id: switch.system_bedside_restart_key - alias: hall_big_bedside_restart_key_toggle id: hall_big_bedside_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.bedside from: unavailable actions: - action: switch.turn_on entity_id: switch.system_bedside_restart_key - alias: hall_small_auto_night_light id: hall_small_auto_night_light initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001ae9f61_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b43ad4_motion - trigger: state entity_id: - binary_sensor.0x00158d00025315e9_contact - binary_sensor.0x00158d0002a14c5e_contact - binary_sensor.0x00158d0001ef2ffc_contact from: 'off' to: 'on' conditions: - condition: state entity_id: light.round_led_k state: 'off' - condition: state entity_id: group.lights_main_hs state: 'off' - condition: state entity_id: binary_sensor.light_outside_mi state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.turn_on entity_id: light.mono_strip_1_light data: brightness: 100 - alias: hall_small_main_lamp_on_single id: hall_small_main_lamp_on_single initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0002a36433_action click_type: button_1_single conditions: - condition: template value_template: '{{ states(''light.round_led_hs'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - if: - condition: state entity_id: binary_sensor.round_led_hs_nightlight state: 'on' - condition: state entity_id: light.round_led_hs state: 'off' then: - action: yeelight.set_mode data: entity_id: light.round_led_hs mode: normal - choose: - conditions: - condition: state entity_id: light.round_led_hs state: 'on' sequence: - action: light.turn_off entity_id: light.round_led_hs - conditions: - condition: state entity_id: light.round_led_hs state: 'off' sequence: - action: light.turn_on entity_id: light.round_led_hs data: brightness: 65 color_temp_kelvin: 5000 - alias: hall_small_main_lamp_on_double id: hall_small_main_lamp_on_double initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0002a36433_action click_type: button_1_double conditions: - condition: template value_template: '{{ states(''light.round_led_k'') in [''on'',''off''] }}' actions: - if: - condition: state entity_id: binary_sensor.round_led_hs_nightlight state: 'on' - condition: state entity_id: light.round_led_hs state: 'off' then: - action: yeelight.set_mode data: entity_id: light.round_led_hs mode: normal - action: light.turn_on entity_id: light.round_led_hs data: brightness: 230 color_temp_kelvin: 5000 - alias: hall_small_main_lamp_restart id: hall_small_main_lamp_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.round_led_hs state: unavailable for: minutes: 2 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_round_led_hs_restart_key state: 'on' - condition: template value_template: '{% set ignore = [''unknown'', ''unavailable'', ''none''] %} {{ states(''switch.0x00158d0002a36433_channel_1'') not in ignore }} ' actions: - repeat: while: - condition: state entity_id: light.round_led_hs state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.0x00158d0002a36433_channel_1 - delay: seconds: 15 - action: switch.turn_on entity_id: switch.0x00158d0002a36433_channel_1 - action: notify.telegram data: message: 🚨 Round LED HS restart done({{repeat.index}})! - delay: seconds: 30 - condition: state entity_id: light.round_led_hs state: unavailable - action: notify.telegram data: message: 🚨 Round LED HS restart unsuccessful! - action: switch.turn_off entity_id: switch.system_round_led_hs_restart_key - alias: hall_small_main_lamp_restart_key_toggle id: hall_small_main_lamp_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.round_led_hs from: unavailable actions: - action: switch.turn_on entity_id: switch.system_round_led_hs_restart_key - alias: hall_small_led_strip_timer_on id: hall_small_led_strip_timer_on initial_state: true triggers: - trigger: state entity_id: light.mono_strip_1_light to: 'on' from: 'off' actions: - action: timer.cancel entity_id: timer.led_strip_night_hs - action: timer.start entity_id: timer.led_strip_night_hs - alias: hall_small_led_strip_auto_led_off id: hall_small_led_strip_auto_led_off initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.led_strip_night_hs actions: - action: light.turn_off entity_id: light.mono_strip_1_light data: transition: 5 - alias: hall_small_led_strip_timer_restart id: hall_small_led_strip_timer_restart initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001ae9f61_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b43ad4_motion conditions: - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.hall_small_led_strip_timer_restart'', ''last_triggered''),0)|int(0)) > 5 }}' - condition: state entity_id: light.mono_strip_1_light state: 'on' actions: - action: timer.cancel entity_id: timer.led_strip_night_hs - action: timer.start entity_id: timer.led_strip_night_hs - alias: hall_small_timer_restart id: hall_small_timer_restart initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b43ad4_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001ae9f61_motion conditions: - condition: template value_template: '{{ not is_state(''light.round_led_hs'', ''off'') }}' - condition: template value_template: '{{(as_timestamp(now()) - as_timestamp(state_attr(''automation.hall_small_timer_restart'', ''last_triggered''),0)|int(0)) > 5 }}' - condition: state entity_id: switch.system_security_mode state: 'off' actions: - action: timer.cancel entity_id: timer.main_light_hs - action: timer.start entity_id: timer.main_light_hs - alias: hall_small_timer_off id: hall_small_timer_off initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.round_led_hs to: 'off' actions: - action: timer.cancel entity_id: timer.main_light_hs - alias: hall_small_timer_on id: hall_small_timer_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.round_led_hs to: 'on' actions: - action: timer.cancel entity_id: timer.main_light_hs - action: timer.start entity_id: timer.main_light_hs - alias: hall_small_auto_light_off id: hall_small_auto_light_off initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.main_light_hs conditions: - condition: state entity_id: binary_sensor.tod_day state: 'on' actions: - action: light.turn_off entity_id: light.round_led_hs data: transition: 15 - alias: hall_small_main_light_off_with_occupancy id: hall_small_main_light_off_with_occupancy initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.occupancy_hs to: 'off' for: hours: 1 conditions: - condition: state entity_id: group.lights_main_hs state: 'on' actions: - action: light.turn_off entity_id: light.round_led_hs, light.mono_strip_1_light data: transition: 15 - alias: kitchen_timer_restart id: kitchen_timer_restart initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b4729d_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b48381_motion - trigger: state entity_id: sensor.0x00158d0002a2412d_action to: - vibration - tilt conditions: - condition: state entity_id: group.lights_main_k state: 'on' - condition: template value_template: '{{(as_timestamp(now()) - as_timestamp(state_attr(''automation.kitchen_timer_restart'', ''last_triggered''),0)|int(0)) > 5 }}' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: timer.cancel entity_id: timer.main_light_k - action: timer.start entity_id: timer.main_light_k - alias: kitchen_timer_off id: kitchen_timer_off initial_state: true triggers: - trigger: state entity_id: light.round_led_k to: 'off' actions: - action: timer.cancel entity_id: timer.main_light_k, timer.main_light_delay_k - action: timer.start entity_id: timer.main_light_delay_k - alias: kitchen_timer_on id: kitchen_timer_on initial_state: true triggers: - trigger: state entity_id: light.round_led_k to: 'on' actions: - action: timer.cancel entity_id: timer.main_light_k - action: timer.start entity_id: timer.main_light_k - action: light.turn_off entity_id: light.esp32_node_k_light, light.mono_strip_1_light data: transition: 5 - alias: kitchen_auto_light_off id: kitchen_auto_light_off initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.main_light_k conditions: - condition: state entity_id: binary_sensor.tod_day state: 'on' - condition: state entity_id: binary_sensor.presence_k state: 'off' actions: - action: light.turn_off entity_id: light.round_led_k data: transition: 15 - action: light.turn_off entity_id: light.d1mini_light_l_led, light.sonoff_mini_4_led, light.esp8266_hood_k_main - alias: kitchen_auto_light_on id: kitchen_auto_light_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b4729d_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b48381_motion conditions: - condition: state entity_id: binary_sensor.tod_day state: 'on' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: group.lights_main_k state: 'off' - condition: state entity_id: binary_sensor.light_outside_mi state: 'off' - condition: state entity_id: timer.main_light_delay_k state: idle - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.turn_on entity_id: light.esp32_node_k_light - alias: kitchen_auto_night_light id: kitchen_auto_night_light initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b4729d_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b48381_motion conditions: - condition: state entity_id: binary_sensor.tod_day state: 'off' - condition: template value_template: '{{ not is_state(''light.esp32_node_k_light'', ''on'') }}' - condition: state entity_id: group.lights_main_k state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{as_timestamp(now())-as_timestamp(state_attr(''automation.hall_small_auto_night_light'', ''last_triggered''),0) < 600 }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.turn_on entity_id: light.esp32_node_k_light data: brightness: 255 - alias: kitchen_main_lamp_restart id: kitchen_main_lamp_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.round_led_k state: unavailable for: minutes: 2 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_round_led_k_restart_key state: 'on' - condition: template value_template: '{% set ignore = [''unknown'', ''unavailable'', ''none''] %} {{ states(''switch.0x00158d0002a36f7f_channel_2'') not in ignore }} ' actions: - repeat: while: - condition: state entity_id: light.round_led_k state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.0x00158d0002a36f7f_channel_2 - delay: seconds: 15 - action: switch.turn_on entity_id: switch.0x00158d0002a36f7f_channel_2 - action: notify.telegram data: message: 🚨 Round LED K restart done({{repeat.index}})! - delay: seconds: 30 - if: - condition: state entity_id: light.round_led_k state: unavailable then: - action: notify.telegram data: message: 🚨 Round LED K restart unsuccessful! - action: switch.turn_off entity_id: switch.system_round_led_k_restart_key else: - action: light.turn_{{ states("binary_sensor.round_led_k_prev") | lower }} entity_id: light.round_led_k - action: switch.turn_on entity_id: switch.system_round_led_k_restart_key - alias: kitchen_main_lamp_restart_key_toggle id: kitchen_main_lamp_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.round_led_k from: unavailable actions: - action: switch.turn_on entity_id: switch.system_round_led_k_restart_key - alias: kitchen_main_lamp_switch_on_if_off id: kitchen_main_lamp_switch_on_if_off initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0002a36f7f_action click_type: button_2_single conditions: - condition: state entity_id: switch.0x00158d0002a36f7f_channel_2 state: 'off' actions: - action: switch.turn_on entity_id: switch.0x00158d0002a36f7f_channel_2 - alias: kitchen_main_lamp_on id: kitchen_main_lamp_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0002a36f7f_action click_type: button_2_single conditions: - condition: template value_template: '{{ states(''light.round_led_k'') in [''on'',''off''] }}' - condition: state entity_id: switch.0x00158d0002a36f7f_channel_2 state: 'on' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.round_led_k_nightlight state: 'on' - condition: state entity_id: light.round_led_k state: 'off' sequence: - action: yeelight.set_mode data: entity_id: light.round_led_k mode: normal - action: light.turn_on entity_id: light.round_led_k data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: state entity_id: binary_sensor.round_led_k_nightlight state: 'off' - condition: state entity_id: light.round_led_k state: 'on' sequence: - action: light.turn_off entity_id: light.round_led_k - delay: 00:00:01 - condition: state entity_id: light.round_led_k state: 'on' - action: light.turn_off entity_id: light.round_led_k - conditions: - condition: state entity_id: light.round_led_k state: 'off' - condition: state entity_id: binary_sensor.round_led_k_nightlight state: 'off' sequence: - action: light.turn_on entity_id: light.round_led_k data: brightness: 230 color_temp_kelvin: 5000 - alias: kitchen_main_lamp_on_full id: kitchen_main_lamp_on_full initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0002a36f7f_action click_type: button_2_double conditions: - condition: template value_template: '{{ states(''light.round_led_k'') in [''on'',''off''] }}' - condition: state entity_id: switch.0x00158d0002a36f7f_channel_2 state: 'on' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - if: - condition: state entity_id: binary_sensor.round_led_k_nightlight state: 'on' - condition: state entity_id: light.round_led_k state: 'off' then: - action: yeelight.set_mode data: entity_id: light.round_led_k mode: normal - action: light.turn_on entity_id: light.round_led_k data: brightness: 230 color_temp_kelvin: 5000 - alias: kitchen_led_strips_timer id: kitchen_led_strips_timer initial_state: true triggers: - trigger: state entity_id: light.esp32_node_k_light to: 'on' actions: - action: timer.cancel entity_id: timer.led_strip_night_k - action: timer.start entity_id: timer.led_strip_night_k - alias: kitchen_led_strip_auto_led_off id: kitchen_led_strip_auto_led_off initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.led_strip_night_k actions: - action: light.turn_off entity_id: light.esp32_node_k_light data: transition: 5 - alias: kitchen_led_strip_timer_restart id: kitchen_led_strip_timer_restart initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b4729d_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b48381_motion - trigger: state entity_id: light.esp32_node_k_light to: 'on' conditions: - condition: state entity_id: light.esp32_node_k_light state: 'on' - condition: state entity_id: binary_sensor.tod_day state: 'off' - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.kitchen_led_strip_timer_restart'', ''last_triggered''),0)|int(0)) > 5 }}' - condition: state entity_id: switch.system_security_mode state: 'off' actions: - action: timer.cancel entity_id: timer.led_strip_night_k - action: timer.start entity_id: timer.led_strip_night_k - alias: kitchen_night_aux_light id: kitchen_night_aux_light initial_state: true triggers: - trigger: state entity_id: light.round_led_k to: 'off' from: 'on' conditions: - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: - light.d1mini_light_l_led - light.sonoff_mini_4_led - light.esp8266_hood_k_main - light.esp32_node_k_light - light.mono_strip_1_light - light.round_led_hs state: 'off' - condition: state entity_id: binary_sensor.light_outside_mi state: 'off' actions: - action: light.turn_on entity_id: light.esp32_node_k_light data: brightness: 255 - action: light.turn_on entity_id: light.mono_strip_1_light data: brightness: 128 - alias: kitchen_main_light_off_with_occupancy id: kitchen_main_light_off_with_occupancy initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.presence_k to: 'off' for: minutes: 15 conditions: - condition: state entity_id: group.lights_main_k state: 'on' actions: - action: light.turn_off entity_id: light.d1mini_light_l_led, light.sonoff_mini_4_led, light.esp8266_hood_k_main - action: light.turn_off entity_id: light.round_led_k data: transition: 15 - alias: master_bedroom_table_lamp id: master_bedroom_table_lamp initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c77cc5f_action conditions: - condition: template value_template: '{{ states(''light.0x54ef441000c88fa8_light'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' or trigger.event.data.click_type == ''button_1_single'' }}' sequence: - action: light.toggle entity_id: light.0x54ef441000c88fa8_light - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''double'' or trigger.event.data.click_type == ''button_1_double'' }}' sequence: - action: light.turn_on entity_id: light.0x54ef441000c88fa8_light data: brightness: 255 color_temp_kelvin: 5000 - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''hold'' or trigger.event.data.click_type == ''button_1_hold'' }}' sequence: - action: light.turn_on entity_id: light.0x54ef441000c88fa8_light data: brightness: 14 color_temp_kelvin: 3000 - alias: master_bedroom_main_lamp_right_button id: master_bedroom_main_lamp_right_button initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d00013e6aa5_action click_type: button_2_single - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c77cc5f_action click_type: button_3_single conditions: - condition: template value_template: '{{ states(''light.round_led_mb'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.round_led_mb_nightlight state: 'on' - condition: state entity_id: light.round_led_mb state: 'off' sequence: - action: yeelight.set_mode data: entity_id: light.round_led_mb mode: normal - action: light.turn_on entity_id: light.round_led_mb data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: state entity_id: light.round_led_mb state: 'off' - condition: state entity_id: binary_sensor.round_led_mb_nightlight state: 'off' sequence: - action: light.turn_on entity_id: light.round_led_mb data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: state entity_id: light.round_led_mb state: 'on' sequence: - action: light.turn_off entity_id: light.round_led_mb - alias: master_bedroom_main_lamp_right_button_full id: master_bedroom_main_lamp_right_button_full initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d00013e6aa5_action click_type: button_2_double conditions: - condition: template value_template: '{{ states(''light.round_led_mb'') in [''on'',''off''] }}' actions: - action: light.turn_on entity_id: light.round_led_mb data: brightness: 230 color_temp_kelvin: 5000 - alias: master_bedroom_main_lamp_left_button id: master_bedroom_main_lamp_left_button initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d00013e6aa5_action click_type: button_1_single - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c77cc5f_action click_type: button_3_double conditions: - condition: template value_template: '{{ states(''light.round_led_mb'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.round_led_mb_nightlight state: 'on' - condition: state entity_id: light.round_led_mb state: 'off' sequence: - action: yeelight.set_mode data: entity_id: light.round_led_mb mode: normal - action: light.turn_on entity_id: light.round_led_mb data: brightness: 77 color_temp_kelvin: 3000 - conditions: - condition: state entity_id: light.round_led_mb state: 'off' - condition: state entity_id: binary_sensor.round_led_mb_nightlight state: 'off' sequence: - action: light.turn_on entity_id: light.round_led_mb data: brightness: 77 color_temp_kelvin: 3000 - conditions: - condition: state entity_id: light.round_led_mb state: 'on' sequence: - action: light.turn_off entity_id: light.round_led_mb - alias: master_bedroom_round_led_restart id: master_bedroom_round_led_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.round_led_mb state: unavailable for: minutes: 2 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_round_led_mb_restart_key state: 'on' - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ states('switch.shelly_1_led_mb')\ \ not in ignore }} \n" actions: - repeat: while: - condition: state entity_id: light.round_led_mb state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.shelly_1_led_mb - delay: seconds: 15 - action: switch.turn_on entity_id: switch.shelly_1_led_mb - action: notify.telegram data: message: 🚨 Round LED MB restart done({{repeat.index}})! - delay: seconds: 30 - condition: state entity_id: light.round_led_mb state: unavailable - action: notify.telegram data: message: 🚨 Round LED MB restart unsuccessful! - action: switch.turn_off entity_id: switch.system_round_led_mb_restart_key - alias: master_bedroom_main_lamp_restart_key_toggle id: master_bedroom_lamp_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.round_led_mb from: unavailable actions: - action: switch.turn_on entity_id: switch.system_round_led_mb_restart_key - alias: master_bedroom_main_lamp_switch_on_if_off id: master_bedroom_main_lamp_switch_on_if_off initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d00013e6aa5_action click_type: button_2_single - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c77cc5f_action click_type: button_3_single conditions: - condition: state entity_id: switch.shelly_1_led_mb state: 'off' actions: - action: switch.turn_on entity_id: switch.shelly_1_led_mb - alias: master_bedroom_timer_restart id: master_bedroom_timer_restart initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001e53cda_motion conditions: - condition: state entity_id: light.round_led_mb state: 'on' actions: - action: timer.cancel entity_id: timer.main_light_mb - action: timer.start entity_id: timer.main_light_mb - alias: master_bedroom_timer_off id: master_bedroom_timer_off initial_state: true triggers: - trigger: state entity_id: light.round_led_mb to: 'off' from: 'on' actions: - action: timer.cancel entity_id: timer.main_light_mb - alias: master_bedroom_timer_on id: master_bedroom_timer_on initial_state: true triggers: - trigger: state entity_id: light.round_led_mb to: 'on' from: 'off' actions: - action: timer.cancel entity_id: timer.main_light_mb - action: timer.start entity_id: timer.main_light_mb - alias: master_bedroom_led_strip_bookshelf_control id: master_bedroom_led_strip_bookshelf_control initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c77cc5f_action conditions: - condition: template value_template: '{{ states(''light.esp32_strip_1s_bookshelf_mb_rgb'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: numeric_state entity_id: sensor.ha_uptime above: 0 actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' or trigger.event.data.click_type == ''button_4_single'' }}' sequence: - action: light.toggle entity_id: light.esp32_strip_1s_bookshelf_mb_rgb - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''double'' or trigger.event.data.click_type == ''button_4_double'' }}' sequence: - action: light.turn_on data: entity_id: light.esp32_strip_1s_bookshelf_mb_rgb brightness: 255 rgb_color: - 255 - 159 - 70 - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''hold'' or trigger.event.data.click_type == ''button_4_hold'' }}' sequence: - action: light.turn_on data: entity_id: light.esp32_strip_1s_bookshelf_mb_rgb brightness: 15 rgb_color: - 250 - 95 - 85 - alias: master_bedroom_led_strip_wadrobe_control id: master_bedroom_led_strip_wadrobe_control initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c77cc5f_action conditions: - condition: template value_template: '{{ states(''light.esp32_strip_1s_wadrobe_mb_rgb'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: numeric_state entity_id: sensor.ha_uptime above: 0 actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' or trigger.event.data.click_type == ''button_2_single'' }}' sequence: - action: light.toggle entity_id: light.esp32_strip_1s_wadrobe_mb_rgb - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''double'' or trigger.event.data.click_type == ''button_2_double'' }}' sequence: - action: light.turn_on data: entity_id: light.esp32_strip_1s_wadrobe_mb_rgb brightness: 255 rgb_color: - 255 - 159 - 70 - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''hold'' or trigger.event.data.click_type == ''button_2_hold'' }}' sequence: - action: light.turn_on data: entity_id: light.esp32_strip_1s_wadrobe_mb_rgb brightness: 15 rgb_color: - 250 - 95 - 85 - alias: master_bedroom_main_light_off_with_occupancy id: master_bedroom_main_light_off_with_occupancy initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.presence_mb to: 'off' for: minutes: 15 conditions: - condition: state entity_id: group.lights_mb state: 'on' actions: - action: light.turn_off entity_id: light.round_led_mb_ambilight, light.0x54ef441000c88fa8_light, light.esp32_strip_1s_wadrobe_mb_rgb, light.esp32_strip_1s_bookshelf_mb_rgb data: transition: 15 - action: light.turn_off entity_id: light.round_led_mb data: transition: 15 - alias: master_bedroom_main_power_turned_off id: master_bedroom_main_power_turned_off initial_state: true triggers: - trigger: state entity_id: switch.0x00158d0002467773_outlet to: 'off' from: 'on' actions: - action: notify.telegram data: message: 🔌 Внимание! Вторая розетка отключена! Запущен UPS (1050) - alias: master_bedroom_main_plug_pulled_out id: master_bedroom_main_plug_pulled_out initial_state: true triggers: - trigger: numeric_state entity_id: sensor.0x00158d0002467773_power below: 10 actions: - action: notify.telegram data: message: 🔌 Внимание! Нагрузка во второй розетке упала! Проверь кабель! - alias: master_bedroom_main_power_overpower id: master_bedroom_main_power_overpower initial_state: true triggers: - trigger: numeric_state entity_id: sensor.0x00158d0002467773_power above: 1700 actions: - action: notify.telegram data: message: 🔌 Внимание! Перегрузка второй розетки! Отключите лишние потребители! - alias: master_bedroom_ups_ob id: master_bedroom_ups_ob initial_state: true triggers: - trigger: state entity_id: sensor.ippon_1050_status_data to: OB actions: - parallel: - action: notify.telegram data: message: 🔋 Внимание! Запущен UPS (1050)! - action: notify.mobile_app_iphone_16_pro_dima data: title: Внимание! message: Запущен UPS (1050) - alias: master_bedroom_ups_lb id: master_bedroom_ups_lb initial_state: true triggers: - trigger: state entity_id: sensor.ippon_1050_status_data to: LB actions: - parallel: - action: notify.telegram data: message: 🚨 Внимание! Заряд батареи (1050) критический! Завершение работы NUC! - action: notify.mobile_app_iphone_16_pro_dima data: title: Внимание! message: UPS полностью разряжен! Завершаем работу NUC! data: push: sound: name: default critical: 1 volume: 1.0 - alias: master_bedroom_ups_ol id: master_bedroom_ups_ol initial_state: true triggers: - trigger: state entity_id: sensor.ippon_1050_status_data to: OL conditions: - condition: template value_template: '{{ trigger.from_state.state not in [''unknown'',''unavailable'',''none''] }}' actions: - action: notify.telegram data: message: 🔋 Питание восстановлено! Начинаем заряд батареи(1050)! - alias: master_bedroom_ups_unknown id: master_bedroom_ups_unknown initial_state: true triggers: - trigger: state entity_id: sensor.ippon_1050_status_data to: unknown for: minutes: 5 conditions: - condition: template value_template: '{{ trigger.from_state.state not in [''unknown'',''unavailable'',''none''] }}' actions: - action: notify.telegram data: message: 🚨 Внимание! Связь с UPS(1050) потеряна! - alias: master_bedroom_main_power_turned_on id: master_bedroom_main_power_turned_on initial_state: true triggers: - trigger: state entity_id: switch.0x00158d0002467773_outlet to: 'on' from: 'off' actions: - action: notify.telegram data: message: 🔌 Электроснабжение восстановлено! Начинаем зарядку UPS(1050)! - alias: sasha_breather_auto_co2 id: sasha_breather_auto_co2 initial_state: true triggers: - trigger: time_pattern minutes: /3 conditions: - condition: state entity_id: switch.system_breather_auto_s state: 'on' - condition: not conditions: - condition: state entity_id: switch.system_breather_manual_s state: 'on' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.0x00158d00025370d1_contact state: 'off' - condition: numeric_state entity_id: sensor.esp32_node_s_co2 above: input_number.co2_high_limit - condition: state entity_id: binary_sensor.breather_s state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: numeric_state entity_id: sensor.0x00158d0001e6d85a_temperature above: 20 sequence: - action: fan.turn_on entity_id: fan.breather_s - condition: numeric_state entity_id: sensor.esp32_node_s_co2 above: input_number.co2_high_limit - condition: state entity_id: switch.system_breather_auto_speed_s state: 'on' - action: fan.set_percentage entity_id: fan.breather_s data: percentage: '{{states(''sensor.breather_set_speed_s'')|int(0) }}' - conditions: - condition: state entity_id: binary_sensor.0x00158d00025370d1_contact state: 'off' - condition: numeric_state entity_id: sensor.esp32_node_s_co2 above: input_number.co2_high_limit - condition: state entity_id: binary_sensor.breather_s state: 'on' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: switch.system_breather_auto_speed_s state: 'on' - condition: numeric_state entity_id: sensor.breather_set_speed_s above: 0 sequence: - action: fan.set_percentage entity_id: fan.breather_s data: percentage: '{{states(''sensor.breather_set_speed_s'')|int(0) }}' - conditions: - or: - and: - condition: state entity_id: binary_sensor.0x00158d00025370d1_contact state: 'off' - condition: numeric_state entity_id: sensor.esp32_node_s_co2 below: input_number.co2_low_limit - condition: state entity_id: binary_sensor.breather_s state: 'on' - and: - or: - condition: numeric_state entity_id: sensor.0x00158d0001e6d85a_temperature below: 20 - condition: state entity_id: binary_sensor.0x00158d00025370d1_contact state: 'on' - condition: state entity_id: binary_sensor.breather_s state: 'on' sequence: - action: fan.turn_off entity_id: fan.breather_s - alias: sasha_breather_auto_timer id: sasha_breather_auto_timer initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Выключи вентиляцию id: to_off_alice - trigger: event event_type: yandex_intent event_data: text: Включи вентиляцию id: to_on_alice - trigger: time at: '21:00:00' id: time_trigger_night - trigger: time at: 09:00:00 id: time_trigger_day conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: trigger id: to_off_alice sequence: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_s'' }}' - if: - condition: state entity_id: binary_sensor.breather_s state: 'on' then: - action: fan.turn_off entity_id: fan.breather_s - action: switch.turn_on entity_id: switch.system_breather_auto_s - conditions: - condition: trigger id: to_on_alice sequence: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_s'' }}' - if: - condition: state entity_id: binary_sensor.breather_s state: 'off' then: - action: switch.turn_on entity_id: switch.system_breather_manual_s - action: fan.turn_on entity_id: fan.breather_s - conditions: - condition: trigger id: time_trigger_night sequence: - action: switch.turn_on entity_id: switch.system_breather_manual_s - action: fan.set_percentage entity_id: fan.breather_s data: percentage: 25 - conditions: - condition: trigger id: time_trigger_day sequence: - action: fan.turn_off entity_id: fan.breather_s - alias: sasha_breather_switches_interlock id: sasha_breather_switches_interlock triggers: - trigger: state entity_id: - switch.system_breather_auto_s - switch.system_breather_manual_s conditions: - condition: template value_template: '{{ trigger.to_state.state == ''on'' }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: homeassistant.turn_off target: entity_id: '{% if trigger.from_state.entity_id == ''switch.system_breather_auto_s'' %} {{ ''switch.system_breather_manual_s'' }} {% else %} {{ ''switch.system_breather_auto_s'' }} {% endif %}' - alias: sasha_breather_switches_default id: sasha_breather_switches_default triggers: - trigger: template value_template: '{{ is_state(''switch.system_breather_auto_s'',''off'') and is_state(''switch.system_breather_manual_s'',''off'') }}' conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: switch.turn_on entity_id: switch.system_breather_auto_s - alias: sasha_led_white_control id: sasha_led_white_control initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c77d831_action conditions: - condition: template value_template: '{{ states(''light.0x54ef441000d54c6c_light'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' or trigger.event.data.click_type == ''button_1_single''}}' sequence: - action: light.toggle entity_id: light.0x54ef441000d54c6c_light - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''double'' or trigger.event.data.click_type == ''button_1_double'' }}' sequence: - action: light.turn_on entity_id: light.0x54ef441000d54c6c_light data: brightness: 255 color_temp_kelvin: 5000 - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''hold'' or trigger.event.data.click_type == ''button_1_hold'' }}' sequence: - action: light.turn_on entity_id: light.0x54ef441000d54c6c_light data: brightness: 14 color_temp_kelvin: 3000 - alias: sasha_main_lamp_left_button id: sasha_main_lamp_left_button initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d00026eb820_action click_type: button_1_single conditions: - condition: template value_template: '{{ states(''light.square_led_s'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - if: - condition: state entity_id: binary_sensor.square_led_s_nightlight state: 'on' - condition: state entity_id: light.square_led_s state: 'off' then: - action: yeelight.set_mode data: entity_id: light.square_led_s mode: normal - choose: - conditions: - condition: state entity_id: light.square_led_s state: 'on' sequence: - action: light.turn_off entity_id: light.square_led_s - conditions: - condition: state entity_id: light.square_led_s state: 'off' sequence: - action: light.turn_on entity_id: light.square_led_s data: brightness: 230 color_temp_kelvin: 5000 - alias: sasha_main_lamp_right_button id: sasha_main_lamp_right_button initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d00026eb820_action click_type: button_2_single conditions: - condition: template value_template: '{{ states(''light.square_led_s'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - if: - condition: state entity_id: binary_sensor.square_led_s_nightlight state: 'on' - condition: state entity_id: light.square_led_s state: 'off' then: - action: yeelight.set_mode data: entity_id: light.square_led_s mode: normal - choose: - conditions: - condition: state entity_id: light.square_led_s state: 'on' sequence: - action: light.turn_off entity_id: light.square_led_s - conditions: - condition: state entity_id: light.square_led_s state: 'off' sequence: - action: light.turn_on entity_id: light.square_led_s data: brightness: 14 color_temp_kelvin: 3000 - alias: sasha_table_lamp_off_night_mode_main_on id: sasha_table_lamp_off_night_mode_main_on initial_state: true triggers: - trigger: state entity_id: light.0x54ef441000d54c6c_light to: null - trigger: homeassistant event: start - trigger: event event_type: automation_reloaded conditions: - condition: template value_template: '{{state_attr(''light.0x54ef441000d54c6c_light'',''brightness'')|int(0) < 10}}' - condition: state entity_id: light.square_led_s state: 'on' - condition: state entity_id: light.0x54ef441000d54c6c_light state: 'on' - condition: state entity_id: binary_sensor.tod_day state: 'on' actions: - action: light.turn_off entity_id: light.0x54ef441000d54c6c_light - alias: sasha_night_auto_off_30m id: sasha_night_auto_off_30m initial_state: true triggers: - trigger: state entity_id: binary_sensor.motion_s from: 'on' to: 'off' for: minutes: 30 conditions: - condition: state entity_id: binary_sensor.tod_day state: 'off' actions: - action: light.turn_off entity_id: light.0x54ef441000d54c6c_light data: transition: 5 - alias: sasha_square_led_restart id: sasha_square_led_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.square_led_s state: unavailable for: minutes: 2 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_square_led_s_restart_key state: 'on' - condition: template value_template: '{% set ignore = [''unknown'', ''unavailable'', ''none''] %} {{ states(''switch.shelly_1_led_s'') not in ignore }} ' actions: - repeat: while: - condition: state entity_id: light.square_led_s state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.shelly_1_led_s - delay: seconds: 15 - action: switch.turn_on entity_id: switch.shelly_1_led_s - action: notify.telegram data: message: 🚨 Square LED S restart done({{repeat.index}})! - delay: seconds: 30 - condition: state entity_id: light.square_led_s state: unavailable - action: notify.telegram data: message: 🚨 Square LED S restart unsuccessful! - action: switch.turn_off entity_id: switch.system_square_led_s_restart_key - alias: sasha_square_led_restart_key_toggle id: sasha_square_led_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.square_led_s from: unavailable actions: - action: switch.turn_on entity_id: switch.system_square_led_s_restart_key - alias: sasha_main_lamp_switch_on_if_off id: sasha_main_lamp_switch_on_if_off initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d00026eb820_action conditions: - condition: state entity_id: switch.shelly_1_led_s state: 'off' actions: - action: switch.turn_on entity_id: switch.shelly_1_led_s - alias: sasha_timer_restart id: sasha_timer_restart initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d000224f89f_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0003140824_motion conditions: - condition: state entity_id: light.square_led_s state: 'on' - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.sasha_timer_restart'', ''last_triggered''),0)|int(0)) > 15 }}' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: timer.cancel entity_id: timer.main_light_s - action: timer.start entity_id: timer.main_light_s - alias: sasha_timer_off id: sasha_timer_off initial_state: true triggers: - trigger: state entity_id: light.square_led_s to: 'off' from: 'on' actions: - action: timer.cancel entity_id: timer.main_light_s - alias: sasha_timer_on id: sasha_timer_on initial_state: true triggers: - trigger: state entity_id: light.square_led_s to: 'on' from: 'off' conditions: - condition: state entity_id: switch.system_security_mode state: 'off' actions: - action: timer.cancel entity_id: timer.main_light_s - action: timer.start entity_id: timer.main_light_s - alias: sasha_auto_light_off id: sasha_auto_light_off initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.main_light_s conditions: - condition: state entity_id: binary_sensor.tod_day state: 'on' actions: - action: light.turn_off entity_id: light.square_led_s data: transition: 5 - alias: sasha_led_strip_control id: sasha_led_strip_control initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c77d831_action conditions: - condition: template value_template: '{{ states(''light.esp32_node_s_led'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' or trigger.event.data.click_type == ''button_2_single'' }}' sequence: - action: light.turn_on data: entity_id: light.esp32_node_s_led effect: '{{ (["Random", "Rainbow", "Color Wipe", "Scan", "Twinkle", "Random Twinkle"] | random) }}' - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''double'' or trigger.event.data.click_type == ''button_2_double'' }}' sequence: - action: light.turn_on data: entity_id: light.esp32_node_s_led effect: Color Wipe - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''hold'' or trigger.event.data.click_type == ''button_2_hold'' }}' sequence: - action: light.turn_off entity_id: light.esp32_node_s_led data: transition: 5 - alias: sasha_light_off_with_occupancy id: sasha_light_off_with_occupancy initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.presence_s to: 'off' for: minutes: 15 conditions: - condition: state entity_id: group.lights_s state: 'on' actions: - action: light.turn_off entity_id: light.square_led_s, light.esp32_node_s_led, light.0x54ef441000d54c6c_light, light.0x54ef4410000ea59b_light, light.light_bar_s, light.light_bar_s_ambilight data: transition: 15 - alias: sasha_main_light_control_with_alice id: sasha_main_light_control_with_alice initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Выключи свет в Сашиной комнате id: to_off_alice - trigger: event event_type: yandex_intent event_data: text: Включи свет в Сашиной комнате id: to_on_alice conditions: - condition: template value_template: '{{ states(''light.square_led_s'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: trigger id: to_off_alice sequence: - action: light.turn_off entity_id: light.square_led_s - conditions: - condition: trigger id: to_on_alice sequence: - action: light.turn_on entity_id: light.square_led_s data: brightness: 230 color_temp_kelvin: 5000 - alias: sasha_light_bar_restart id: sasha_light_bar_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.light_bar_s state: unavailable for: minutes: 2 - condition: state entity_id: switch.system_light_bar_s_restart_key state: 'on' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: template value_template: '{% set ignore = [''unknown'', ''unavailable'', ''none''] %} {{ states(''switch.sp111_socket_1_relay'') not in ignore }} ' actions: - repeat: while: - condition: state entity_id: light.light_bar_s state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.sp111_socket_1_relay - delay: seconds: 15 - action: switch.turn_on entity_id: switch.sp111_socket_1_relay - action: notify.telegram data: message: 🚨 Light Bar S restart done({{repeat.index}})! - delay: seconds: 30 - condition: state entity_id: light.light_bar_s state: unavailable - action: notify.telegram data: message: 🚨 Light Bar S restart unsuccessful! - action: switch.turn_off entity_id: switch.system_light_bar_s_restart_key - alias: sasha_light_bar_s_restart_key_toggle id: sasha_light_bar_s_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.light_bar_s from: unavailable actions: - action: switch.turn_on entity_id: switch.system_light_bar_s_restart_key - alias: storage_auto_light_on id: storage_auto_light_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001aea602_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0003f27ce2_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.582d34609552_motion conditions: - condition: state entity_id: timer.main_light_delay_st state: idle - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: group.lights_st state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.turn_on data: entity_id: '{%if is_state(''binary_sensor.tod_day'',''on'') and is_state(''switch.system_dark_mode'',''off'') %}light.0x54ef441000680083_channel_2,light.round_led_st {%elif is_state(''binary_sensor.tod_day'',''off'') or is_state(''switch.system_dark_mode'',''on'') %}light.round_led_st {%endif%}' - alias: storage_light_on id: storage_light_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.0x00158d0002a1b0c8_contact from: 'off' to: 'on' for: seconds: 1 - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c79546c_action click_type: button_2_single conditions: - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: group.lights_st state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.turn_on data: entity_id: '{%if is_state(''binary_sensor.tod_day'',''on'') and is_state(''switch.system_dark_mode'',''off'') %}light.0x54ef441000680083_channel_2,light.round_led_st {%elif is_state(''binary_sensor.tod_day'',''off'') or is_state(''switch.system_dark_mode'',''on'') %}light.round_led_st {%endif%}' - alias: storage_main_light_full_on id: storage_main_light_full_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c79546c_action click_type: button_2_double conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.turn_on entity_id: light.0x54ef441000680083_channel_2, light.round_led_st - alias: storage_light_off id: storage_light_off initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.main_light_st - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c79546c_action click_type: button_2_single - trigger: state entity_id: binary_sensor.0x00158d0002a1b0c8_contact from: 'on' to: 'off' for: seconds: 1 - trigger: state entity_id: binary_sensor.dced838ea54e_occupancy from: 'on' to: 'off' conditions: - condition: state entity_id: group.lights_st state: 'on' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.turn_off entity_id: light.0x54ef441000680083_channel_2,light.round_led_st - action: timer.cancel entity_id: timer.main_light_st - alias: storage_timer_start id: storage_timer_start initial_state: true mode: single max_exceeded: silent triggers: - trigger: template value_template: '{{ is_state(''light.0x54ef441000680083_channel_2'',''on'') or is_state(''light.round_led_st'',''on'')}}' conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: timer.cancel entity_id: timer.main_light_st - action: timer.start entity_id: timer.main_light_st - alias: storage_timer_restart id: storage_timer_restart initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001aea602_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0003f27ce2_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.54ef44c65722_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.582d34609552_motion conditions: - condition: state entity_id: group.lights_st state: 'on' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: timer.cancel entity_id: timer.main_light_st - action: timer.start entity_id: timer.main_light_st - alias: storage_timer_off id: storage_timer_off initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.0x54ef441000680083_channel_2, light.round_led_st to: 'off' from: 'on' conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: timer.cancel entity_id: timer.main_light_st - action: timer.cancel entity_id: timer.main_light_delay_st - action: timer.start entity_id: timer.main_light_delay_st - action: light.turn_off entity_id: light.round_led_st - alias: storage_night_off id: storage_night_off initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c79546c_action click_type: button_1_single conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.turn_off target: entity_id: - light.esp32_node_k_light - light.mono_strip_1_light - light.0x54ef441000680083_channel_2 - light.round_led_st - light.esp32_strip_1s_wadrobe_hb_rgb - light.esp32_strip_1s_entrance_hb_rgb - light.mirror_light_b - alias: storage_light_dark_mode_on id: storage_light_dark_mode_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c79546c_action click_type: button_1_double - trigger: state entity_id: binary_sensor.lullaby to: 'on' conditions: - condition: state entity_id: switch.system_dark_mode state: 'off' - condition: state entity_id: binary_sensor.tod_day state: 'on' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: switch.turn_on entity_id: switch.system_dark_mode - alias: storage_light_dark_mode_off id: storage_light_dark_mode_off initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x04cf8cdf3c79546c_action click_type: button_1_double - trigger: state entity_id: light.0x00158d000223921b_channel_1, light.0x00158d000253f04a_channel_2 from: 'off' to: 'on' for: seconds: 10 conditions: - condition: state entity_id: switch.system_dark_mode state: 'on' actions: - action: switch.turn_off entity_id: switch.system_dark_mode - alias: storage_light_off_with_occupancy id: storage_light_off_with_occupancy initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.presence_st to: 'off' for: minutes: 15 conditions: - condition: state entity_id: group.lights_st state: 'on' actions: - action: light.turn_off entity_id: light.0x54ef441000680083_channel_2,light.round_led_st - alias: storage_night_light_toggle id: storage_night_light_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x54ef441000680083_action click_type: button_1_single conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.toggle entity_id: light.round_led_st - alias: storage_round_led_restart id: storage_round_led_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.round_led_st state: unavailable for: minutes: 2 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_round_led_st_restart_key state: 'on' - condition: template value_template: '{% set ignore = [''unknown'', ''unavailable'', ''none''] %} {{ states(''switch.sonoff_basic_2_relay'') not in ignore }} ' actions: - repeat: while: - condition: state entity_id: light.round_led_st state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.sonoff_basic_2_relay - delay: seconds: 15 - action: switch.turn_on entity_id: switch.sonoff_basic_2_relay - action: notify.telegram data: message: 🚨 Round LED St restart done({{repeat.index}})! - delay: seconds: 30 - condition: state entity_id: light.round_led_st state: unavailable - action: notify.telegram data: message: 🚨 Round LED St restart unsuccessful! - action: switch.turn_off entity_id: switch.system_round_led_st_restart_key - alias: storage_round_led_restart_key_toggle id: storage_round_led_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.round_led_st from: unavailable actions: - action: switch.turn_on entity_id: switch.system_round_led_st_restart_key - alias: system_breather_control_user id: system_breather_control_user initial_state: true mode: parallel triggers: - trigger: state entity_id: fan.breather_mb to: 'off' id: id_state_mb - trigger: state entity_id: fan.breather_s to: 'off' id: id_state_s conditions: - condition: state entity_id: switch.system_security_mode state: 'off' actions: - choose: - conditions: - condition: trigger id: id_state_mb sequence: - action: switch.turn_off entity_id: switch.system_breather_manual_mb - conditions: - condition: trigger id: id_state_s sequence: - action: switch.turn_off entity_id: switch.system_breather_manual_s - alias: system_light_control id: system_light_control initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Включи свет id: to_on_alice conditions: - condition: state entity_id: switch.system_security_mode state: 'off' actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_mb'' }}' - condition: trigger id: to_on_alice sequence: - action: light.turn_on entity_id: light.round_led_mb data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_s'' }}' sequence: - action: light.turn_on entity_id: light.square_led_s data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_v'' }}' sequence: - action: light.turn_on entity_id: light.square_led_v data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_k'' }}' - condition: trigger id: to_on_alice sequence: - action: light.turn_on entity_id: light.round_led_k data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_hb'' }}' sequence: - action: light.turn_on entity_id: light.0x00158d000223921b_channel_1 - conditions: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_b'' }}' sequence: - action: light.turn_on entity_id: light.0x00158d0002a36433_channel_2 - conditions: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_k'' }}' - condition: trigger id: to_off_alice sequence: - action: light.turn_off entity_id: group.lights_k - alias: system_presence_dima id: system_presence_dima triggers: - trigger: state entity_id: person.dima not_from: home to: home for: seconds: 5 id: to_just_arrived - trigger: state entity_id: input_select.dima_status_dropdown to: Just Arrived for: minutes: 3 id: to_home - trigger: state entity_id: person.dima from: home for: seconds: 5 id: to_just_left - trigger: state entity_id: input_select.dima_status_dropdown to: Just Left for: minutes: 3 id: to_away - trigger: state entity_id: input_select.dima_status_dropdown to: Away for: hours: 6 id: to_extended_away actions: - action: input_select.select_option data: entity_id: input_select.dima_status_dropdown option: '{{ trigger.id | replace(''to_'', '''', 1) | replace(''_'', '' '') | title }}' - alias: system_presence_sandra id: system_presence_sandra triggers: - trigger: state entity_id: person.sandra not_from: home to: home for: seconds: 5 id: to_just_arrived - trigger: state entity_id: input_select.sandra_status_dropdown to: Just Arrived for: minutes: 3 id: to_home - trigger: state entity_id: person.sandra from: home for: seconds: 5 id: to_just_left - trigger: state entity_id: input_select.sandra_status_dropdown to: Just Left for: minutes: 3 id: to_away - trigger: state entity_id: input_select.sandra_status_dropdown to: Away for: hours: 6 id: to_extended_away actions: - action: input_select.select_option data: entity_id: input_select.sandra_status_dropdown option: '{{ trigger.id | replace(''to_'', '''', 1) | replace(''_'', '' '') | title }}' - alias: system_presence_vova id: system_presence_vova triggers: - trigger: state entity_id: person.vova not_from: home to: home for: seconds: 5 id: to_just_arrived - trigger: state entity_id: input_select.vova_status_dropdown to: Just Arrived for: minutes: 3 id: to_home - trigger: state entity_id: person.vova from: home for: seconds: 5 id: to_just_left - trigger: state entity_id: input_select.vova_status_dropdown to: Just Left for: minutes: 3 id: to_away - trigger: state entity_id: input_select.vova_status_dropdown to: Away for: hours: 6 id: to_extended_away actions: - action: input_select.select_option data: entity_id: input_select.vova_status_dropdown option: '{{ trigger.id | replace(''to_'', '''', 1) | replace(''_'', '' '') | title }}' - alias: system_presence_sasha id: system_presence_sasha triggers: - trigger: state entity_id: person.sasha not_from: home to: home for: seconds: 5 id: to_just_arrived - trigger: state entity_id: input_select.sasha_status_dropdown to: Just Arrived for: minutes: 3 id: to_home - trigger: state entity_id: person.sasha from: home for: seconds: 5 id: to_just_left - trigger: state entity_id: input_select.sasha_status_dropdown to: Just Left for: minutes: 3 id: to_away - trigger: state entity_id: input_select.sasha_status_dropdown to: Away for: hours: 6 id: to_extended_away actions: - action: input_select.select_option data: entity_id: input_select.sasha_status_dropdown option: '{{ trigger.id | replace(''to_'', '''', 1) | replace(''_'', '' '') | title }}' - alias: system_presence_vova_at_home id: system_presence_vova_at_home initial_state: true triggers: - trigger: state entity_id: person.vova to: home for: minutes: 3 actions: - action: notify.telegram data: message: 👱 Вова дома - alias: system_presence_sandra_at_home id: system_presence_sandra_at_home initial_state: true triggers: - trigger: state entity_id: person.sandra to: home for: minutes: 3 actions: - action: notify.telegram data: message: 👧 Саша дома - alias: system_sasha_tracker id: system_sasha_tracker initial_state: true triggers: - trigger: state entity_id: input_boolean.sasha_tracker actions: - action: device_tracker.see data: dev_id: sasha location_name: '{% if is_state(''input_boolean.sasha_tracker'',''on'')%}home{%else%}not_home{%endif%}' - alias: system_guest_tracker id: system_guest_tracker initial_state: true triggers: - trigger: state entity_id: switch.system_guest_mode conditions: - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ trigger.from_state.state\ \ not in ignore and\n trigger.to_state.state not in ignore and\n trigger.to_state.state\ \ = trigger.from_state.state }}\n" actions: - action: device_tracker.see data: dev_id: guest location_name: '{% if is_state(''switch.system_guest_mode'',''on'')%}home{%else%}not_home{%endif%}' - alias: system_sasha_audio_tts id: system_sasha_audio_tts initial_state: true triggers: - trigger: state entity_id: input_boolean.sasha_tracker conditions: - condition: state entity_id: binary_sensor.tod_day state: 'on' - condition: state entity_id: switch.system_dark_mode state: 'off' actions: - action: media_player.volume_set data: entity_id: - media_player.yandex_hb volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: media_player.yandex_hb media_content_id: '{% set name1 = [''С+аша, '',''Сан+ёк, '',''Алекс+андр, '',''М+итрич, '',''Алекс+андр Дм+итриевич, '', ''М+аленький хоз+яин, '', ''З+аяц, '', ''Зайка, ''] | random %} {% set greet2 = [''пок+а'',''до свид+ания'',''до встр+ечи'',''чава-как+ава'',''всег+о хор+ошего'', ''я б+уду скуч+ать''] | random %} {% set greet1 = [''прив+ет'',''здар+ова'',''здр+авствуй'',''здр+авия жел+аю'',''сал+ют'','' Ур+а Ур+а Ты верн+улся дом+ой''] | random %} {{name1}} {% if is_state(''input_boolean.sasha_tracker'',''on'')%}{{greet1}}{%else%}{{greet2}}{%endif%}' - action: notify.telegram data: message: Фотография data: photo: - url: secret entrance_snap caption: 👶 Санек {%if is_state('input_boolean.sasha_tracker','on')%}дома{%else%}уходит{%endif%} - alias: system_presence_sergey_at_home id: system_presence_sergey_at_home initial_state: true triggers: - trigger: state entity_id: person.sergey to: home from: not_home actions: - action: notify.telegram data: message: 👴 Сережа пришел - alias: system_presence_lena_at_home id: system_presence_lena_at_home initial_state: true triggers: - trigger: state entity_id: person.elena to: home from: not_home actions: - action: notify.telegram data: message: 👱 Лена пришла - alias: system_presence_mama_at_home id: system_presence_mama_at_home initial_state: true triggers: - trigger: state entity_id: person.natasha to: home from: not_home actions: - action: notify.telegram data: message: 👱 Мама пришла - alias: system_presence_papa_at_home id: system_presence_papa_at_home initial_state: true triggers: - trigger: state entity_id: person.vasya to: home from: not_home actions: - action: notify.telegram data: message: 👱 Папа пришел - alias: toilet_fan_on id: toilet_fan_on initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001b97111_action click_type: single conditions: - condition: state entity_id: group.lights_t state: 'on' - condition: state entity_id: fan.esp32_node_b_fan_t state: 'off' - condition: state entity_id: switch.esp32_node_b_fan_b_manual_mode state: 'off' actions: - action: fan.turn_off entity_id: fan.esp32_node_b_fan_b - action: fan.turn_on entity_id: fan.esp32_node_b_fan_t - alias: toilet_fan_off id: toilet_fan_off initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001b97111_action click_type: single - trigger: event event_type: timer.finished event_data: entity_id: timer.fan_t - trigger: event event_type: timer.finished event_data: entity_id: timer.short_fan_t conditions: - condition: state entity_id: fan.esp32_node_b_fan_t state: 'on' actions: - action: fan.turn_off entity_id: fan.esp32_node_b_fan_t - action: timer.cancel entity_id: timer.fan_t - alias: toilet_fan_timer_on id: toilet_fan_timer_on initial_state: true triggers: - trigger: state entity_id: fan.esp32_node_b_fan_t to: 'on' actions: - action: timer.cancel entity_id: timer.fan_t - action: timer.start entity_id: timer.fan_t - alias: toilet_fan_timer_restart id: toilet_fan_timer_restart initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001e54280_motion conditions: - condition: state entity_id: binary_sensor.0x00158d000232ddd6_contact state: 'on' - condition: state entity_id: fan.esp32_node_b_fan_t state: 'on' - condition: template value_template: '{{(as_timestamp(now()) - as_timestamp(state_attr(''automation.toilet_fan_timer_restart'', ''last_triggered''),0)|int(0)) > 10 }}' actions: - action: timer.cancel entity_id: timer.fan_t - action: timer.start entity_id: timer.fan_t - alias: toilet_fan_auto id: toilet_fan_auto initial_state: true triggers: - trigger: time_pattern minutes: /30 conditions: - condition: state entity_id: input_boolean.auto_fan_t state: 'on' - condition: state entity_id: switch.esp32_node_b_fan_b_manual_mode state: 'off' - condition: state entity_id: fan.esp32_node_b_fan_t state: 'off' - condition: state entity_id: timer.fan_b state: idle - condition: template value_template: '{{(as_timestamp(now())|int(0) - as_timestamp(states.fan.esp32_node_b_fan_t.last_changed)|int(0) ) > 20*60 }}' - condition: template value_template: '{{not (6>=now().hour|int(0) >=0 or is_state(''switch.system_security_mode'',''on'') or (is_state(''binary_sensor.0x00158d0001ef2ffc_contact'',''on'') and (as_timestamp(now())-as_timestamp(states.binary_sensor[''0x00158d0001ef2ffc_contact''].last_changed) > 10*60)))}}' actions: - action: fan.turn_off entity_id: fan.esp32_node_b_fan_b - action: fan.turn_on entity_id: fan.esp32_node_b_fan_t - alias: toilet_light_off_auto id: toilet_light_off_auto initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.main_light_t conditions: - condition: state entity_id: binary_sensor.presence_t state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: group.lights_t state: 'on' actions: - action: light.turn_off entity_id: light.0x00158d0002a36f7f_channel_1 - action: light.turn_off entity_id: light.esp32_node_b_light data: transition: 5 - alias: toilet_timer_on id: toilet_timer_on initial_state: true triggers: - trigger: state entity_id: binary_sensor.presence_t from: 'on' to: 'off' - trigger: state entity_id: group.lights_t to: 'on' conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: timer.cancel entity_id: timer.main_light_t - action: timer.start entity_id: timer.main_light_t - alias: toilet_timer_stop id: toilet_timer_stop initial_state: true triggers: - trigger: state entity_id: binary_sensor.presence_t from: 'off' to: 'on' - trigger: state entity_id: group.lights_t to: 'off' actions: - action: timer.cancel entity_id: timer.main_light_t, timer.door_t - alias: toilet_timer_stop_motion_with_light_presence id: toilet_timer_stop_motion_with_light_presence initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d0001e54280_motion to: 'on' conditions: and: - condition: state entity_id: binary_sensor.presence_t state: 'on' - condition: state entity_id: group.lights_t state: 'on' - or: - condition: state entity_id: timer.main_light_t state: active - condition: state entity_id: timer.door_t state: active actions: - action: timer.cancel entity_id: timer.main_light_t, timer.door_t - alias: toilet_auto_light_on id: toilet_auto_light_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001e54280_motion - trigger: state entity_id: binary_sensor.0x00158d000232ddd6_contact to: 'on' from: 'off' - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001b97111_action click_type: single conditions: - condition: state entity_id: group.lights_t state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.tod_day state: 'on' sequence: - action: light.turn_on entity_id: light.0x00158d0002a36f7f_channel_1 - conditions: - condition: state entity_id: binary_sensor.tod_day state: 'off' sequence: - action: light.turn_on entity_id: light.esp32_node_b_light - alias: toilet_light_toggle id: toilet_light_toggle initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x54ef4410005054cc_action click_type: button_2_single actions: - choose: - conditions: - condition: state entity_id: group.lights_t state: 'on' sequence: - action: light.turn_off entity_id: light.0x00158d0002a36f7f_channel_1, light.esp32_node_b_light - conditions: - condition: state entity_id: group.lights_t state: 'off' sequence: - action: light.turn_on entity_id: light.0x00158d0002a36f7f_channel_1 - alias: toilet_indicator id: toilet_indicator initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.0x00158d000232ddd6_contact to: null conditions: - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ trigger.from_state.state\ \ not in ignore and\n trigger.to_state.state not in ignore and\n trigger.to_state.state\ \ != trigger.from_state.state\n}}" - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.0x00158d000232ddd6_contact state: 'on' sequence: - action: light.turn_on data: entity_id: light.esp32_node_hs_toilet effect: Color Wipe brightness: 100 default: - action: light.turn_off entity_id: light.esp32_node_hs_toilet - alias: vova_breather_auto_co2 id: vova_breather_auto_co2 initial_state: true triggers: - trigger: time_pattern minutes: /3 conditions: - condition: state entity_id: switch.system_breather_auto_v state: 'on' - condition: not conditions: - condition: state entity_id: switch.system_breather_manual_v state: 'on' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.0x00158d0003fa6cf5_contact state: 'off' - condition: numeric_state entity_id: sensor.esp32_node_v_co2 above: input_number.co2_high_limit - condition: state entity_id: binary_sensor.breather_v state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' sequence: - action: fan.turn_on entity_id: fan.breather_v - condition: numeric_state entity_id: sensor.esp32_node_v_co2 above: input_number.co2_high_limit - condition: state entity_id: switch.system_breather_auto_speed_v state: 'on' - action: fan.set_percentage entity_id: fan.breather_v data: percentage: '{{states(''sensor.breather_set_speed_v'')|int(0) }}' - conditions: - condition: state entity_id: binary_sensor.0x00158d0003fa6cf5_contact state: 'off' - condition: numeric_state entity_id: sensor.esp32_node_v_co2 above: input_number.co2_high_limit - condition: state entity_id: binary_sensor.breather_v state: 'on' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: state entity_id: switch.system_breather_auto_speed_v state: 'on' - condition: numeric_state entity_id: sensor.breather_set_speed_v above: 0 sequence: - action: fan.set_percentage entity_id: fan.breather_v data: percentage: '{{states(''sensor.breather_set_speed_v'')|int(0) }}' - conditions: - condition: state entity_id: binary_sensor.0x00158d0003fa6cf5_contact state: 'off' - condition: numeric_state entity_id: sensor.esp32_node_v_co2 below: input_number.co2_low_limit - condition: state entity_id: binary_sensor.breather_v state: 'on' sequence: - action: fan.turn_off entity_id: fan.breather_v - conditions: - condition: state entity_id: binary_sensor.0x00158d0003fa6cf5_contact state: 'on' - condition: state entity_id: binary_sensor.breather_v state: 'on' sequence: - action: fan.turn_off entity_id: fan.breather_v - alias: vova_breather_auto_timer id: vova_breather_auto_timer initial_state: true triggers: - trigger: state entity_id: binary_sensor.digma_ir_v_breather_remote_used to: 'on' id: ir_used_remote - trigger: event event_type: yandex_intent event_data: text: Выключи вентиляцию id: to_off_alice - trigger: event event_type: yandex_intent event_data: text: Включи вентиляцию id: to_on_alice - trigger: time at: '21:00:00' id: time_trigger_night - trigger: time at: 09:00:00 id: time_trigger_day conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: trigger id: to_off_alice sequence: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_v'' }}' - if: - condition: state entity_id: binary_sensor.breather_v state: 'on' then: - action: fan.turn_off entity_id: fan.breather_v - action: switch.turn_on entity_id: switch.system_breather_auto_v - conditions: - condition: trigger id: to_on_alice sequence: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_v'' }}' - if: - condition: state entity_id: binary_sensor.breather_v state: 'off' then: - action: switch.turn_on entity_id: switch.system_breather_manual_v - action: fan.turn_on entity_id: fan.breather_v - conditions: - condition: trigger id: time_trigger_night sequence: - action: switch.turn_on entity_id: switch.system_breather_manual_v - action: fan.set_percentage entity_id: fan.breather_v data: percentage: 50 - action: fan.set_preset_mode data: entity_id: fan.purifier2s preset_mode: Silent - conditions: - condition: trigger id: time_trigger_day sequence: - action: fan.turn_off entity_id: fan.breather_v - action: timer.cancel entity_id: timer.breather_v - action: switch.turn_on entity_id: switch.system_breather_auto_v - action: fan.set_preset_mode data: entity_id: fan.purifier2s preset_mode: Silent - alias: vova_breather_plug_toggle id: vova_breather_plug_toggle initial_state: true max_exceeded: silent mode: queued max: 10 triggers: - trigger: state entity_id: switch.0x00158d000344998e_plug to: 'off' for: seconds: 30 conditions: - condition: state entity_id: switch.system_security_mode state: 'off' actions: - action: switch.turn_on entity_id: switch.0x00158d000344998e_plug - alias: vova_breather_switches_interlock id: vova_breather_switches_interlock triggers: - trigger: state entity_id: - switch.system_hourly_mode_breather_v - switch.system_breather_auto_v - switch.system_breather_manual_v conditions: - condition: template value_template: '{{ trigger.to_state.state == ''on'' }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: homeassistant.turn_off target: entity_id: '{% if trigger.from_state.entity_id == ''switch.system_hourly_mode_breather_v'' %} {{ ''switch.system_breather_auto_v'', ''switch.system_breather_manual_v'' }} {% elif trigger.from_state.entity_id == ''switch.system_breather_auto_v'' %} {{ ''switch.system_hourly_mode_breather_v'', ''switch.system_breather_manual_v'' }} {% else %} {{ ''switch.system_hourly_mode_breather_v'', ''switch.system_breather_auto_v'' }} {% endif %}' - alias: vova_breather_switches_default id: vova_breather_switches_default triggers: - trigger: template value_template: '{{ is_state(''switch.system_hourly_mode_breather_v'',''off'') and is_state(''switch.system_breather_auto_v'',''off'') and is_state(''switch.system_breather_manual_v'',''off'') }}' conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: switch.turn_on entity_id: switch.system_breather_auto_v - alias: vova_main_lamp_left_button id: vova_main_lamp_left_button initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001712d55_action click_type: button_1_single conditions: - condition: template value_template: '{{ states(''light.square_led_v'') in [''on'',''off''] and states(''light.square_led_v_nightlight'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.square_led_v_nightlight state: 'on' - condition: state entity_id: group.lights_main_v state: 'off' sequence: - action: yeelight.set_mode data: entity_id: light.square_led_v mode: normal - action: light.turn_on entity_id: light.square_led_v data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: state entity_id: binary_sensor.square_led_v_nightlight state: 'off' - condition: state entity_id: group.lights_main_v state: 'off' sequence: - action: light.turn_on entity_id: light.square_led_v data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: state entity_id: group.lights_main_v state: 'on' sequence: - action: light.turn_off entity_id: light.square_led_v, light.square_led_v_nightlight - alias: vova_main_lamp_right_button id: vova_main_lamp_right_button initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001712d55_action click_type: button_2_single conditions: - condition: template value_template: '{{ states(''light.square_led_v'') in [''on'',''off''] and states(''light.square_led_v_nightlight'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.square_led_v_nightlight state: 'on' - condition: state entity_id: group.lights_main_v state: 'off' sequence: - action: yeelight.set_mode data: entity_id: light.square_led_v mode: normal - action: light.turn_on entity_id: light.square_led_v data: brightness: 14 color_temp_kelvin: 3000 - conditions: - condition: state entity_id: binary_sensor.square_led_v_nightlight state: 'off' - condition: state entity_id: group.lights_main_v state: 'off' sequence: - action: light.turn_on entity_id: light.square_led_v data: brightness: 14 color_temp_kelvin: 3000 - conditions: - condition: state entity_id: group.lights_main_v state: 'on' sequence: - action: light.turn_off entity_id: light.square_led_v, light.square_led_v_nightlight - alias: vova_square_led_restart id: vova_square_led_restart initial_state: true triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.square_led_v state: unavailable for: minutes: 2 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_square_led_v_restart_key state: 'on' - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ states('switch.shelly_1pm_led_v')\ \ not in ignore }} \n" actions: - repeat: while: - condition: state entity_id: light.square_led_v state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.shelly_1pm_led_v - delay: seconds: 15 - action: switch.turn_on entity_id: switch.shelly_1pm_led_v - action: notify.telegram data: message: 🚨 Square LED V restart done({{repeat.index}})! - delay: seconds: 30 - condition: state entity_id: light.square_led_v state: unavailable - action: notify.telegram data: message: 🚨 Square LED V restart unsuccessful! - action: switch.turn_off entity_id: switch.system_square_led_v_restart_key - alias: vova_square_led_restart_key_toggle id: vova_square_led_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.square_led_v from: unavailable actions: - action: switch.turn_on entity_id: switch.system_square_led_v_restart_key - alias: vova_main_lamp_switch_on_if_off id: vova_main_lamp_switch_on_if_off initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001712d55_action click_type: button_1_single - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001712d55_action click_type: button_2_single conditions: - condition: state entity_id: switch.shelly_1pm_led_v state: 'off' actions: - action: switch.turn_on entity_id: switch.shelly_1pm_led_v - alias: vova_main_lamp_off_bed_strips_on id: vova_main_lamp_off_bed_strips_on initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: group.lights_main_v to: 'off' conditions: - condition: state entity_id: binary_sensor.light_outside_mi state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: light.turn_on entity_id: light.d1mini_bed_leds_strip_dima, light.d1mini_bed_leds_strip_sandra data: brightness: 26 - alias: vova_led_strip_bed_control_on id: vova_led_strip_bed_control_on mode: parallel max_exceeded: silent initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d00053faae1_motion id: on_dima - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d00044c7971_motion id: on_sandra conditions: - condition: state entity_id: binary_sensor.bed_led_enable state: 'on' actions: - choose: - conditions: - condition: trigger id: on_sandra - condition: state entity_id: light.d1mini_bed_leds_strip_sandra state: 'off' sequence: - action: light.turn_on entity_id: light.d1mini_bed_leds_strip_sandra data: brightness: '{%- if is_state(''binary_sensor.tod_day'',''off'') -%} 50 {%- else -%} 100 {% endif %} ' rgb_color: - 255 - 255 - 255 transition: 2 - conditions: - condition: trigger id: on_dima - condition: state entity_id: light.d1mini_bed_leds_strip_dima state: 'off' sequence: - action: light.turn_on entity_id: light.d1mini_bed_leds_strip_dima data: brightness: '{%- if is_state(''binary_sensor.tod_day'',''off'') -%} 100 {%- else -%} 153 {% endif %} ' rgb_color: - 255 - 255 - 255 transition: 2 - conditions: - condition: trigger id: on_sandra - condition: state entity_id: light.d1mini_bed_leds_strip_sandra state: 'on' sequence: - action: timer.cancel entity_id: timer.led_strip_bed_sandra_v - action: timer.start entity_id: timer.led_strip_bed_sandra_v - conditions: - condition: trigger id: on_dima - condition: state entity_id: light.d1mini_bed_leds_strip_dima state: 'on' sequence: - action: timer.cancel entity_id: timer.led_strip_bed_dima_v - action: timer.start entity_id: timer.led_strip_bed_dima_v - alias: vova_led_strip_bed_timer_control id: vova_led_strip_bed_timer_control mode: parallel max_exceeded: silent initial_state: true triggers: - trigger: state entity_id: light.d1mini_bed_leds_strip_sandra to: null id: is_sandra - trigger: state entity_id: light.d1mini_bed_leds_strip_dima to: null id: is_dima actions: - choose: - conditions: - condition: trigger id: is_sandra sequence: - action: timer.{{'start' if is_state('light.d1mini_bed_leds_strip_sandra','on') else 'cancel'}} entity_id: timer.led_strip_bed_sandra_v - conditions: - condition: trigger id: is_dima sequence: - action: timer.{{'start' if is_state('light.d1mini_bed_leds_strip_dima','on') else 'cancel'}} entity_id: timer.led_strip_bed_dima_v - alias: vova_led_strip_bed_control_off id: vova_led_strip_bed_control_off mode: parallel max_exceeded: silent initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.led_strip_bed_dima_v id: off_dima - trigger: event event_type: timer.finished event_data: entity_id: timer.led_strip_bed_sandra_v id: off_sandra actions: - choose: - conditions: - condition: trigger id: off_sandra sequence: - wait_template: '{{states(''light.d1mini_bed_leds_strip_sandra'') in [''on'',''off'']}}' - repeat: sequence: - action: light.turn_off entity_id: light.d1mini_bed_leds_strip_sandra data: transition: 10 - delay: seconds: 1 until: - condition: not conditions: - condition: state entity_id: light.d1mini_bed_leds_strip_sandra state: 'on' - conditions: - condition: trigger id: off_dima sequence: - wait_template: '{{states(''light.d1mini_bed_leds_strip_dima'') in [''on'',''off'']}}' - repeat: sequence: - action: light.turn_off entity_id: light.d1mini_bed_leds_strip_dima data: transition: 10 - delay: seconds: 1 until: - condition: not conditions: - condition: state entity_id: light.d1mini_bed_leds_strip_dima state: 'on' - alias: vova_led_strip_bed_control_unavailable id: vova_led_strip_bed_control_unavailable mode: parallel max_exceeded: silent initial_state: true triggers: - trigger: state entity_id: light.d1mini_bed_leds_strip_dima from: unavailable to: 'on' id: un_dima - trigger: state entity_id: light.d1mini_bed_leds_strip_sandra from: unavailable to: 'on' id: un_sandra actions: - choose: - conditions: - condition: trigger id: un_sandra sequence: - not: - condition: state entity_id: timer.led_strip_bed_sandra_v state: active - action: timer.cancel entity_id: timer.led_strip_bed_sandra_v - action: timer.start entity_id: timer.led_strip_bed_sandra_v - conditions: - condition: trigger id: un_dima sequence: - not: - condition: state entity_id: timer.led_strip_bed_sandra_v state: active - action: timer.cancel entity_id: timer.led_strip_bed_dima_v - action: timer.start entity_id: timer.led_strip_bed_dima_v - alias: vova_led_strip_bed_restart id: vova_led_strip_bed_restart initial_state: false triggers: - trigger: time_pattern minutes: /1 conditions: - condition: state entity_id: light.d1mini_bed_leds_strip_dima, light.d1mini_bed_leds_strip_sandra state: unavailable for: minutes: 1 - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: switch.system_led_strip_bed_v_restart_key state: 'on' actions: - repeat: while: - condition: state entity_id: light.d1mini_bed_leds_strip_dima state: unavailable - condition: template value_template: '{{ repeat.index <= 5 }}' sequence: - action: switch.turn_off entity_id: switch.0x00158d0001a248e3_channel_1 - delay: seconds: 15 - action: switch.turn_on entity_id: switch.0x00158d0001a248e3_channel_1 - action: notify.telegram data: message: 🚨 LED Strip Bed V restart done({{repeat.index}})! - delay: seconds: 30 - condition: state entity_id: light.d1mini_bed_leds_strip_dima state: unavailable - action: notify.telegram data: message: 🚨 Led Strip Bed V restart unsuccessful! - action: switch.turn_off entity_id: switch.system_led_strip_bed_v_restart_key - alias: vova_led_strip_bed_restart_key_toggle id: vova_led_strip_bed_restart_key_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: light.d1mini_bed_leds_strip_dima from: unavailable actions: - action: switch.turn_on entity_id: switch.system_led_strip_bed_v_restart_key - alias: vova_main_light_off_with_occupancy id: vova_main_light_off_with_occupancy initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.occupancy_v to: 'off' for: hours: 2 conditions: - condition: state entity_id: group.lights_v state: 'on' actions: - action: light.turn_off entity_id: light.square_led_v, light.square_led_v_nightlight, light.d1mini_bed_leds_strip_dima, light.d1mini_bed_leds_strip_sandra, light.0x54ef441000d4e7fd_light data: transition: 15 - alias: vova_led_color_control id: vova_led_color_control initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d00016bdb4a_action conditions: - condition: template value_template: '{{ states(''light.0x54ef441000d4e7fd_light'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''single'' }}' sequence: - action: light.toggle entity_id: light.0x54ef441000d4e7fd_light - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''double'' }}' sequence: - action: light.turn_on entity_id: light.0x54ef441000d4e7fd_light data: brightness: 230 color_temp_kelvin: 5000 - conditions: - condition: template value_template: '{{ trigger.event.data.click_type == ''hold'' }}' sequence: - action: light.turn_on entity_id: light.0x54ef441000d4e7fd_light data: brightness: 14 color_temp_kelvin: 3000 - alias: vova_main_light_control_with_alice id: vova_main_light_control_with_alice initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Выключи свет в Вовиной комнате id: to_off_alice - trigger: event event_type: yandex_intent event_data: text: Включи свет в Вовиной комнате id: to_on_alice conditions: - condition: template value_template: '{{ states(''light.square_led_v'') in [''on'',''off''] and states(''light.square_led_v_nightlight'') in [''on'',''off''] }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: trigger id: to_off_alice sequence: - action: light.turn_off entity_id: light.square_led_v - conditions: - condition: trigger id: to_on_alice sequence: - action: light.turn_on entity_id: light.square_led_v data: brightness: 230 color_temp_kelvin: 5000 - alias: system_printer_toner_level id: system_printer_toner_level initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: numeric_state entity_id: - sensor.hp_178nw_black - sensor.hp_178nw_cyan - sensor.hp_178nw_magenta - sensor.hp_178nw_yellow below: 30 actions: - action: notify.telegram data: message: 🖨 Внимание! Необходимо заказать картриджи. B {{states('sensor.hp_178nw_black')|int(0)}}%, C {{states('sensor.hp_178nw_cyan')|int(0)}}%, M {{states('sensor.hp_178nw_magenta')|int(0)}}%, Y {{states('sensor.hp_178nw_yellow')|int(0)}}% - alias: system_printer_offline id: system_printer_offline initial_state: true triggers: - trigger: state entity_id: sensor.hp_color_laser_mfp_178nw to: unavailable for: minutes: 5 actions: - action: notify.telegram data: message: ⚠ Принтер не в сети! Проверьте питание! - alias: bathroom_miscale_weight_person id: bathroom_miscale_weight_person triggers: - trigger: state entity_id: binary_sensor.weight_changed from: 'off' to: 'on' actions: - variables: who_could_weigh: "{%- macro weight_person() -%} \n {%- for item in states.person\ \ if\n (item.state == 'home' and 'input_number.weight_' + item.name | lower\ \ in\n states.input_number | selectattr('entity_id', 'search', '^input_number.weight_')\n\ \ | map(attribute='entity_id') | list ) -%} \n {%- set x = states('input_number.weight_'\ \ + item.name | lower) | float(0) | round(1) -%} \n {%- set y = (x *\ \ 3 / 100) -%} \n {%- if (x > 0) and ((x - y) < (states('sensor.8cd0b2a04f02_weight')\ \ | float(0) | round(1)) < (x + y)) -%} \n {{ item.name | lower }},\ \ \n {%- endif -%} \n {%- endfor -%}\n{%- endmacro -%} {{ weight_person().split(',')\ \ | select(\"ne\", \"\") | sort | unique | list }}" - if: - condition: template value_template: '{{ who_could_weigh | count == 1 }} ' then: - action: input_number.set_value data: entity_id: '{{ ''input_number.weight_'' + who_could_weigh | first }} ' value: '{{ states(''sensor.8cd0b2a04f02_weight'') | float(0) | round(1) }}' - alias: security_everybody_out_1min id: security_everybody_out_1min initial_state: true triggers: - trigger: state entity_id: binary_sensor.family_home to: 'off' for: minutes: 1 actions: - action: notify.mobile_app_iphone_16_pro_dima data: message: Включение режима охраны через 1 минуту! title: Никого нет дома! data: actions: - action: guestmode title: Гостевой режим authenticationRequired: false activationMode: background icon: sfsymbols:person.circle.fill - alias: security_everybody_out_reply_from_app id: security_everybody_out_reply_from_app initial_state: true triggers: - trigger: event event_type: mobile_app_notification_action event_data: service: guestmode actions: - action: switch.turn_on entity_id: switch.system_guest_mode - alias: security_wrapper id: security_wrapper initial_state: true triggers: - trigger: state entity_id: binary_sensor.family_home to: 'off' for: minutes: 2 id: to_on - trigger: state entity_id: binary_sensor.family_home to: 'on' for: seconds: 15 id: to_off conditions: - condition: state entity_id: switch.system_guest_mode state: 'off' actions: - choose: - conditions: - condition: trigger id: to_on sequence: - action: switch.turn_on entity_id: switch.system_security_mode - conditions: - condition: trigger id: to_off sequence: - action: switch.turn_off entity_id: switch.system_security_mode, switch.system_guest_mode - delay: seconds: 3 - action: notify.telegram data: message: 👮 Режим охраны {{ iif(is_state('switch.system_security_mode','off'), 'выключен!', 'включен!', '')}} - alias: security_state_change id: security_state_change initial_state: true triggers: - trigger: state entity_id: switch.system_security_mode to: null for: seconds: 15 actions: - choose: - conditions: - condition: state entity_id: switch.system_security_mode state: 'on' sequence: - action: notify.telegram data: message: 🏢 Никого нет дома, выключаем освещение! - action: script.turn_on entity_id: script.away_mode_on - action: notify.telegram data: message: 🔔 Освещение выключено! - conditions: - condition: state entity_id: switch.system_security_mode state: 'off' sequence: - action: input_boolean.turn_off data: entity_id: switch.system_security_mode - action: script.turn_on entity_id: script.away_mode_off - alias: security_sensors_state_change id: security_sensors_state_change initial_state: true mode: queued max: 25 max_exceeded: silent triggers: - trigger: state entity_id: - binary_sensor.0x00158d00027129ae_contact - binary_sensor.0x00158d0001ef2ffc_contact - binary_sensor.0x00158d0002a14c5e_contact - binary_sensor.0x00158d0002529b9c_contact - binary_sensor.0x00158d00025315e9_contact - binary_sensor.0x00158d0001e5d6be_contact - binary_sensor.582d344031f7_contact - binary_sensor.0x00158d0002531749_contact - binary_sensor.0x00158d00025371f6_contact - binary_sensor.0x00158d000200ad58_contact - binary_sensor.0x00158d0003fa6cf5_contact - binary_sensor.0x00158d00025370d1_contact to: null - trigger: state entity_id: - binary_sensor.0x00158d0001ae9f61_motion - binary_sensor.0x00158d0001aea602_motion - binary_sensor.0x00158d0003f27ce2_motion - binary_sensor.0x00158d0001e05856_motion - binary_sensor.0x00158d0001e53cda_motion - binary_sensor.0x00158d0001e54280_motion - binary_sensor.0x00158d000224f89f_motion - binary_sensor.0x00158d000236bb94_motion - binary_sensor.0x00158d000236bc6d_motion - binary_sensor.0x00158d0002b4729d_motion - binary_sensor.0x00158d0002b482e9_motion - binary_sensor.0x00158d0002b48381_motion - binary_sensor.0x00158d0003140824_motion - binary_sensor.0x00158d0001d5995e_motion - binary_sensor.0x00158d00044c7971_motion - binary_sensor.0x00158d00053faae1_motion - binary_sensor.g5_flex_entrance_motion to: 'on' conditions: - condition: state entity_id: switch.system_security_mode state: 'on' - condition: state entity_id: timer.security_delay state: idle - condition: numeric_state entity_id: sensor.ha_uptime above: 0 actions: - action: notify.telegram data: message: 👮 Сработал датчик {{trigger.to_state.attributes.friendly_name}}! - alias: security_alarm_delay id: security_alarm_delay initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.582d344031f7_contact from: 'off' to: 'on' conditions: - condition: state entity_id: switch.system_security_mode state: 'on' actions: - action: timer.cancel entity_id: timer.security_delay - action: timer.start entity_id: timer.security_delay - alias: security_main_door_vibration id: security_main_door_vibration initial_state: true triggers: - trigger: state entity_id: sensor.0x00158d0002b5fbc1_action to: vibration conditions: - condition: state entity_id: switch.system_security_mode state: 'on' actions: - action: notify.telegram data: message: 🚪 Внимание! Главная дверь - Вибрация! - alias: security_sensors_state_change_night id: security_sensors_state_change_night initial_state: true mode: queued max: 25 max_exceeded: silent triggers: - trigger: state entity_id: - binary_sensor.0x00158d00025371f6_contact - binary_sensor.0x00158d000200ad58_contact - binary_sensor.0x00158d0003fa6cf5_contact - binary_sensor.0x00158d00025370d1_contact - binary_sensor.582d344031f7_contact - binary_sensor.0x00158d0001e5d6be_contact - binary_sensor.0x00158d0002531749_contact from: 'off' to: 'on' conditions: - condition: state entity_id: binary_sensor.tod_day state: 'off' - condition: state entity_id: switch.system_security_mode state: 'off' actions: - action: notify.telegram data: message: '{{"\U0001f46e"}} {%-if trigger.to_state.attributes.device_class==''window'' and trigger.to_state.state==''on''%}Открыто окно {{trigger.to_state.attributes.friendly_name}} {%-elif trigger.to_state.attributes.device_class==''window'' and trigger.to_state.state==''off''%}Окно закрыто {{trigger.to_state.attributes.friendly_name}} {%-elif trigger.to_state.attributes.device_class==''door'' and trigger.to_state.state==''on''%}Дверь открыта {{trigger.to_state.attributes.friendly_name}} {%-elif trigger.to_state.attributes.device_class==''door'' and trigger.to_state.state==''off''%}Дверь закрыта {{trigger.to_state.attributes.friendly_name}} {%-else%}NA{%endif%}' - alias: system_error_counter id: system_error_counter initial_state: true mode: parallel max: 25 max_exceeded: silent triggers: - trigger: event event_type: system_log_event event_data: level: ERROR conditions: - condition: template value_template: '{{ not ''system_error_counter'' in (trigger.event.data.message|string) }}' - condition: template value_template: '{{ not ''a0d7b954_ide'' in (trigger.event.data.message|string) }}' actions: - action: counter.increment entity_id: counter.error_counter - alias: system_warning_counter id: system_warning_counter mode: parallel max: 25 max_exceeded: silent initial_state: true triggers: - trigger: event event_type: system_log_event event_data: level: WARNING conditions: - condition: template value_template: '{{ not ''system_warning_counter'' in (trigger.event.data.message|string) }}' - condition: template value_template: '{{ not ''a0d7b954_ide'' in (trigger.event.data.message|string) }}' actions: - action: counter.increment entity_id: counter.warning_counter - alias: system_triggered_automations_counter id: system_triggered_automations_counter mode: parallel max: 25 max_exceeded: silent initial_state: true triggers: - trigger: event event_type: automation_triggered conditions: - condition: template value_template: '{{ not ''system_triggered_automations_counter'' in (trigger.event.data.name|string) }}' - condition: template value_template: '{{ not ''system_esphome_ble_advert'' in (trigger.event.data.name|string) }}' actions: - action: counter.increment entity_id: counter.triggered_automations - alias: system_executed_scripts id: system_executed_scripts mode: parallel max: 25 max_exceeded: silent triggers: - trigger: event event_type: script_started actions: - action: counter.increment entity_id: counter.executed_scripts - alias: system_start id: system_start_message initial_state: true triggers: - trigger: homeassistant event: start actions: - action: notify.telegram data: message: 😃 Сервер({{state_attr('update.home_assistant_core_update','installed_version')}}) запущен за {{states('sensor.start_time')|int(0)}}сек {{states('sensor.errors_during_boot')|int(0) | format(morph='ошибка', as_text=false) }}, {{states('sensor.warnings_during_boot')|int(0)| format(morph='предупреждение', as_text=false) }} - action: script.turn_on entity_id: script.system_start - action: counter.increment entity_id: counter.restart_counter - delay: seconds: 10 - action: homeassistant.reload_config_entry data: entry_id: 88ea33f726cb0d5ca6d8d320267c468c - alias: system_stop id: system_stop_message initial_state: true mode: single max_exceeded: silent triggers: - trigger: homeassistant event: shutdown actions: - action: switch.turn_off entity_id: switch.system_main_lead - action: notify.telegram data: message: 😡 Сервер({{state_attr('update.home_assistant_core_update','installed_version')}}) остановлен после {{states('sensor.ha_uptime_text').replace('d','д').replace('h','ч').replace('m','м')}} работы - alias: system_start_stop_flag_set id: system_start_stop_flag_set initial_state: true triggers: - trigger: homeassistant event: start id: homeassistant_start - trigger: homeassistant event: shutdown actions: - action: "{% if trigger.id == 'homeassistant_start' -%}\n input_boolean.turn_off\n\ {% else -%}\n input_boolean.turn_on\n{% endif %}\n" data: entity_id: input_boolean.ha_shutdown - action: "{% if trigger.id == 'homeassistant_start' -%}\n automation.turn_on\n\ {% else -%}\n automation.turn_off\n{% endif %}\n" data: entity_id: - automation.system_gw3_state - automation.system_zb_devices_status - automation.system_esp_devices_status - automation.system_xiaomi_gw3_error - alias: system_github_star id: system_github_star initial_state: true triggers: - trigger: state entity_id: sensor.to4ko_myconfig_stars to: null conditions: - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none','0'] %} {{\ \ trigger.from_state.state not in ignore and\n trigger.to_state.state not in\ \ ignore and\n trigger.to_state.state = trigger.from_state.state }}\n" actions: - action: notify.telegram data: message: '⭐ GitHub Star -> {{ trigger.to_state.state }} ' - alias: system_new_device_tracker_found id: system_new_device_tracker_found initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: event event_type: device_tracker_new_device actions: - action: notify.telegram data: message: '✴ Новое устройство: {{ trigger.event.data.host_name if trigger.event.data.host_name is defined else ''NA'' }} - ({{ trigger.event.data.entity_id if trigger.event.data.entity_id is defined else ''NA'' }})' - alias: system_entity_change id: system_entity_change initial_state: true mode: queued max: 20 max_exceeded: silent triggers: - trigger: event event_type: entity_registry_updated conditions: - condition: template value_template: '{{ ''mi_11'' not in trigger.event.data.entity_id }}' - condition: template value_template: '{{ ''pova_5'' not in trigger.event.data.entity_id }}' - condition: template value_template: '{{ ''lower'' not in trigger.event.data.action }}' - condition: template value_template: '{{ ''update'' not in trigger.event.data.action }}' actions: - action: telegram_bot.send_message data: message: '❇ Entity - {{ trigger.event.data.action | capitalize }}: {{ trigger.event.data.old_entity_id+''->'' if trigger.event.data.old_entity_id is defined }}{{ trigger.event.data.entity_id if trigger.event.data.entity_id is defined else ''NA'' }}' target: secret tel_chat_id timeout: 180 - alias: system_device_entity_deletion id: system_device_entity_deletion initial_state: true mode: queued max: 20 max_exceeded: silent triggers: - trigger: event event_type: device_registry_updated actions: - action: python_script.exec data: device_id: '{{ trigger.event.data.device_id }}' source: "registry = hass.data['device_registry']\ndevice = registry.async_get(data['device_id'])\n\ if device and device.name_by_user == 'delete':\n registry.async_remove_device(data['device_id'])\n" - alias: system_new_day_telegram id: system_new_day_telegram initial_state: true triggers: - trigger: time at: 00:00:01 actions: - action: notify.telegram data: message: 🌅 Начался новый день За прошедшие сутки перезагрузок - {{states('counter.restart_counter')|int(0) }}, ошибок - {{states('counter.error_counter')|int(0) }}, предупреждений - {{states('counter.warning_counter')|int(0)}}, ошибок входа - {{states('counter.badlogin_counter')|int(0)}}, cработало автоматизаций - {{states('counter.triggered_automations')|int(0)}}, ошибок автоматизаций - {{states('counter.automation_error_counter')|int(0)}}, запущенно скриптов - {{states('counter.executed_scripts')|int(0)}}. Входная дверь открывалась - {{states('counter.main_door_hb')|int(0)}}раз(а). Чайник включали - {{states('counter.kettle_k')|int(0)}}раз(а) - action: counter.reset entity_id: - counter.warning_counter - counter.error_counter - counter.restart_counter - counter.badlogin_counter - counter.main_door_hb - counter.automation_error_counter - counter.kettle_k - counter.triggered_automations - counter.executed_scripts - counter.toilet_tank - action: switch.turn_off entity_id: switch.system_dark_mode - action: tts.clear_cache - action: input_select.select_next entity_id: input_select.dishwasher - action: automation.turn_on entity_id: automation.vova_tv_control - alias: system_weather_to_telegram id: system_weather_to_telegram initial_state: true triggers: - trigger: time at: 07:00:00 - trigger: time at: '21:00:00' actions: - action: script.turn_on entity_id: script.briefing_telegram - alias: system_login_failure id: system_login_failure initial_state: true triggers: - trigger: persistent_notification update_type: - added - updated notification_id: http-login id: http-login - trigger: persistent_notification update_type: - added - updated notification_id: ip-ban id: ip-ban conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: counter.increment entity_id: counter.badlogin_counter - parallel: - action: telegram_bot.send_message data: target: secret tel_chat_id title: "{%- if trigger.id == 'http-login' %}\n {{- '\\U0001F6AB' -}}\n\ {% else %}\n {{- '\\U000026D4' -}}\n{% endif %}" message: "{% set ipadress = trigger.notification.message | replace('\\n',\ \ ' ') | regex_replace('.*\\((?=\\d+\\.\\d+\\.\\d+\\.\\d+)') | regex_replace('\\\ ).*')\n | replace('Too many login attempts from ', '') %}\n\n{% if trigger.id\ \ == 'http-login' -%}\n Неудачная попытка входа в систему с адреса {{\ \ ipadress }}\n{%- else -%}\n Заблокирован IP адрес {{ ipadress }} после\ \ 5 попыток входа\n{%- endif %}\n" disable_web_page_preview: true - action: persistent_notification.dismiss data: notification_id: '{{ trigger.id }}' - alias: system_blocked_ip id: system_blocked_ip initial_state: true triggers: - trigger: state entity_id: persistent_notification.ip_ban to: null conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: notify.telegram data: message: '{% set ipadress = trigger.to_state.attributes.message.split(''from '')[1] | regex_replace(''\s+.*'') %} {{"\U000026d4"}} Заблокирован IP: {{ ipadress }} ' - action: persistent_notification.dismiss data: notification_id: ip_ban - alias: system_groups_rebuild id: system_groups_rebuild initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: time_pattern hours: /1 - trigger: homeassistant event: start conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: group.set data: object_id: updates_monitor entities: '{%-for state in states.update | selectattr(''attributes.device_class'', ''defined'') | selectattr(''attributes.device_class'', ''eq'',''firmware'') %} {{ state.entity_id}}{%- if not loop.last -%}, {%- endif -%} {%-endfor%}' - action: group.set data: object_id: gw3_zigbee_entities entities: '{%-for state in states.sensor if state.entity_id.endswith("_zigbee")%} {{ state.entity_id}}{%- if not loop.last -%}, {%- endif -%} {%-endfor%}' - action: group.set data: object_id: gw3_ble_entities entities: '{%-for state in states.sensor if state.entity_id.endswith("_ble")%} {{ state.entity_id}}{%- if not loop.last -%}, {%- endif -%} {%-endfor%}' - action: group.set data: object_id: gw3_mesh_entities entities: '{%-for state in states.sensor if state.entity_id.endswith("_mesh")%} {{ state.entity_id}}{%- if not loop.last -%}, {%- endif -%} {%-endfor%}' - action: group.set data: object_id: gw3_zigbee_battery_low entities: '{%-for state in states.binary_sensor if state.entity_id.endswith("_battery_low")%} {{ state.entity_id}}{%- if not loop.last -%}, {%- endif -%} {%-endfor%}' - action: group.set data: object_id: esp_devices_uptime entities: '{%-for state in states.sensor if state.entity_id.endswith("_uptime_s")%} {{ state.entity_id}}{%- if not loop.last -%}, {%- endif -%} {%-endfor%}' - action: group.set data: object_id: batteries entities: '{%-for state in states.sensor if (state.entity_id.endswith("_battery") and ''esp32'' not in state.entity_id)%} {{ state.entity_id}}{%- if not loop.last -%}, {%- endif -%} {%-endfor%}' - action: group.set data: object_id: lights_all entities: '{%- for state in states.group if ("lights_" in state.entity_id) %} {{- expand(state.entity_id)|map(attribute=''entity_id'')|list|join('','') }}{%- if not loop.last -%}, {%- endif -%} {%- endfor %}' - alias: system_battery_level_check id: system_battery_level_check initial_state: true triggers: - trigger: time at: '20:30:00' actions: - action: notify.telegram data: message: "{%- set datanames = namespace(low_batt=[]) -%} {%- set threshold_zb\ \ = states('input_number.battery_low_level_zb')|int(0) -%} {%- set threshold_bt\ \ = states('input_number.battery_low_level_bt')|int(0) -%} {%- set domains\ \ = ['sensor'] %} {%- for domain in domains -%} {%- for item in states[domain]\ \ if((\"_battery\" in item.entity_id and ((\"0x\" in item.entity_id and item.state|int(0)\ \ <= threshold_zb) or (\"0x\" not in item.entity_id and item.state|int(0)\ \ <= threshold_bt)) and item.entity_id in integration_entities('xiaomi_gateway3')))-%}\n\ \ {%- set datanames.low_batt = datanames.low_batt + [item.name.replace('\ \ Battery','') +' '+item.state+'%'] -%}\n{%- endfor %} {%- endfor %} {%- set\ \ num_low_bat = datanames.low_batt | length %} {%- set low_bat = datanames.low_batt\ \ | join(', ') %} {%- if num_low_bat > 0 %} {{\"\\U0001f6a8\"}} Низкий заряд\ \ батарей ({{ num_low_bat}}шт): {{low_bat}} {%- else %} {{\"\\U0001f50b\"\ }} Батарей с низким уровнем заряда не найдено {%- endif %}" - alias: system_database_purge id: system_database_purge initial_state: true triggers: - trigger: time at: 02:00:00 actions: - action: recorder.purge data: keep_days: 15 repack: true - action: notify.telegram data: message: 💫 Очистка базы - alias: system_transmission_completed_torrent id: system_transmission_completed_torrent initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: transmission_downloaded_torrent actions: - action: notify.telegram data: message: 💯 Загрузка завершена {{trigger.event.data.name}} - alias: system_config_error_notification id: system_config_error_notification initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: - persistent_notification.homeassistant_check_config - persistent_notification.invalid_config to: notifying conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: notify.telegram data: message: ❌ Перезапуск отменён. Конфигурация содержит ошибки {{ trigger.to_state.attributes.message }} - action: persistent_notification.dismiss data: notification_id: "{% if 'could not be set up' in trigger.to_state.attributes.message\ \ | lower %}\n invalid_config\n{% else %}\n homeassistant_check_config\n\ {% endif %}\n" - alias: system_automation_error id: system_automation_error initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: event event_type: system_log_event event_data: level: ERROR conditions: - condition: template value_template: "{{ \n trigger.event.data.message | regex_search('Error while\ \ executing automation') or\n trigger.event.data.message | regex_search('Error\ \ executing script')\n}}" - condition: template value_template: '{{ trigger.event.data.name is not search(this.entity_id, ignorecase=True) }}' actions: - action: notify.telegram data: message: '{{ ''\U0000274C'' }} Ошибка выполнения автоматизации: {{ trigger.event.data.message | e }} ' - action: counter.increment data: entity_id: counter.automation_error_counter - alias: system_error_per_hour id: system_error_per_hour initial_state: true mode: single max_exceeded: silent triggers: - trigger: numeric_state entity_id: sensor.error_counter_hourly above: 100 conditions: - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.system_error_per_hour'', ''last_triggered''), 0)|int(0) ,0) > 15 }}' - condition: template value_template: '{{ (states(''sensor.error_counter_hourly'')|int(0) % 50) == 0 }}' actions: - action: notify.telegram data: message: ⚠ Внимание Количество ошибок в час выросло до {{states('sensor.error_counter_hourly')|int(0)}} - alias: system_warning_per_hour id: system_warning_per_hour initial_state: true mode: single max_exceeded: silent triggers: - trigger: numeric_state entity_id: sensor.warning_counter_hourly above: 100 conditions: - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.system_warning_per_hour'', ''last_triggered''), 0)|int(0) ,0) > 15 }}' - condition: template value_template: '{{ (states(''sensor.warning_counter_hourly'')|int(0) % 50) == 0 }}' actions: - action: notify.telegram data: message: ⚠ Внимание Количество предупреждений в час выросло до {{states('sensor.warning_counter_hourly')|int(0)}} - alias: system_critical_error_notify id: system_critical_error_notify initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: event event_type: system_log_event event_data: level: FATAL - trigger: event event_type: system_log_event event_data: level: CRITICAL actions: - action: notify.telegram data: message: '🔴 Критическая ошибка системы: {{ trigger.event.data.message | e}}' - alias: system_silent_mode_toggle id: system_silent_mode_toggle initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: state entity_id: switch.system_silent_mode from: 'on' to: 'off' - trigger: state entity_id: switch.system_silent_mode from: 'off' to: 'on' actions: - action: switch.turn_{{states('switch.system_silent_mode')}} entity_id: switch.esp32_domofon_mute, switch.sonoff_mini_1_mute - action: input_number.set_value data: entity_id: input_number.main_volume value: '{% if is_state(''switch.system_silent_mode'',''on'') %}0{%else%}0.4{%endif%}' - action: number.set_value data: entity_id: number.up_chime_volume value: '{% if is_state(''switch.system_silent_mode'',''on'') %}0{%else%}80{%endif%}' - action: notify.telegram data: message: "{% if is_state('switch.system_silent_mode','on') %}\n {{'\\U0001f515'}}\ \ Режим тишины включен\n{%else%}\n {{'\\U0001f514'}} Режим тишины выключен\n\ {%endif%}\n" - alias: system_gw3_state id: system_gw3_state initial_state: true mode: queued max: 5 max_exceeded: silent triggers: - trigger: state entity_id: - binary_sensor.54ef444329cd_gateway - binary_sensor.54ef44437eb6_gateway - binary_sensor.54ef44433076_gateway - binary_sensor.54ef44439a55_gateway - binary_sensor.54ef443f1fac_gateway - binary_sensor.54ef44439a55_gateway - binary_sensor.54ef4443a353_gateway to: 'off' - trigger: state entity_id: - binary_sensor.54ef444329cd_gateway - binary_sensor.54ef44437eb6_gateway - binary_sensor.54ef44433076_gateway - binary_sensor.54ef44439a55_gateway - binary_sensor.54ef443f1fac_gateway - binary_sensor.54ef44439a55_gateway - binary_sensor.54ef4443a353_gateway from: 'off' conditions: - condition: template value_template: '{{ trigger.to_state.state = trigger.from_state.state }}' - condition: numeric_state entity_id: sensor.ha_uptime above: 0 actions: - action: notify.telegram data: message: '⚙ {{trigger.to_state.attributes.friendly_name}}: {% if trigger.from_state.state in [''on'',''off'',''unknown'',''unavailable''] %}{{trigger.from_state.state}}{%else%}online{%endif%} -> {% if trigger.to_state.state in [''on'',''off'',''unknown'',''unavailable''] %}{{trigger.to_state.state}}{%else%}online{%endif%}' - alias: system_watchdog id: system_watchdog initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.0x00158d000323c87c_contact to: null for: seconds: 2 actions: - action: notify.telegram data: message: '{% if is_state(''binary_sensor.0x00158d000323c87c_contact'',''off'') %} {{''\U0001F7E2''}} Watchdog: API Connected {%else%} {{''\U0001F534''}} Watchdog: API Disconnected {%endif%} ' - alias: system_dark_mode id: system_dark_mode initial_state: true triggers: - trigger: state entity_id: switch.system_dark_mode actions: - action: notify.telegram data: message: "{% if is_state('switch.system_dark_mode','on') %}\n {{'\\U0001f318'}}\ \ Режим темноты включен\n{%else%}\n {{'\\U00002600'}} Режим темноты выключен\n\ {%endif%}\n" - condition: state entity_id: switch.system_dark_mode state: 'off' - action: switch.turn_off entity_id: switch.system_silent_mode - alias: system_hot_water_pipe id: system_hot_water_pipe initial_state: true triggers: - trigger: numeric_state entity_id: sensor.esp32_node_b_hot_pipe below: 40 for: minutes: 5 - trigger: numeric_state entity_id: sensor.esp32_node_b_hot_pipe above: 40 for: minutes: 5 conditions: - condition: state entity_id: input_boolean.hot_water state: 'on' - condition: not conditions: - condition: state entity_id: sensor.esp32_node_b_hot_pipe state: unavailable actions: - action: notify.telegram data: message: 🌡 Внимание Горячая вода {% if states('sensor.esp32_node_b_hot_pipe')|float(0) > 40 %}включена{%else%}выключена{%endif%} - alias: system_cold_water_pipe id: system_cold_water_pipe initial_state: false triggers: - trigger: numeric_state entity_id: sensor.esp32_node_b_cold_pipe above: sensor.0x00158d0001e58754_temperature for: minutes: 5 actions: - action: notify.telegram data: message: 🌡 Внимание Температура трубы холодной воды выше {{states('sensor.esp32_node_b_cold_pipe')|int(0)}}°C - alias: system_central_heating id: system_central_heating initial_state: true triggers: - trigger: state entity_id: binary_sensor.central_heating to: 'off' for: minutes: 30 - trigger: state entity_id: binary_sensor.central_heating to: 'on' for: minutes: 30 actions: - action: input_boolean.turn_{{states('binary_sensor.central_heating')}} entity_id: input_boolean.central_heating - action: notify.telegram data: message: 🌡 Внимание Отопление {% if is_state('binary_sensor.central_heating','on') %}включено{%else%}выключено{%endif%} - alias: system_heating_pipes_warning id: system_heating_pipes_warning initial_state: true triggers: - trigger: numeric_state entity_id: - sensor.esp32_node_v_heating_pipe - sensor.esp32_node_mb_heating_pipe below: 30 for: minutes: 5 conditions: - condition: state entity_id: input_boolean.central_heating state: 'on' actions: - action: notify.telegram data: message: 🌡 Внимание Температура трубы {{trigger.to_state.attributes.friendly_name}} ниже 30°C - alias: system_zb_devices_status id: system_zb_devices_status initial_state: true mode: queued max: 100 max_exceeded: silent triggers: - trigger: event event_type: state_changed conditions: - condition: state entity_id: input_boolean.ha_shutdown state: 'off' - condition: numeric_state entity_id: sensor.ha_uptime above: 0 - condition: template value_template: '{{ trigger.event.data.entity_id in expand(''group.zigbee_devices'') | map(attribute=''entity_id'') | list }}' - condition: template value_template: '{{ trigger.event.data.new_state.state = trigger.event.data.old_state.state }}' - condition: template value_template: '{{ trigger.event.data.new_state.state in [''unavailable''] or trigger.event.data.old_state.state in [''unavailable''] }}' actions: - if: - condition: template value_template: '{{ states(''input_boolean.ha_shutdown'') == ''off'' }}' then: - action: notify.telegram data: message: '{% if trigger.event.data.new_state.state in [''unavailable''] %}{{''\U0001F4A5''}} {% elif trigger.event.data.old_state.state in [''unavailable''] %}{{''\U00002705''}} {% else %}{{''\U00002049''}} {% endif %} ZB: {{iif(device_attr(trigger.event.data.entity_id, ''name_by_user'') = none, device_attr(trigger.event.data.entity_id, ''name_by_user''), device_attr(trigger.event.data.entity_id, ''name''), device_attr(trigger.event.data.entity_id, ''name''))}}: {{trigger.event.data.old_state.state}} -> {{trigger.event.data.new_state.state}} ' - alias: system_zb_devices_status_normal id: system_zb_devices_status_normal initial_state: true mode: single max_exceeded: silent triggers: - trigger: numeric_state entity_id: sensor.zigbee_devices_unavailable below: 1 for: seconds: 5 actions: - action: notify.telegram data: message: '✅ ZB: Все устройства онлайн' - alias: system_esp_devices_status id: system_esp_devices_status initial_state: true mode: queued max: 15 max_exceeded: silent triggers: - trigger: state entity_id: - binary_sensor.esp32_strip_1s_bookshelf_mb_status - binary_sensor.digma_ir_k_status - binary_sensor.digma_ir_mb_status - binary_sensor.d1mini_light_l_status - binary_sensor.digma_strip_hb_status - binary_sensor.digma_ir_s_status - binary_sensor.digma_ir_v_status - binary_sensor.esp32_node_v_status - binary_sensor.esp32_node_k_status - binary_sensor.esp32_node_hs_status - binary_sensor.esp32_node_mb_status - binary_sensor.esp8266_oven_temp_k_status - binary_sensor.esp32_pzem_hb_status - binary_sensor.esp8266_hood_k_status - binary_sensor.esp32_strip_1s_wadrobe_mb_status - binary_sensor.sonoff_mini_1_status - binary_sensor.sonoff_mini_r4_kiosk_charger_status - binary_sensor.mono_strip_1_status - binary_sensor.sonoff_mini_4_status - binary_sensor.sonoff_pow_r2_1_status - binary_sensor.esp32_node_b_status - binary_sensor.esp32_node_b_valve_status - binary_sensor.sonoff_pow_r2_2_status - binary_sensor.esp32_node_s_status - binary_sensor.esp32_node_s_ha_connect_status - binary_sensor.esp32_domofon_status - binary_sensor.esp32_poe_ble_s_status - binary_sensor.d1mini_distance_sensor_status - binary_sensor.esp32_poe_ble_hs_status - binary_sensor.esp32_poe_ble_mb_status - binary_sensor.sonoff_pow_r2_3_status - binary_sensor.d1mini_bed_leds_status - binary_sensor.d1mini_air_freshener_status - binary_sensor.sp111_socket_1_status - binary_sensor.sonoff_basic_4_status - binary_sensor.esp32_strip_1s_entrance_hb_status - binary_sensor.esp32_strip_1s_wadrobe_hb_status from: 'on' to: 'off' for: minutes: 2 actions: - action: notify.telegram data: message: '🔴 ESP: {{iif(device_attr(trigger.entity_id, ''name_by_user'') = none, device_attr(trigger.entity_id, ''name_by_user''), device_attr(trigger.entity_id, ''name''), device_attr(trigger.entity_id, ''name''))}}: {{trigger.from_state.state}} -> {{trigger.to_state.state}}' - alias: system_esp_devices_status_to_on id: system_esp_devices_status_to_on initial_state: true mode: queued max: 15 max_exceeded: silent triggers: - trigger: state entity_id: - binary_sensor.esp32_strip_1s_bookshelf_mb_status - binary_sensor.digma_ir_k_status - binary_sensor.digma_ir_mb_status - binary_sensor.d1mini_light_l_status - binary_sensor.digma_strip_hb_status - binary_sensor.digma_ir_s_status - binary_sensor.digma_ir_v_status - binary_sensor.esp32_node_v_status - binary_sensor.esp32_node_k_status - binary_sensor.esp32_node_hs_status - binary_sensor.esp32_node_mb_status - binary_sensor.esp8266_oven_temp_k_status - binary_sensor.esp32_pzem_hb_status - binary_sensor.esp8266_hood_k_status - binary_sensor.esp32_strip_1s_wadrobe_mb_status - binary_sensor.sonoff_mini_1_status - binary_sensor.sonoff_mini_r4_kiosk_charger_status - binary_sensor.mono_strip_1_status - binary_sensor.sonoff_mini_4_status - binary_sensor.sonoff_pow_r2_1_status - binary_sensor.esp32_node_b_status - binary_sensor.esp32_node_b_valve_status - binary_sensor.sonoff_pow_r2_2_status - binary_sensor.esp32_node_s_status - binary_sensor.esp32_node_s_ha_connect_status - binary_sensor.esp32_domofon_status - binary_sensor.esp32_poe_ble_s_status - binary_sensor.d1mini_distance_sensor_status - binary_sensor.esp32_poe_ble_hs_status - binary_sensor.esp32_poe_ble_mb_status - binary_sensor.sonoff_pow_r2_3_status - binary_sensor.d1mini_bed_leds_status - binary_sensor.d1mini_air_freshener_status - binary_sensor.sp111_socket_1_status - binary_sensor.sonoff_basic_4_status - binary_sensor.esp32_strip_1s_entrance_hb_status - binary_sensor.esp32_strip_1s_wadrobe_hb_status from: 'off' to: 'on' for: seconds: 5 conditions: - condition: numeric_state entity_id: sensor.ha_uptime above: 0 actions: - action: notify.telegram data: message: '🟢 ESP: {{iif(device_attr(trigger.entity_id, ''name_by_user'') = none, device_attr(trigger.entity_id, ''name_by_user''), device_attr(trigger.entity_id, ''name''), device_attr(trigger.entity_id, ''name''))}}: {{trigger.from_state.state}} -> {{trigger.to_state.state}}' - alias: system_xiaomi_gw3_error id: system_xiaomi_gw3_error initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: system_log_event event_data: level: ERROR conditions: - condition: template value_template: '{{ "xiaomi_gateway3" in (trigger.event.data.message|string) or "xiaomi_gateway3" in (trigger.event.data.message|string) }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: notify.telegram data: message: ⛔ GW3 Ошибка обнаружена в логе - alias: system_fully_kiosk_connection id: system_fully_kiosk_connection initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: switch.kiosk_screen to: unavailable id: to_unavail for: minutes: 5 - trigger: state entity_id: switch.kiosk_screen from: unavailable id: from_unavail for: minutes: 1 conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: template value_template: '{{(as_timestamp(now())|int(0) - as_timestamp(state_attr(''automation.system_fully_browser_restart'', ''last_triggered''),0)|int(0)) > 5*60 }}' actions: - choose: - conditions: - condition: trigger id: to_unavail sequence: - action: notify.telegram data: message: '⛔ Fully: связь потеряна' - conditions: - condition: trigger id: from_unavail sequence: - action: notify.telegram data: message: '✅ Fully: связь восстановлена' - alias: system_already_running_log id: system_already_running_log initial_state: true max: 10 max_exceeded: silent mode: queued triggers: - trigger: event event_type: system_log_event event_data: level: WARNING conditions: - condition: template value_template: '{{ "Already running" in (trigger.event.data.message|string) }}' actions: - action: notify.telegram data: message: ⛔ Warning {{ trigger.event.data.message | join | e }} - alias: system_automation_reload id: system_automation_reload initial_state: true triggers: - trigger: event event_type: automation_reloaded actions: - action: notify.telegram data: message: 💬 Автоматизации перезагружены - alias: system_scripts_reload id: system_scripts_reload initial_state: true triggers: - trigger: event event_type: call_service event_data: domain: script service: reload actions: - action: notify.telegram data: message: 💬 Скрипты перезагружены - alias: system_devices_stats id: system_devices_stats initial_state: true triggers: - trigger: time at: '23:59:55' actions: - action: input_number.set_value data: entity_id: input_number.breather_v_run_time value: '{{ (states(''input_number.breather_v_run_time'') | float(0) + states(''sensor.breather_v_run_time_today'') | float(0)) | round(2, ''common'') }}' - action: input_number.set_value data: entity_id: input_number.breather_s_run_time value: '{{ (states(''input_number.breather_s_run_time'') | float(0) + states(''sensor.breather_s_run_time_today'') | float(0)) | round(2, ''common'') }}' - action: input_number.set_value data: entity_id: input_number.breather_mb_run_time value: '{{ (states(''input_number.breather_mb_run_time'') | float(0) + states(''sensor.breather_mb_run_time_today'') | float(0)) | round(2, ''common'') }}' - alias: system_ac_power_status id: system_ac_power_status initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d0003262acc_contact to: 'on' from: 'off' for: seconds: 3 - trigger: state entity_id: binary_sensor.0x00158d0003262acc_contact to: 'off' from: 'on' for: seconds: 3 actions: - action: notify.telegram data: message: '{% if is_state(''binary_sensor.0x00158d0003262acc_contact'',''on'') %}{{''\U00002705''}} Электроснабжение восстановлено {% else %}{{''\U0000274c''}} Внимание Электроснабжение прекращено {%endif%} ' - alias: system_esp_reboot id: system_esp_reboot initial_state: true mode: queued max: 15 max_exceeded: silent triggers: - trigger: state entity_id: - sensor.esp32_strip_1s_bookshelf_mb_uptime_s - sensor.digma_ir_k_uptime_s - sensor.digma_ir_mb_uptime_s - sensor.d1mini_light_l_uptime_s - sensor.digma_strip_hb_uptime_s - sensor.digma_ir_s_uptime_s - sensor.digma_ir_v_uptime_s - sensor.esp32_node_v_uptime_s - sensor.esp32_node_k_uptime_s - sensor.esp32_node_hs_uptime_s - sensor.esp32_node_mb_uptime_s - sensor.esp8266_oven_temp_k_uptime_s - sensor.esp32_pzem_hb_uptime_s - sensor.esp8266_hood_k_uptime_s - sensor.esp32_strip_1s_wadrobe_mb_uptime_s - sensor.sonoff_mini_1_uptime_s - sensor.sonoff_mini_r4_kiosk_charger_uptime_s - sensor.mono_strip_1_uptime_s - sensor.sonoff_mini_4_uptime_s - sensor.sonoff_pow_r2_1_uptime_s - sensor.esp32_node_b_uptime_s - sensor.sonoff_pow_r2_2_uptime_s - sensor.esp32_node_s_uptime_s - sensor.esp32_domofon_uptime_s - sensor.esp32_poe_ble_s_uptime_s - sensor.d1mini_distance_sensor_uptime_s - sensor.esp32_poe_ble_hs_uptime_s - sensor.esp32_poe_ble_mb_uptime_s - sensor.sonoff_pow_r2_3_uptime_s - sensor.d1mini_bed_leds_uptime_s - sensor.d1mini_air_freshener_uptime_s - sensor.sp111_socket_1_uptime_s - sensor.sonoff_basic_4_uptime_s from: unavailable for: seconds: 10 conditions: - condition: template value_template: '{{ 0 <= states(trigger.entity_id)|int(-1) < 30 }}' actions: - action: notify.telegram data: message: '♻ ESP: {{iif(device_attr(trigger.entity_id, ''name_by_user'') = none, device_attr(trigger.entity_id, ''name_by_user''), device_attr(trigger.entity_id, ''name''), device_attr(trigger.entity_id, ''name''))}} перезапустился, аптайм {{states(trigger.entity_id)|int(0)}}с' - alias: system_briefing_entities_force_update id: system_briefing_entities_force_update initial_state: true triggers: - trigger: time at: 06:50:00 id: id_morning - trigger: time at: '20:50:00' id: id_evening actions: - action: hassio.addon_restart data: addon: a0d7b954_appdaemon - condition: template value_template: "{%- set sensors = expand('group.weather_fcst_entities') %} {%-\ \ set act_time = as_timestamp(now()) %} {%- for sensor in sensors %}\n {%-\ \ if as_timestamp(sensor.last_updated) == as_timestamp(sensors | map(attribute='last_updated')\ \ | min ) %}\n {{ (act_time|int(0)-as_timestamp(sensor.last_updated)|int(0))>30*60\ \ }}\n {%- endif %}\n{%- endfor %}" - action: homeassistant.update_entity entity_id: - sensor.pirateweather_summary_0d - sensor.pirateweather_daytime_high_temperature_0d - sensor.pirateweather_precip_probability_0d - sensor.pirateweather_precip_0d - sensor.pirateweather_summary_1d - sensor.pirateweather_daytime_high_temperature_1d - sensor.pirateweather_precip_probability_1d - sensor.pirateweather_precip_1d - delay: seconds: 5 - action: input_number.set_value data: entity_id: input_number.temp_volume value: '{% set ent_id = ''media_player.yandex_st'' %} {% set vol = state_attr(ent_id,''volume_level'') %} {{ vol }} ' - action: input_number.set_value data: entity_id: input_number.tts_volume value: 0 - action: media_player.volume_set data: entity_id: media_player.yandex_st volume_level: '{{states("input_number.tts_volume")|float(0)}}' - action: media_player.volume_set data: entity_id: media_player.yandex_st volume_level: '{{states("input_number.tts_volume")|float(0)}}' - action: media_player.volume_set data: entity_id: media_player.yandex_st volume_level: '{{states("input_number.tts_volume")|float(0)}}' - repeat: while: - condition: template value_template: '{{ (as_timestamp(now()) - as_timestamp(state_attr(''sensor.yandex_response'',''time_fired'')) ) > 10 }}' - condition: template value_template: '{{ repeat.index <= 10 }}' sequence: - if: - condition: trigger id: id_morning then: - action: media_player.play_media data: entity_id: media_player.yandex_st media_content_id: какая сегодня погода media_content_type: question:tts_reply extra: volume_level: 0 else: - action: media_player.play_media data: entity_id: media_player.yandex_st media_content_id: какая завтра погода media_content_type: question:tts_reply extra: volume_level: 0 - delay: seconds: 3 - delay: seconds: 2 - if: - condition: template value_template: '{{ (as_timestamp(now()) - as_timestamp(state_attr(''sensor.yandex_response'',''time_fired'')) + 0 ) > 30 }}' then: - action: notify.telegram data: message: 🌤 Ошибка получения погоды. Последний апдейт - {{as_timestamp(state_attr('sensor.yandex_response','time_fired')) | timestamp_custom('%d-%m-%Y %H:%M:%S',true,0)}} - action: input_boolean.turn_on target: entity_id: input_boolean.ya_weather_error else: - action: input_boolean.turn_off target: entity_id: input_boolean.ya_weather_error - wait_template: '{% set ent_id = ''sensor.yandex_st'' + ''_alice_state'' %} {{ is_state(ent_id,''idle'') }} ' timeout: minutes: 5 - action: input_number.set_value data: entity_id: input_number.tts_volume value: '{{states("input_number.temp_volume")|float(0)}}' - action: media_player.volume_set data: entity_id: media_player.yandex_st volume_level: '{{states("input_number.tts_volume")|float(0)}}' - alias: system_hot_water_boolean_change id: system_hot_water_boolean_change initial_state: true triggers: - trigger: state entity_id: binary_sensor.hot_water to: null - trigger: homeassistant event: start - trigger: event event_type: automation_reloaded conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: template value_template: '{{ states(''binary_sensor.hot_water'') in [''on'',''off''] }}' actions: - action: input_boolean.turn_{{states('binary_sensor.hot_water')}} entity_id: input_boolean.hot_water - alias: system_cold_water_boolean_change id: system_cold_water_boolean_change initial_state: true triggers: - trigger: state entity_id: binary_sensor.cold_water to: null - trigger: homeassistant event: start - trigger: event event_type: automation_reloaded conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: template value_template: '{{ states(''binary_sensor.cold_water'') in [''on'',''off''] }}' actions: - action: input_boolean.turn_{{states('binary_sensor.cold_water')}} entity_id: input_boolean.cold_water - alias: system_central_heating_boolean_change id: system_central_heating_boolean_change initial_state: true triggers: - trigger: state entity_id: binary_sensor.central_heating to: null - trigger: homeassistant event: start - trigger: event event_type: automation_reloaded conditions: - condition: template value_template: '{{ is_state(''binary_sensor.central_heating'',''on'') or is_state(''binary_sensor.central_heating'',''off'') }}' actions: - action: input_boolean.turn_{{states('binary_sensor.central_heating')}} entity_id: input_boolean.central_heating - alias: system_light_dark_mode_on_action id: system_light_dark_mode_on_action initial_state: true triggers: - trigger: state entity_id: switch.system_dark_mode from: 'off' to: 'on' actions: - action: light.turn_off entity_id: - light.esp32_node_k_light - light.mono_strip_1_light - light.0x54ef441000680083_channel_2 - light.round_led_st - light.esp32_strip_1s_entrance_hb_rgb - light.esp32_strip_1s_wadrobe_hb_rgb - alias: system_config_entry_discovery id: system_config_entry_discovery mode: single max_exceeded: silent initial_state: true triggers: - trigger: state entity_id: persistent_notification.config_entry_discovery to: notifying conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: notify.telegram data: message: 📟 Найдено новое устройство - alias: system_gw3_devices_msg_missed id: system_gw3_devices_msg_missed initial_state: false mode: queued max: 70 triggers: - trigger: event event_type: state_changed conditions: - condition: numeric_state entity_id: sensor.ha_uptime above: 1 - condition: state entity_id: input_boolean.ha_shutdown state: 'off' - condition: template value_template: '{{ trigger.event.data.entity_id in expand(''group.gw3_zigbee_entities'') | map(attribute=''entity_id'') | list }}' - condition: template value_template: '{{ state_attr(trigger.event.data.entity_id, ''last_missed'') |int(0) > 9 }}' actions: - action: notify.telegram data: message: ⏭ Внимание {{iif(device_attr(trigger.event.data.entity_id, 'name_by_user') = none, device_attr(trigger.event.data.entity_id, 'name_by_user'), device_attr(trigger.event.data.entity_id, 'name'), device_attr(trigger.event.data.entity_id, 'name'))}} пропустил {{ state_attr(trigger.event.data.entity_id, 'last_missed') | format(morph='пакет', as_text=false) }} - alias: system_esphome_ble_advert id: system_esphome_ble_advert mode: parallel max: 500 max_exceeded: silent initial_state: true triggers: - trigger: event event_type: esphome.on_ble_advertise actions: - action: ble_monitor.parse_data data: packet: '{{ trigger.event.data.packet }}' gateway_id: '{{ trigger.event.data.gateway_id }}' - alias: system_music_restrictions id: system_music_restrictions mode: single max_exceeded: silent initial_state: true triggers: - trigger: state entity_id: media_player.yandex_s to: playing id: by_state - trigger: time at: '23:00:00' id: by_time conditions: - condition: state entity_id: switch.system_music_allowed state: 'off' - condition: template value_template: '{{states(''sensor.time'').split('':'')[0]|int >= 23 or states(''sensor.time'').split('':'')[0]|int < 7}}' actions: - if: - condition: trigger id: by_time then: - action: media_player.turn_off entity_id: media_player.yandex_s - action: media_player.turn_off entity_id: media_player.yandex_v - delay: seconds: 3 - action: media_player.turn_off entity_id: media_player.yandex_s - action: media_player.turn_off entity_id: media_player.yandex_v - if: - condition: trigger id: on_state then: - action: media_player.turn_off entity_id: media_player.yandex_s - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: media_player.yandex_s media_content_id: Сашенька, ночью надо спать, а не сказки слушать Спокойной ночи extra: volume_level: '0.2' - alias: system_supervisor_unhealthy id: system_supervisor_unhealthyn initial_state: true triggers: - trigger: state entity_id: binary_sensor.supervisor_is_healthy to: null actions: - choose: - conditions: - condition: state entity_id: binary_sensor.supervisor_is_healthy state: 'on' sequence: - action: notify.telegram data: message: ✅ Supevisor перешел в состояние Healthy default: - action: notify.telegram data: message: ❌ Supevisor перешел в состояние Unhealthy - alias: system_ya_station_mode id: system_ya_station_mode mode: queued max: 10 max_exceeded: silent initial_state: true triggers: - trigger: state id: non_local entity_id: - binary_sensor.yandex_k - binary_sensor.yandex_s - binary_sensor.yandex_hb - binary_sensor.yandex_v - binary_sensor.yandex_mb from: 'off' to: 'on' - trigger: state entity_id: - binary_sensor.yandex_k - binary_sensor.yandex_s - binary_sensor.yandex_hb - binary_sensor.yandex_v - binary_sensor.yandex_mb from: 'on' to: 'off' actions: - action: notify.telegram data: message: 🔊 Станция {{trigger.to_state.name | e}} {% if trigger.id == 'non_local' -%} отключила локальный режим управления {%- else -%} перешла в локальный режим управления {%- endif %} - alias: system_fully_integration_reload id: system_fully_integration_reload initial_state: true triggers: - trigger: time_pattern minutes: /10 conditions: - condition: state entity_id: sensor.kiosk_battery state: - unknown - unavailable for: minutes: 5 actions: - action: homeassistant.reload_config_entry data: entry_id: 2eb872806bf50b75953836ae0584662b - alias: system_fully_tablet_charge_on id: system_fully_tablet_charge_on initial_state: true triggers: - trigger: time_pattern minutes: /15 conditions: - condition: numeric_state entity_id: sensor.kiosk_battery below: 20 actions: - action: notify.telegram data: message: '🔌 Fully: Принудительное включение зарядки' - action: switch.turn_on entity_id: switch.sonoff_mini_r4_kiosk_charger_relay - alias: system_fully_browser_restart id: system_fully_browser_restart initial_state: true triggers: - trigger: time_pattern hours: /2 id: auto - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.28d1273bc2f4_action click_type: single id: manual actions: - action: button.press entity_id: button.kiosk_restart_browser - action: timer.start entity_id: timer.kiosk_restart_manual - alias: system_repair_event_notify id: system_repair_event_notify initial_state: true mode: queued max: 50 max_exceeded: silent triggers: - trigger: event event_type: repairs_issue_registry_updated event_data: service: create actions: - action: notify.telegram data: message: '🐛 Проблема в {{ trigger.event.data.domain | e }}, детали: {{ trigger.event.data.issue_id | e }}' - alias: system_repair_sensor_update id: system_repair_sensor_update mode: restart triggers: - trigger: event event_type: repairs_issue_registry_updated event_data: service: create - trigger: homeassistant event: start actions: - action: homeassistant.update_entity data: entity_id: sensor.repairs_state - alias: system_day_night_switch id: system_day_night_switch initial_state: true triggers: - trigger: state entity_id: binary_sensor.tod_day to: 'on' conditions: - condition: state entity_id: switch.system_security_mode state: 'off' actions: - action: switch.turn_off entity_id: switch.system_silent_mode - alias: system_doorbell_volume id: system_doorbell_volume initial_state: true triggers: - trigger: time_pattern hours: /1 - trigger: homeassistant event: start actions: - action: number.set_value data: entity_id: number.up_chime_volume value: '{{iif(is_state(''switch.system_silent_mode'',''on''),0,80) }}' - alias: system_ds621_set_fan_speed id: system_ds621_set_fan_speed initial_state: true triggers: - trigger: state entity_id: input_select.ds1621_fan_speed_select to: null actions: - action: mqtt.publish data: payload: '{{ states(''input_select.ds1621_fan_speed_select'') | lower }}' topic: 1621/fan_speed_set retain: true - alias: system_nodes_net_speed_change id: system_nodes_net_speed_change initial_state: true mode: queued max: 50 max_exceeded: silent triggers: - trigger: state entity_id: - sensor.ms01a_enp3s0f0np0_speed - sensor.ms01a_enp3s0f1np1_speed - sensor.ms01a_enp88s0_speed - sensor.ms01a_enp90s0_speed - sensor.ms01a_enp1s0f0_speed - sensor.ms01a_enp1s0f1_speed - sensor.ms01a_enp1s0f2_speed - sensor.ms01a_enp1s0f3_speed - sensor.ms01b_enp3s0f0np0_speed - sensor.ms01b_enp3s0f1np1_speed - sensor.ms01b_enp88s0_speed - sensor.ms01b_enp90s0_speed - sensor.ms01b_enp1s0f0_speed - sensor.ms01b_enp1s0f1_speed - sensor.ms01b_enp1s0f2_speed - sensor.ms01b_enp1s0f3_speed to: null actions: - variables: old_value: '{%if trigger.from_state.state|float(0) < 1000 %} {{trigger.from_state.state}} Mb/s {%elif trigger.from_state.state|float(0) >= 1000 %} {{trigger.from_state.state|int(0) / 1000 }} Gb/s {%endif%}' new_value: '{%if trigger.to_state.state|float(0) < 1000 %} {{trigger.to_state.state}} Mb/s {%elif trigger.to_state.state|float(0) >= 1000 %} {{trigger.to_state.state|int(0) / 1000 }} Gb/s {%endif%}' - action: notify.telegram data: message: '🚦 {{trigger.to_state.name}}: {{old_value}} -> {{new_value}}' - alias: system_primary_ip_change id: system_primary_ip_change initial_state: true mode: queued max: 50 max_exceeded: silent triggers: - trigger: state entity_id: sensor.udm_last_active_ip to: null actions: - action: notify.telegram data: message: '🚦 {{trigger.to_state.name}}: {{trigger.from_state.state}} -> {{trigger.to_state.state}}' - alias: system_plex_status_change id: system_plex_status_change initial_state: true mode: queued max: 50 max_exceeded: silent triggers: - trigger: state entity_id: sensor.plex_12 to: unavalable id: id_to - trigger: state entity_id: sensor.plex_12 from: unavalable id: id_from actions: - choose: - conditions: - condition: trigger id: id_to sequence: - action: notify.telegram data: message: 🔴 Plex went offline - conditions: - condition: trigger id: id_from sequence: - action: notify.telegram data: message: 🟢 Plex back online - alias: system_retart_gateway id: system_retart_gateway initial_state: true mode: queued max: 50 max_exceeded: silent triggers: - trigger: numeric_state entity_id: sensor.gateway3a_hb_free_memory below: 10000 for: hours: 1 actions: - action: select.select_option data: option: reboot target: entity_id: select.54ef443f1fac_command - action: notify.telegram data: message: 🔴 Gateway HB restart - alias: system_googlevideo_unavalable id: system_googlevideo_unavalable initial_state: true mode: queued max: 50 max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.googlevideo_com to: 'off' for: minutes: 1 id: to_off - trigger: state entity_id: binary_sensor.googlevideo_com to: 'on' for: minutes: 1 id: to_on actions: - choose: - conditions: - condition: trigger id: to_off sequence: - action: input_boolean.turn_on target: entity_id: input_boolean.googlevideo_error - action: notify.telegram data: message: 🔴 Googlevideo connection lost - conditions: - condition: trigger id: to_on - condition: state entity_id: input_boolean.googlevideo_error state: 'on' sequence: - action: input_boolean.turn_off target: entity_id: input_boolean.googlevideo_error - action: notify.telegram data: message: 🟢 Googlevideo connection restored - alias: system_1621_go2rtc_streamcount id: system_1621_go2rtc_streamcount initial_state: true mode: queued max: 50 max_exceeded: silent triggers: - trigger: state entity_id: sensor.1621_go2rtc_active_streams to: null for: seconds: 30 conditions: - condition: state entity_id: sensor.1621_go2rtc_active_streams state: '0' actions: - action: button.press entity_id: button.kiosk_load_start_url - alias: system_health_cpu_temp id: system_health_cpu_temp initial_state: true mode: queued max: 5 max_exceeded: silent triggers: - trigger: numeric_state entity_id: sensor.ms01a_cpu_temp, sensor.ms01b_cpu_temp, sensor.pbs100_cpu_temp above: 95 for: minutes: 5 id: temp_95 - trigger: numeric_state entity_id: sensor.ms01a_cpu_temp, sensor.ms01b_cpu_temp, sensor.pbs100_cpu_temp above: 80 for: minutes: 5 id: temp_80 actions: - choose: - conditions: - condition: trigger id: temp_95 sequence: - parallel: - action: notify.mobile_app_iphone_16_pro_dima data: title: Внимание! message: '{{ trigger.to_state.attributes.friendly_name }} >90°' data: push: sound: name: default critical: 1 volume: 1.0 - action: notify.telegram data: message: 🔥 Внимание! {{ trigger.to_state.attributes.friendly_name }} >90° - conditions: - condition: trigger id: temp_80 sequence: - parallel: - action: notify.telegram data: message: 🔥 Внимание! {{ trigger.to_state.attributes.friendly_name }} >80° - alias: system_health_ssd_temp_70 id: system_health_ssd_temp_70 initial_state: true mode: queued max: 5 max_exceeded: silent triggers: - trigger: numeric_state entity_id: - sensor.ms01a_nvme0_temp - sensor.ms01a_nvme1_temp - sensor.ms01b_nvme0_temp - sensor.ms01b_nvme1_temp - sensor.pbs100_nvme0_temp - sensor.pbs100_sda_temp above: 70 for: minutes: 3 actions: - action: notify.telegram data: message: 🌡 Внимание! {{ trigger.to_state.attributes.friendly_name }} >70°! - alias: system_health_synology_disks_status id: system_health_synology_disks_status initial_state: true mode: queued max: 15 max_exceeded: silent triggers: - trigger: state entity_id: - sensor.ds1621plus_drive_1_status - sensor.ds1621plus_drive_2_status - sensor.ds1621plus_drive_3_status - sensor.ds1621plus_drive_5_status - sensor.ds1621plus_drive_6_status - sensor.ds1621plus_m_2_drive_1_status - sensor.ds1621plus_m_2_drive_2_status - sensor.ds1621plus_drive_1_status_smart - sensor.ds1621plus_drive_2_status_smart - sensor.ds1621plus_drive_3_status_smart - sensor.ds1621plus_drive_5_status_smart - sensor.ds1621plus_drive_6_status_smart - sensor.ds1621plus_m_2_drive_1_status_smart - sensor.ds1621plus_m_2_drive_2_status_smart - sensor.ds920plus_drive_1_status - sensor.ds920plus_drive_2_status - sensor.ds920plus_drive_3_status - sensor.ds920plus_drive_4_status - sensor.ds920plus_cache_device_1_status - sensor.ds920plus_cache_device_2_status - sensor.ds920plus_drive_1_status_smart - sensor.ds920plus_drive_2_status_smart - sensor.ds920plus_drive_3_status_smart - sensor.ds920plus_drive_4_status_smart - sensor.ds920plus_cache_device_1_status_smart - sensor.ds920plus_cache_device_2_status_smart to: null for: minutes: 1 conditions: - condition: template value_template: '{{ trigger.to_state.state != trigger.from_state.state and trigger.to_state.state not in [''unavailable''] and trigger.from_state.state not in [''unavailable''] }}' actions: - action: notify.telegram data: message: '🧰 Внимание! {{ trigger.to_state.name }}: {{ trigger.from_state.state }} -> {{ trigger.to_state.state }}!' - alias: toilet_tank_counter id: toilet_tank_counter initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d0003262a35_contact from: 'off' to: 'on' conditions: - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ trigger.from_state.state\ \ not in ignore and\n trigger.to_state.state not in ignore and\n trigger.to_state.state\ \ != trigger.from_state.state\n}}\n" actions: - action: counter.increment entity_id: counter.toilet_tank - alias: toilet_air_freshener_counter id: toilet_air_freshener_counter initial_state: true triggers: - trigger: state entity_id: number.d1mini_air_freshener_counter to: null conditions: - condition: template value_template: '{{ trigger.to_state.state|int(0) > trigger.from_state.state|int(0) }}' - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none'] %} {{ trigger.from_state.state\ \ not in ignore and\n trigger.to_state.state not in ignore and\n trigger.to_state.state\ \ != trigger.from_state.state\n}}\n" - condition: template value_template: '{{ (states(''sensor.d1mini_air_freshener_canister_left'')|int(0) < 10) and (states(''number.d1mini_air_freshener_counter'')|int(0) % 25) == 0 }}' actions: - action: notify.telegram data: message: 🔋 Необходимо заменить баллон в освежителе - осталось менее {{states('sensor.d1mini_air_freshener_canister_left')|int(0)}}%! - alias: toilet_air_freshener_spray id: toilet_air_freshener_spray initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.0x00158d000232ddd6_contact from: 'off' to: 'on' for: minutes: 2 conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: group.lights_t state: 'on' - condition: state entity_id: fan.esp32_node_b_fan_t state: 'off' actions: - if: - condition: state entity_id: switch.esp32_node_b_fan_b_manual_mode state: 'off' then: - action: fan.turn_on entity_id: fan.esp32_node_b_fan_t - wait_for_trigger: - trigger: state entity_id: binary_sensor.0x00158d000232ddd6_contact to: 'off' for: seconds: 10 timeout: minutes: 30 continue_on_timeout: false - action: timer.cancel entity_id: timer.fan_t - action: timer.start entity_id: timer.short_fan_t - condition: template value_template: '{{(as_timestamp(now()) - as_timestamp(states.button.d1mini_air_freshener_spray.last_changed)|int(0)) > 60 }}' - action: button.press entity_id: button.d1mini_air_freshener_spray - alias: toilet_air_freshener_spray_manual id: toilet_air_freshener_spray_manual initial_state: true mode: single max_exceeded: silent triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001b97111_action click_type: double actions: - action: button.press entity_id: button.d1mini_air_freshener_spray - alias: toilet_heater_control id: toilet_heater_control initial_state: true triggers: - trigger: state entity_id: binary_sensor.heater_trigger_t to: null actions: - if: - condition: state entity_id: binary_sensor.heater_trigger_t state: 'on' then: - action: climate.turn_on entity_id: climate.sonoff_pow_r2_2_wall_heater else: - action: climate.turn_off entity_id: climate.sonoff_pow_r2_2_wall_heater - alias: toilet_close_seat_notify id: toilet_close_seat_notify initial_state: true triggers: - trigger: state entity_id: binary_sensor.seat_not_closed from: 'off' to: 'on' conditions: - condition: state entity_id: binary_sensor.tod_day state: 'on' - condition: state entity_id: switch.system_dark_mode state: 'off' - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.toilet_close_seat_notify'', ''last_triggered''),0)|int(0)) > 15 }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - wait_for_trigger: - trigger: state entity_id: light.0x00158d0002a36f7f_channel_1 to: 'off' for: seconds: 3 - trigger: state entity_id: light.esp32_node_b_light to: 'off' for: seconds: 3 - trigger: state entity_id: binary_sensor.0x00158d0001ef2ffc_contact to: 'on' for: seconds: 3 - trigger: state entity_id: binary_sensor.0x00158d0001ef2ffc_contact to: 'off' timeout: minutes: 20 continue_on_timeout: false - condition: state entity_id: binary_sensor.seat_not_closed state: 'on' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: media_player.yandex_k media_content_id: Пож+алуйста закр+ойте кр+ышку унит+аза! extra: volume_level: '{{states("input_number.main_volume")|float(0) + 0.1}}' - wait_for_trigger: - trigger: state entity_id: binary_sensor.0x00158d000232ddd6_contact to: 'off' timeout: minutes: 5 continue_on_timeout: false - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: media_player.yandex_k media_content_id: Больш+ое спас+ибо! - alias: toilet_donedeal id: toilet_donedeal initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Я покакала actions: - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: '{{ trigger.event.data.entity_id }}' media_content_id: '{{[''С облегчением!'',''Так держать!'',''Красава!'',''Красавелла!'',''Рада за тебя!'',''Давай еще!'']|random}}' extra: volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: button.press entity_id: button.d1mini_air_freshener_spray - action: fan.turn_on entity_id: fan.esp32_node_b_fan_t - delay: seconds: 5 - action: button.press entity_id: button.d1mini_air_freshener_spray - alias: system_update_available_and_installed_notification id: system_update_available_and_installed_notification initial_state: false mode: queued max: 10 max_exceeded: silent triggers: - trigger: event event_type: state_changed conditions: - '{{ trigger.event.data.entity_id.startswith(''update.'') }}' - '{{ trigger.event.data.old_state is not none and trigger.event.data.new_state is not none }}' - or: - condition: template value_template: "{{ \n trigger.event.data.new_state.state == 'on' and\n ((is_state_attr(trigger.event.data.entity_id,\ \ 'device_class', 'firmware')\n and version(trigger.event.data.new_state.attributes.latest_version)\ \ != version(trigger.event.data.old_state.attributes.latest_version))\n or\ \ version(trigger.event.data.new_state.attributes.latest_version) > version(trigger.event.data.old_state.attributes.latest_version))\ \ and\n trigger.event.data.new_state.attributes.latest_version not in not_has_state\ \ and\n trigger.event.data.new_state.attributes.latest_version is not none\n\ }}\n" - condition: template value_template: "{{ \n trigger.event.data.old_state.state == 'on' and trigger.event.data.new_state.state\ \ == 'off' and\n ((is_state_attr(trigger.event.data.entity_id, 'device_class',\ \ 'firmware')\n and version(trigger.event.data.new_state.attributes.installed_version)\ \ != version(trigger.event.data.old_state.attributes.installed_version))\n\ \ or version(trigger.event.data.new_state.attributes.installed_version) >\ \ version(trigger.event.data.old_state.attributes.installed_version)) and\n\ \ trigger.event.data.new_state.attributes.installed_version not in not_has_state\ \ and\n trigger.event.data.new_state.attributes.installed_version is not\ \ none\n}}\n" actions: - variables: latest_version: '{{ trigger.event.data.new_state.attributes.latest_version }}' installed_version: '{{ state_attr(trigger.event.data.entity_id, ''installed_version'') }}' old_installed_version: '{{ trigger.event.data.old_state.attributes.installed_version }}' friendlyname: '{{- trigger.event.data.new_state.name | replace('' Update'', '''') -}}' - if: - condition: template value_template: '{{ trigger.event.data.new_state.attributes.installed_version != trigger.event.data.old_state.attributes.installed_version }}' then: - action: notify.telegram data: message: 🎊 {{ friendlyname }} обновлен с {{ old_installed_version }} на {{ latest_version }} else: - action: notify.telegram data: message: 🛠 {{ friendlyname }} доступна новая версия {{ latest_version }}. Текущая {{ installed_version }} - alias: hall_big_main_power_turned_off id: hall_big_main_power_turned_off initial_state: true triggers: - trigger: state entity_id: switch.0x00158d000230fc52_outlet to: 'off' from: 'on' actions: - action: notify.telegram data: message: 🔌 Внимание! Главная розетка отключена! Запущен UPS (1200) - alias: hall_big_main_plug_pulled_out id: hall_big_main_plug_pulled_out initial_state: true triggers: - trigger: numeric_state entity_id: sensor.0x00158d000230fc52_power below: 10 actions: - action: notify.telegram data: message: 🔌 Внимание! Нагрузка в главной розетке упала! Проверь кабель! - alias: hall_big_main_power_overpower id: hall_big_main_power_overpower initial_state: true triggers: - trigger: numeric_state entity_id: sensor.0x00158d000230fc52_power above: 1700 actions: - action: notify.telegram data: message: 🔌 Внимание! Перегрузка главной розетки! Отключите лишние потребители! - alias: hall_big_main_power_turned_on id: hall_big_main_power_turned_on initial_state: true triggers: - trigger: state entity_id: switch.0x00158d000230fc52_outlet to: 'on' from: 'off' actions: - action: notify.telegram data: message: 🔌 Электроснабжение восстановлено! Начинаем зарядку UPS(1200)! - alias: hall_big_ups_states id: hall_big_ups_states initial_state: true triggers: - trigger: state entity_id: sensor.ippon_1500_status_data to: null conditions: - condition: template value_template: '{{ trigger.to_state.state != trigger.from_state.state }}' actions: - choose: - conditions: - condition: template value_template: '{{ trigger.to_state.state == ''OB DISCHRG'' or trigger.to_state.state == ''OB'' }}' sequence: - parallel: - action: notify.telegram data: message: 🔋 Внимание! Запущен UPS (1200)! - action: notify.mobile_app_iphone_16_pro_dima data: title: Внимание! message: Запущен UPS (1200) - conditions: - condition: template value_template: '{{ trigger.to_state.state == ''LB'' or trigger.to_state.state == ''FSD OB DISCHRG LB''}}' sequence: - parallel: - action: notify.telegram data: message: 🚨 Внимание! Заряд батареи (1200) критический! Завершение работы через 10сек! - action: notify.mobile_app_iphone_16_pro_dima data: title: Внимание! message: UPS полностью разряжен! Завершаем работу через 10сек! data: push: sound: name: default critical: 1 volume: 1.0 - delay: seconds: 10 - action: hassio.host_shutdown - conditions: - condition: template value_template: '{{ trigger.to_state.state == ''OL CHRG'' or trigger.to_state.state == ''OL''}}' - condition: template value_template: '{{ trigger.from_state.state not in [''unknown'',''unavailable'',''none''] }}' sequence: - action: notify.telegram data: message: 🔋 Питание восстановлено! Начинаем заряд батареи (1200)! - conditions: - condition: template value_template: '{{ trigger.to_state.state in [''unknown'',''unavailable''] }}' - condition: template value_template: '{{ trigger.from_state.state not in [''unknown'',''unavailable'',''none''] }}' sequence: - action: notify.telegram data: message: 🚨 Внимание! Связь с UPS(1200) потеряна! - conditions: - condition: template value_template: '{{ trigger.from_state.state in [''unknown'',''unavailable''] }}' - condition: template value_template: '{{ trigger.to_state.state not in [''unknown'',''unavailable'',''none''] }}' sequence: - action: notify.telegram data: message: 🚨 Внимание! Связь с UPS(1200) восстановлена! - alias: system_water_cold_water_increase_counter id: system_water_cold_water_increase_counter initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d0006d31d78_contact from: 'on' to: 'off' for: seconds: 5 actions: - action: input_number.set_value data: entity_id: input_number.cold_water_meter value: '{{ (states(''input_number.cold_water_meter'')|float(0) + 0.01 ) | round(2, ''common'') }}' - action: input_number.set_value data: entity_id: input_number.cold_water_meter_month value: '{{ (states(''input_number.cold_water_meter_month'')|float(0) + 0.01 ) | round(2, ''common'') }}' - action: mqtt.publish data: topic: utility/main/cold_water_meter payload: '{{states(''input_number.cold_water_meter'')|float(0)}}' retain: true - action: mqtt.publish data: topic: utility/main/cold_water_meter_month payload: '{{states(''input_number.cold_water_meter_month'')|float(0)}}' retain: true - alias: system_water_hot_water_increase_counter id: system_water_hot_water_increase_counter initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d000236fcd5_contact from: 'on' to: 'off' for: seconds: 5 actions: - action: input_number.set_value data: entity_id: input_number.hot_water_meter value: '{{ (states(''input_number.hot_water_meter'')|float(0) + 0.01 ) | round(2, ''common'') }}' - action: input_number.set_value data: entity_id: input_number.hot_water_meter_month value: '{{ (states(''input_number.hot_water_meter_month'')|float(0) + 0.01 ) | round(2, ''common'') }}' - action: mqtt.publish data: topic: utility/main/hot_water_meter payload: '{{states(''input_number.hot_water_meter'')|float(0)}}' retain: true - action: mqtt.publish data: topic: utility/main/hot_water_meter_month payload: '{{states(''input_number.hot_water_meter_month'')|float(0)}}' retain: true - alias: system_power_meter_daily id: system_power_meter_daily initial_state: true triggers: - trigger: time at: '23:59:30' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.esp32_pzem_hb_status state: 'on' sequence: - action: input_number.set_value data: entity_id: input_number.power_meter_t1 value: '{{ ((states(''input_number.power_meter_t1'')) | float(0) + states(''sensor.esp32_pzem_hb_energy_daily_day'')|float(0)/1 )|round(2, ''common'') }}' - action: input_number.set_value data: entity_id: input_number.power_meter_t2 value: '{{ ((states(''input_number.power_meter_t2'')) | float(0) + states(''sensor.esp32_pzem_hb_energy_daily_night'')|float(0)/1 )|round(2, ''common'') }}' - action: mqtt.publish data: topic: utility/main/energy/day payload: '{{ states(''input_number.power_meter_t1'') }}' retain: true - action: mqtt.publish data: topic: utility/main/energy/night payload: '{{ states(''input_number.power_meter_t2'') }}' retain: true - action: notify.telegram data: message: 🔌 Данные счетчика электричества обновлены! D {{states('sensor.esp32_pzem_hb_energy_daily_day')|int(0)}}, N {{states('sensor.esp32_pzem_hb_energy_daily_night')|int(0)}} - conditions: - condition: state entity_id: binary_sensor.esp32_pzem_hb_status state: 'off' sequence: - action: notify.telegram data: message: 🔌 PZEM недоступен! Ожидаем - wait_for_trigger: - trigger: state entity_id: binary_sensor.esp32_pzem_hb_status to: 'on' timeout: seconds: 28 continue_on_timeout: false - action: notify.telegram data: message: 🔌 PZEM доступен! - action: input_number.set_value data: entity_id: input_number.power_meter_t1 value: '{{ ((states(''input_number.power_meter_t1'')) | float(0) + states(''sensor.esp32_pzem_hb_energy_daily_day'')|float(0)/1 )|round(2, ''common'') }}' - action: input_number.set_value data: entity_id: input_number.power_meter_t2 value: '{{ ((states(''input_number.power_meter_t2'')) | float(0) + states(''sensor.esp32_pzem_hb_energy_daily_night'')|float(0)/1 )|round(2, ''common'') }}' - action: mqtt.publish data: topic: utility/main/energy/day payload: '{{ states(''input_number.power_meter_t1'') }}' retain: true - action: mqtt.publish data: topic: utility/main/energy/night payload: '{{ states(''input_number.power_meter_t2'') }}' retain: true - action: notify.telegram data: message: 🔌 Данные счетчика электричества обновлены! - alias: system_new_month_notification id: system_new_month_notification initial_state: true triggers: - trigger: time at: 00:00:10 conditions: - '{{ now().timestamp() | timestamp_custom(''%d'') | int(0) == 21 }}' actions: - action: mqtt.publish data: topic: utility/main/{{now().year}}/{{now().month}}/hot_water_meter payload: '{{states(''input_number.hot_water_meter'')|float(0)}}' retain: true - action: mqtt.publish data: topic: utility/main/{{now().year}}/{{now().month}}/cold_water_meter payload: '{{states(''input_number.cold_water_meter'')|float(0)}}' retain: true - action: mqtt.publish data: topic: utility/main/{{now().year}}/{{now().month}}/power_meter_t1 payload: '{{((states(''input_number.power_meter_t1''))|float(0))}}' retain: true - action: mqtt.publish data: topic: utility/main/{{now().year}}/{{now().month}}/power_meter_t2 payload: '{{((states(''input_number.power_meter_t2''))|float(0))}}' retain: true - action: mqtt.publish data: topic: utility/main/{{now().year}}/{{now().month}}/timestamp payload: '{{as_timestamp(now()) | timestamp_custom(''%d-%m-%Y %H:%M:%S'',true,0)}}' retain: true - action: notify.telegram data: message: '{{ "\U0001f4a6" }} Показания счетчиков: ХВС: {{ states(''input_number.cold_water_meter'')|float(0) }}м3 ГВС: {{ states(''input_number.hot_water_meter'')|float(0) }}м3 За месяц: ХВС: {{ states(''input_number.cold_water_meter_month'')|float(0) }}м3 ГВС: {{ states(''input_number.hot_water_meter_month'')|float(0) }}м3 Стоимость: {{ ((states(''sensor.water_cost''))|float(0))}}руб. ' - action: notify.telegram data: message: '{{ "\U0001f50c" }} Показания счетчика: Т1: {{ ((states(''input_number.power_meter_t1''))|float(0))}} кВт*ч Т2: {{ ((states(''input_number.power_meter_t2''))|float(0))}} кВт*ч За месяц: Т1: {{ ((states(''sensor.esp32_pzem_hb_energy_monthly_day'')|float(0)))|round(0, ''common'')}} кВт*ч Т2: {{ ((states(''sensor.esp32_pzem_hb_energy_monthly_night'')|float(0)))|round(0, ''common'')}} кВт*ч Стоимость: {{ ((states(''sensor.power_cost''))|float(0)) }} руб. ' - action: input_number.set_value data: entity_id: input_number.power_meter_last_month_t1 value: '{{ states(''input_number.power_meter_t1'')|float(0)}}' - action: input_number.set_value data: entity_id: input_number.power_meter_last_month_t2 value: '{{ states(''input_number.power_meter_t2'')|float(0)}}' - action: switch.turn_on entity_id: switch.esp32_pzem_hb_energy_reset_all - delay: seconds: 10 - action: switch.turn_on entity_id: switch.esp32_pzem_hb_energy_reset_uart - action: input_number.set_value data: entity_id: input_number.hot_water_meter_last_month value: '{{ states(''input_number.hot_water_meter'')|float(0) }}' - action: input_number.set_value data: entity_id: input_number.cold_water_meter_last_month value: '{{ states(''input_number.cold_water_meter'')|float(0) }}' - action: input_number.set_value data: entity_id: - input_number.hot_water_meter_month - input_number.cold_water_meter_month value: 0 - alias: system_power_15A_current id: system_power_15A_current initial_state: true triggers: - trigger: numeric_state entity_id: sensor.esp32_pzem_hb_current above: 15 below: 20 conditions: - condition: template value_template: '{{ (as_timestamp(now())|int(0) - as_timestamp(state_attr(''automation.system_power_15A_current'', ''last_triggered''),0)|int(0)) > 10*60 }}' actions: - action: notify.telegram data: message: 🚨 Внимание! Общий ток более 15А! - alias: system_power_20A_current id: system_power_20A_current initial_state: true triggers: - trigger: numeric_state entity_id: sensor.esp32_pzem_hb_current above: 20 below: 30 conditions: - condition: template value_template: '{{ (as_timestamp(now())|int(0) - as_timestamp(state_attr(''automation.system_power_20A_current'', ''last_triggered''),0)|int(0)) > 10*60 }}' actions: - action: notify.telegram data: message: 🚨 Внимание! Общий ток более 20А! - alias: system_power_30A_current id: system_power_30A_current initial_state: true triggers: - trigger: numeric_state entity_id: sensor.esp32_pzem_hb_current above: 30 below: 40 conditions: - condition: template value_template: '{{ (as_timestamp(now())|int(0) - as_timestamp(state_attr(''automation.system_power_30A_current'', ''last_triggered''),0)|int(0)) > 10*60 }}' actions: - parallel: - action: notify.telegram data: message: 🚨 Внимание! Общий ток более 30А! data: push: sound: name: default critical: 1 volume: 1.0 - action: notify.mobile_app_iphone_16_pro_dima data: title: Внимание! message: Внимание! Общий ток более 30А - alias: system_high_power_while_not_home id: system_high_power_while_not_home initial_state: true triggers: - trigger: time_pattern minutes: /10 conditions: - condition: template value_template: '{{ is_state(''switch.system_security_mode'',''on'') }}' - condition: numeric_state entity_id: sensor.esp32_pzem_hb_power above: 1200 actions: - parallel: - action: notify.telegram data: message: 🚨 Внимание! Охрана Вкл! Высокое потребление электричества {{states('sensor.esp32_pzem_hb_power')|int(0)}}Вт! - action: notify.mobile_app_iphone_16_pro_dima data: title: Внимание! message: Охрана Вкл! Высокое потребление электричества {{states('sensor.esp32_pzem_hb_power')|int(0)}}Вт! data: push: sound: name: default critical: 1 volume: 1.0 - alias: system_water_consumption_not_home id: system_water_consumption_not_home initial_state: true triggers: - trigger: state entity_id: binary_sensor.0x00158d0006d31d78_contact from: 'on' to: 'off' for: seconds: 5 - trigger: state entity_id: binary_sensor.0x00158d000236fcd5_contact from: 'on' to: 'off' for: seconds: 5 conditions: - condition: template value_template: '{{ is_state(''switch.system_security_mode'',''on'') }}' actions: - parallel: - action: notify.telegram data: message: 🚨 Внимание! Охрана Вкл! Потребление {% if 'Hot' in trigger.to_state.attributes.friendly_name %}горячей{%else%}холодной{%endif%} воды! - action: notify.mobile_app_iphone_16_pro_dima data: title: Внимание! message: Охрана Вкл! Потребление {% if 'Hot' in trigger.to_state.attributes.friendly_name %}горячей{%else%}холодной{%endif%} воды! data: push: sound: name: default critical: 1 volume: 1.0 - alias: system_water_sensor_outage id: system_water_sensor_outage initial_state: true triggers: - trigger: time_pattern minutes: /30 conditions: - condition: template value_template: '{{ as_timestamp(now())- as_timestamp(states.sensor[''0x00158d0006d31d78_zigbee''].last_updated) > 2*60*60 or as_timestamp(now())- as_timestamp(states.sensor[''0x00158d000236fcd5_zigbee''].last_updated) > 2*60*60 }} ' actions: - action: notify.telegram data: message: ❌ Внимание! Нет данных от счетчика {% if as_timestamp(now())- as_timestamp(states.binary_sensor['0x00158d0006d31d78_contact'].last_updated) > 2*60*60 %}холодной{%else%}горячей{%endif%} воды! - alias: bathroom_water_valves_test id: bathroom_water_valves_test initial_state: true triggers: - trigger: time at: 00:01:00 conditions: - '{{ now().timestamp() | timestamp_custom(''%d'') | int(0) == 15 }}' actions: - action: notify.telegram data: message: 🚰 Проверка кранов - закрываем! - action: button.press entity_id: button.esp32_node_b_close_valve - delay: 00:00:25 - action: switch.turn_off entity_id: switch.esp32_node_b_relay_1 - delay: 00:00:05 - action: notify.telegram data: message: 🚰 Проверка кранов - открываем! - action: button.press entity_id: button.esp32_node_b_open_valve - delay: 00:00:25 - action: switch.turn_off entity_id: switch.esp32_node_b_relay_2 - action: notify.telegram data: message: ✅ Проверка кранов завершена! - alias: vova_tv_control id: vova_tv_control initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.tv_delay_off id: timer_tv_off - trigger: event event_type: timer.finished event_data: entity_id: timer.tv_delay_on id: timer_tv_on - trigger: time at: '22:00:00' id: time_trigger_night - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d00023d3206_action click_type: single id: button_single_click actions: - choose: - conditions: - condition: trigger id: timer_tv_off sequence: - action: media_player.turn_off entity_id: media_player.tv_v - action: switch.turn_off entity_id: switch.0x00158d000290a093_plug - action: timer.start entity_id: timer.tv_delay_on - conditions: - condition: trigger id: timer_tv_on sequence: - not: - condition: time after: '21:00:00' - action: switch.turn_on entity_id: switch.0x00158d000290a093_plug - conditions: - condition: trigger id: time_trigger_night sequence: - action: switch.turn_off entity_id: switch.0x00158d000290a093_plug - conditions: - condition: trigger id: button_single_click sequence: - action: switch.toggle entity_id: switch.0x00158d000290a093_plug - alias: vova_purifier_breather_toggle id: vova_purifier_breather_toggle initial_state: true mode: single max_exceeded: silent triggers: - trigger: state entity_id: person.sandra to: home - trigger: state entity_id: person.sandra from: home conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none','0'] %} {{\ \ trigger.from_state.state not in ignore and\n trigger.to_state.state not in\ \ ignore and\n trigger.to_state.state != trigger.from_state.state }}\n" actions: - choose: - conditions: - condition: state entity_id: person.sandra state: home sequence: - action: fan.turn_on entity_id: fan.purifier2s - action: switch.turn_off entity_id: switch.system_breather_auto_v - conditions: - condition: not conditions: - condition: state entity_id: person.sandra state: home sequence: - action: fan.turn_off entity_id: fan.purifier2s - action: switch.turn_off entity_id: switch.system_hourly_mode_breather_v - action: switch.turn_on entity_id: switch.system_breather_auto_v - alias: vova_purifier_favorite_mode id: vova_purifier_favorite_mode initial_state: false mode: single max_exceeded: silent triggers: - trigger: state entity_id: fan.purifier2s for: minutes: 1 conditions: - condition: state entity_id: fan.purifier2s state: 'on' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: binary_sensor.tod_day state: 'off' - condition: not conditions: - condition: state entity_id: fan.purifier2s attribute: preset_mode state: Favorite actions: - action: fan.set_preset_mode data: entity_id: fan.purifier2s preset_mode: Favorite - alias: vova_sleep_time id: vova_sleep_time initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Пора спать conditions: - condition: template value_template: '{{ trigger.event.data.entity_id == ''media_player.yandex_v'' }}' actions: - action: switch.turn_off entity_id: switch.0x00158d000290a093_plug - action: media_player.turn_off entity_id: media_player.apple_tv_v - parallel: - action: light.turn_off entity_id: light.square_led_v data: transition: 15 - action: light.turn_off entity_id: light.square_led_v_nightlight data: transition: 15 - action: light.turn_off entity_id: light.0x54ef441000d4e7fd_light data: transition: 15 - if: - condition: not conditions: - condition: state entity_id: media_player.yandex_v state: playing then: - action: media_player.play_media entity_id: media_player.yandex_v data: media_content_id: Включи спят усталые игрушки на повтор media_content_type: command - alias: bathroom_washing_machine_washing id: bathroom_washing_machine_washing initial_state: true triggers: - trigger: state entity_id: binary_sensor.washer_b from: 'off' to: 'on' conditions: - condition: numeric_state entity_id: sensor.ha_uptime above: 0 - condition: state entity_id: input_select.washer_state state: - Idle - Drying actions: - action: input_number.set_value data: entity_id: input_number.washer_start value: '{{as_timestamp (now())|int(0)}}' - action: timer.cancel entity_id: timer.washer_working - action: timer.start entity_id: timer.washer_working - action: input_select.select_option data: entity_id: input_select.washer_state option: Washing - action: notify.telegram data: message: ⏳ Стирка начата! - alias: bathroom_washing_machine_sensors_issue id: bathroom_washing_machine_sensors_issue initial_state: true triggers: platform: state entity_id: binary_sensor.washer_b to: 'on' from: 'off' for: seconds: 5 conditions: - condition: state entity_id: binary_sensor.a4c138833042_contact state: 'on' actions: - action: input_boolean.turn_on entity_id: input_boolean.washer_door_issue - action: notify.telegram data: message: ❌ Внимание! Обнаружена ошибка сенсора двери стиральной машины! - alias: bathroom_washing_machine_pause_hatch_open id: bathroom_washing_machine_hatch_open triggers: - trigger: state entity_id: binary_sensor.a4c138833042_contact to: 'on' conditions: - condition: state entity_id: input_select.washer_state state: - Washing - condition: numeric_state entity_id: sensor.washing_machine_stopwatch below: 21 actions: - action: input_select.select_option data: entity_id: input_select.washer_state option: Pause - action: input_boolean.turn_off data: entity_id: input_boolean.washer_drying - action: timer.cancel entity_id: timer.washer_working - action: notify.telegram data_template: message: ⏳ Стирка приостановлена - alias: bathroom_washing_machine_pause_hatch_close id: bathroom_washing_machine_hatch_close triggers: - trigger: state entity_id: binary_sensor.a4c138833042_contact to: 'off' conditions: - condition: state entity_id: input_select.washer_state state: Pause actions: - action: input_select.select_option data: entity_id: input_select.washer_state option: Washing - action: timer.cancel entity_id: timer.washer_working - action: timer.start entity_id: timer.washer_working - action: notify.telegram data_template: message: ⏳ Стирка продолжена - alias: bathroom_washing_machine_drying id: bathroom_washing_machine_drying initial_state: true triggers: - trigger: state entity_id: binary_sensor.washer_b to: 'off' from: 'on' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.a4c138833042_contact state: 'off' - condition: state entity_id: input_select.washer_state state: - Washing - Pause - condition: state entity_id: input_boolean.washer_door_issue state: 'off' sequence: - action: timer.cancel entity_id: timer.washing_machine_door, timer.washer_working - action: timer.start entity_id: timer.washing_machine_door - action: input_select.select_option data: entity_id: input_select.washer_state option: Drying - action: counter.increment entity_id: counter.washing_machine_runs - action: input_number.set_value data: entity_id: input_number.washer_b_run_time value: '{{ (states(''input_number.washer_b_run_time'') | float(0) + (((as_timestamp(now())| int(0) - states(''input_number.washer_start'')| int(0)) / 60 )| round(0, ''common'') / 60))|round(2, ''common'') }}' - action: input_number.set_value data: entity_id: input_number.washing_gel_usage value: '{% set a = ((as_timestamp(now())| int(0) - states(''input_number.washer_start'')| int(0)) / 60 )| round(0, ''common'')|int(0) %} {% set k = (0.02 if 20 < a < 35 else 0.04) | float(0) %} {{ states(''input_number.washing_gel_usage'')|float(0) + (0 if a <20 else k)|float(0) }} ' - action: notify.telegram data: message: ⌛ Стирка завершена! Время стирки составило {{((as_timestamp(now())| int(0) - states('input_number.washer_start')| int(0)) / 60 )| round(0, 'common') }}мин. - condition: state entity_id: binary_sensor.tod_day state: 'on' - condition: state entity_id: switch.system_dark_mode state: 'off' - action: media_player.volume_set data: entity_id: media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: media_player.yandex_k media_content_id: Ст+ирка завершен+а! В+ытащите бель+ё пож+алуста! - conditions: - condition: state entity_id: input_boolean.washer_door_issue state: 'on' sequence: - action: input_select.select_option data: entity_id: input_select.washer_state option: Drying - action: timer.cancel entity_id: timer.washing_machine_door - action: timer.start entity_id: timer.washing_machine_door - alias: bathroom_washing_machine_open_door_after_washing id: bathroom_washing_machine_open_door_after_washing initial_state: true triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.washing_machine_door conditions: - condition: numeric_state entity_id: sensor.ha_uptime above: 0 - condition: state entity_id: input_select.washer_state state: Drying - condition: state entity_id: binary_sensor.a4c138833042_contact state: 'off' actions: - action: notify.telegram data: message: '{{''💨''}} Откройте дверцу стиральной машины!' - action: timer.cancel entity_id: timer.washing_machine_door - action: timer.start entity_id: timer.washing_machine_door - alias: bathroom_washing_machine_ready_notification id: bathroom_washing_machine_ready_notification initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b43ad4_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0001ae9f61_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b48381_motion - trigger: event event_type: xiaomi_aqara.motion event_data: entity_id: binary_sensor.0x00158d0002b4729d_motion conditions: - condition: numeric_state entity_id: sensor.ha_uptime above: 5 - condition: state entity_id: binary_sensor.tod_day state: 'on' - condition: state entity_id: switch.system_dark_mode state: 'off' - condition: state entity_id: input_select.washer_state state: Drying - condition: state entity_id: binary_sensor.a4c138833042_contact state: 'off' - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.bathroom_washing_machine_ready_notification'', ''last_triggered''),0)|int(0)) > 30*60 }}' - condition: template value_template: '{{(as_timestamp(now())-as_timestamp(state_attr(''automation.bathroom_washing_machine_drying'', ''last_triggered''),0)|int(0)) > 30*60 }}' - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: media_player.volume_set data: entity_id: media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: media_player.yandex_k media_content_id: Ст+ирка завершен+а! В+ытащите бель+ё пож+алуста! - alias: bathroom_washing_machine_open_door_after_washing_stop id: bathroom_washing_machine_open_door_after_washing_stop initial_state: true triggers: - trigger: state entity_id: binary_sensor.a4c138833042_contact to: 'on' from: 'off' conditions: - condition: numeric_state entity_id: sensor.ha_uptime above: 0 - condition: state entity_id: input_select.washer_state state: Drying actions: - action: notify.telegram data: message: '{{''✅''}} Дверца стиральной машинки открыта!' - action: timer.cancel entity_id: timer.washing_machine_door, timer.washing_machine_door - action: input_boolean.turn_off entity_id: input_boolean.washer_door_issue - action: input_select.select_option data: entity_id: input_select.washer_state option: Idle - alias: bathroom_washing_machine_open_door_issue_flag_reset id: bathroom_washing_machine_open_door_issue_flag_reset initial_state: true triggers: - trigger: state entity_id: binary_sensor.a4c138833042_contact to: - 'on' - 'off' conditions: - condition: state entity_id: input_boolean.washer_door_issue state: 'on' actions: - action: input_boolean.turn_off entity_id: input_boolean.washer_door_issue - alias: bathroom_washing_machine_idle_door_open_10m id: bathroom_washing_machine_idle_door_open_10m initial_state: true triggers: - trigger: state entity_id: binary_sensor.a4c138833042_contact from: 'off' to: 'on' for: minutes: 30 actions: - action: input_select.select_option data: entity_id: input_select.washer_state option: Idle - alias: system_water_leak_detected id: system_water_leak_detected initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: state entity_id: - binary_sensor.0x00158d00023297e7_moisture - binary_sensor.0x00158d00023684c2_moisture - binary_sensor.0x00158d0002373a67_moisture - binary_sensor.0x00158d0002349f5b_moisture - binary_sensor.54ef44c335f4_water_leak to: 'on' for: seconds: 5 actions: - action: light.turn_on data: entity_id: '{% if trigger.entity_id=="binary_sensor.0x00158d00023297e7_moisture" or trigger.entity_id=="binary_sensor.54ef44c335f4_water_leak" %}light.esp32_node_k_led {%elif trigger.entity_id=="binary_sensor.0x00158d00023684c2_moisture"%}light.esp32_node_hs_toilet {%else%}light.esp32_node_hs_bathroom {%endif%} ' effect: Red_Alarm brightness: 255 - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - parallel: - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: Вним+ание! Вним+ание! Обнар+ужена ут+ечка вод+ы {% if trigger.entity_id=="binary_sensor.0x00158d00023297e7_moisture"%}н+а к+ухне{%elif trigger.entity_id=="binary_sensor.54ef44c335f4_water_leak"%}под кухонной мебелью{%elif trigger.entity_id=="binary_sensor.0x00158d00023684c2_moisture"%}в туал+ете{%else%}в ванне{%if trigger.entity_id=="binary_sensor.0x00158d0002349f5b_moisture"%} за машинкой{%endif%}{%endif%}! Обнар+ужена ут+ечка вод+ы {% if trigger.entity_id=="binary_sensor.0x00158d00023297e7_moisture"%}н+а к+ухне{%elif trigger.entity_id=="binary_sensor.0x00158d00023684c2_moisture"%}в туал+ете{%else%}в ванне{%if trigger.entity_id=="binary_sensor.0x00158d0002349f5b_moisture"%} за машинкой{%endif%}{%endif%}! Вод+а перекрыв+ается!' - action: notify.telegram data: message: '{{''\U000026d4''}}Внимание! Обнаружена утечка воды {% if trigger.entity_id=="binary_sensor.0x00158d00023297e7_moisture"%}на кухне{%elif trigger.entity_id=="binary_sensor.54ef44c335f4_water_leak"%}под кухонной мебелью{%elif trigger.entity_id=="binary_sensor.0x00158d00023684c2_moisture"%}в туалете{%else%}в ванне{%if trigger.entity_id=="binary_sensor.0x00158d0002349f5b_moisture"%} за машинкой{%endif%}{%endif%}! Вода перекрывается!' - action: notify.mobile_app_iphone_16_pro_dima data: message: '{{''\U000026d4''}}Внимание! Обнаружена утечка воды {% if trigger.entity_id=="binary_sensor.0x00158d00023297e7_moisture"%}на кухне{%elif trigger.entity_id=="binary_sensor.54ef44c335f4_water_leak"%}под кухонной мебелью{%elif trigger.entity_id=="binary_sensor.0x00158d00023684c2_moisture"%}в туалете{%else%}в ванне{%if trigger.entity_id=="binary_sensor.0x00158d0002349f5b_moisture"%} за машинкой{%endif%}{%endif%}! Вода перекрывается!' data: push: sound: name: default critical: 1 volume: 1.0 - action: button.press entity_id: button.esp32_node_b_close_valve - delay: 00:00:25 - action: switch.turn_off entity_id: switch.esp32_node_b_relay_1 - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Вним+ание! Вод+а перекр+ыта! Устран+ите прот+ечку вод+ы {% if trigger.entity_id=="binary_sensor.0x00158d00023297e7_moisture"%}н+а к+ухне{%elif trigger.entity_id=="binary_sensor.54ef44c335f4_water_leak"%}под кухонной мебелью{%elif trigger.entity_id=="binary_sensor.0x00158d00023684c2_moisture"%}в туал+ете{%else%}в ванне{%if trigger.entity_id=="binary_sensor.0x00158d0002349f5b_moisture"%} за машинкой{%endif%}{%endif%}!''' - action: notify.telegram data: message: '{{''\U000026d4''}} Внимание! Вода перекрыта! Устраните протечку воды {% if trigger.entity_id=="binary_sensor.0x00158d00023297e7_moisture"%}на кухне{%elif trigger.entity_id=="binary_sensor.54ef44c335f4_water_leak"%}под кухонной мебелью{%elif trigger.entity_id=="binary_sensor.0x00158d00023684c2_moisture"%}в туалете{%else%}в ванне{%if trigger.entity_id=="binary_sensor.0x00158d0002349f5b_moisture"%} за машинкой{%endif%}{%endif%} для включения воды! ' - alias: system_water_leak_resolved id: system_water_leak_resolved initial_state: true mode: queued max: 10 max_exceeded: silent triggers: - trigger: state entity_id: - binary_sensor.0x00158d00023297e7_moisture - binary_sensor.0x00158d00023684c2_moisture - binary_sensor.0x00158d0002373a67_moisture - binary_sensor.0x00158d0002349f5b_moisture - binary_sensor.54ef44c335f4_water_leak to: 'off' from: 'on' for: seconds: 3 actions: - action: homeassistant.turn_off data: entity_id: "{% if trigger.entity_id==\"binary_sensor.0x00158d00023297e7_moisture\"\ %}light.esp32_node_k_led {%elif trigger.entity_id==\"binary_sensor.0x00158d00023684c2_moisture\"\ %}light.esp32_node_hs_toilet {%else%}light.esp32_node_hs_bathroom {%endif%}\ \ \n" - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Прот+ечка вод+ы {% if trigger.entity_id=="binary_sensor.0x00158d00023297e7_moisture"%}н+а к+ухне{%elif trigger.entity_id=="binary_sensor.54ef44c335f4_water_leak"%}под кухонной мебелью{%elif trigger.entity_id=="binary_sensor.0x00158d00023684c2_moisture"%}в туал+ете{%else%}в ванне{%if trigger.entity_id=="binary_sensor.0x00158d0002349f5b_moisture"%} за машинкой{%endif%}{%endif%} устранен+а! Спас+ибо!''' - action: notify.telegram data: message: '{{''\U00002705''}} Протечка воды {% if trigger.entity_id=="binary_sensor.0x00158d00023297e7_moisture"%}на кухне{%elif trigger.entity_id=="binary_sensor.54ef44c335f4_water_leak"%}под кухонной мебелью{%elif trigger.entity_id=="binary_sensor.0x00158d00023684c2_moisture"%}в туалете{%else%}в ванне{%if trigger.entity_id=="binary_sensor.0x00158d0002349f5b_moisture"%} за машинкой{%endif%}{%endif%} устранена! ' - alias: system_water_leak_turn_water_off id: system_water_leak_turn_water_off initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001ef609b_action click_type: single conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.esp32_node_b_valve_status state: 'off' sequence: - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Действие не трубуется - краны уже закрыты!''' - conditions: - not: - condition: state entity_id: binary_sensor.esp32_node_b_valve_status state: 'off' sequence: - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Вним+ание! Зап+ущена процедура выключ+ения вод+ы!''' - action: notify.telegram data: message: Внимание! Запущена процедура принудительного закрытия воды! - action: button.press entity_id: button.esp32_node_b_close_valve - delay: 00:00:25 - action: switch.turn_off entity_id: switch.esp32_node_b_relay_1 - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Внимание! Вода выключена!''' - action: notify.telegram data: message: Внимание! Вода принидительно закрыта! - alias: system_water_leak_turn_water_on id: system_water_leak_turn_water_on initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001ef609b_action click_type: double conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: group.leak_detected state: 'off' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.esp32_node_b_valve_status state: 'on' sequence: - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Действие не трубуется - краны уже открыты!''' - conditions: - not: - condition: state entity_id: binary_sensor.esp32_node_b_valve_status state: 'on' sequence: - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Вним+ание! Запущена процедура включ+ения вод+ы!''' - action: notify.telegram data: message: Внимание! Запущена процедура принудительного включения воды! - action: button.press entity_id: button.esp32_node_b_open_valve - delay: 00:00:25 - action: switch.turn_off entity_id: switch.esp32_node_b_relay_2 - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Вним+ание! Вода включена!''' - action: notify.telegram data: message: Внимание! Вода принидительно открыта! - alias: system_water_leak_turn_water_on_leak_detected id: system_water_leak_turn_water_on_leak_detected initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001ef609b_action click_type: double conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' - condition: state entity_id: group.leak_detected state: 'on' actions: - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Вним+ание! Включ+ение вод+ы невозм+ожно! Прот+ечка н+е устранен+а! Дл+я принуд+ительного включ+ения вод+ы нажм+ите и удерживайте кнопку!''' - action: notify.telegram data: message: Внимание! Попытка открыть воду, протечка НЕ устранена! - alias: system_water_leak_turn_water_on_force id: system_water_leak_turn_water_on_force initial_state: true triggers: - trigger: event event_type: xiaomi_aqara.click event_data: entity_id: sensor.0x00158d0001ef609b_action click_type: hold conditions: - condition: template value_template: '{{ is_state_attr(this.entity_id, ''current'',0) }}' actions: - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Вним+ание! {{ iif(is_state("group.leak_detected", "on"), "Прот+ечка вод+ы н+е устранен+а! ", "") }}Зап+ущена процедура принуд+ительного включ+ения вод+ы!''' - action: notify.telegram data: message: Внимание! {{ iif(is_state("group.leak_detected", "on"), "Протечка воды не устранена! ", "") }}Запущена процедура принудительного включения воды! - action: button.press entity_id: button.esp32_node_b_open_valve - delay: 00:00:25 - action: switch.turn_off entity_id: switch.esp32_node_b_relay_2 - action: media_player.volume_set data: entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: - media_player.{{states('input_select.main_audio_out')|lower}} - media_player.yandex_k media_content_id: '''Вним+ание! Вод+а включен+а! {{ iif(is_state("group.leak_detected", "on"), "Прот+ечка н+е устранен+а! ", "") }}''' - action: notify.telegram data: message: Внимание! Вода включена! {{ iif(is_state("group.leak_detected", "on"), "Протечка НЕ устранена!", "") }} - alias: system_water_valves_action id: system_water_valves_action initial_state: true triggers: - trigger: state entity_id: binary_sensor.esp32_node_b_valve_active to: null conditions: - condition: template value_template: "{% set ignore = ['unknown', 'unavailable', 'none','0'] %} {{\ \ trigger.from_state.state not in ignore and\n trigger.to_state.state not in\ \ ignore and\n trigger.to_state.state != trigger.from_state.state }}\n" actions: - action: notify.telegram data: message: '{%- set current_state = states(''binary_sensor.esp32_node_b_valve_status'') %} {%- set current_status = states(''binary_sensor.esp32_node_b_valve_active'') %} {%- if current_state == ''on'' and current_status == ''on'' %}{{''\U000026d4''}} Внимание! Закрытие кранов! {%- elif current_state == ''off'' and current_status == ''off'' %}{{''\U00002705''}} Краны закрыты! {%- elif current_state == ''off'' and current_status == ''on'' %}{{''\U000026d4''}} Внимание! Открытие кранов! {%- elif current_state == ''on'' and current_status == ''off'' %}{{''\U00002705''}} Краны открыты! {%- endif %}' - alias: system_critical_wifi_devices_unavailable id: system_critical_wifi_devices_unavailable initial_state: true mode: queued max_exceeded: silent max: 25 triggers: - trigger: state entity_id: - light.square_led_v - light.square_led_s - light.round_led_mb - light.round_led_k - light.round_led_hs - switch.shelly_1_led_mb - switch.shelly_1pm_led_v - fan.purifier2s - switch.ms01a_plug_hb - switch.ms01b_plug_hb - switch.pbs100_plug_st - switch.shelly_1_led_s - light.light_bar_s to: unavailable for: minutes: 1 actions: - action: notify.telegram data: message: '❌ {{trigger.to_state.name|title}}: {{trigger.from_state.state}} -> {{trigger.to_state.state}}' - alias: system_critical_wifi_devices_available id: system_critical_wifi_devices_available initial_state: true max_exceeded: silent max: 25 triggers: - trigger: state entity_id: - light.square_led_v - light.square_led_s - light.round_led_mb - light.round_led_k - light.round_led_hs - switch.shelly_1_led_mb - switch.shelly_1pm_led_v - fan.purifier2s - switch.ms01a_plug_hb - switch.ms01b_plug_hb - switch.pbs100_plug_st - switch.shelly_1_led_s - light.light_bar_s from: unavailable conditions: - condition: template value_template: '{{(trigger.to_state.last_changed - trigger.from_state.last_changed).total_seconds() > 60 }}' actions: - action: notify.telegram data: message: '✅ {{trigger.to_state.name|title}}: {{trigger.from_state.state}} -> {{trigger.to_state.state}}' - alias: system_critical_switches_toggle id: system_critical_switches_toggle initial_state: true max_exceeded: silent mode: queued max: 10 triggers: - trigger: state entity_id: - switch.0x00158d00023e5812_outlet - switch.esp32_node_b_relay_5 - switch.shelly_1_led_s - switch.digma_strip_hb_relay1 - switch.digma_strip_hb_relay2 - switch.digma_strip_hb_relay3 - switch.digma_strip_hb_relay4 - switch.0x00158d00039bd56d_plug - switch.0x00158d0002a36433_channel_1 - switch.0x00158d0002a36f7f_channel_2 - switch.shelly_1_led_mb - switch.shelly_1pm_led_v - switch.0x00158d0001a248e3_channel_2 - switch.0x00158d0001f26071_outlet to: 'off' for: seconds: 30 actions: - action: switch.turn_on data: entity_id: '{{ trigger.entity_id }}' - action: notify.telegram data: message: ✅ Включение - {{trigger.to_state.name|title}} - alias: system_ya_speakers_volume_set id: system_ya_speakers_volume_set initial_state: true max_exceeded: silent triggers: - trigger: state entity_id: binary_sensor.tod_day to: 'on' for: seconds: 30 - trigger: state entity_id: switch.system_dark_mode to: 'off' for: seconds: 30 actions: - repeat: for_each: - media_player.yandex_k - media_player.yandex_hb - media_player.yandex_v - media_player.yandex_s - media_player.yandex_mb sequence: - action: media_player.volume_set data: entity_id: '{{ repeat.item }}' volume_level: '{{states("input_number.main_volume")|float(0)}}' - action: media_player.volume_set data: entity_id: media_player.yandex_hb volume_level: '{{(states("input_number.main_volume")|float(0) + 0.2)|round(2) }}' - alias: system_when_daddy_get_back_home id: system_when_daddy_get_back_home initial_state: true triggers: - trigger: event event_type: yandex_intent event_data: text: Когда папа вернется actions: - if: - condition: state entity_id: input_boolean.dima_business_trip state: 'off' then: - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: '{{ trigger.event.data.entity_id }}' media_content_id: Папа дома и пока не уезжает в командировку extra: volume_level: '{{states("input_number.main_volume")|float(0)}}' else: - action: media_player.play_media data: media_content_type: '{{ states(''input_select.alice_mode'') }}' entity_id: '{{ trigger.event.data.entity_id }}' media_content_id: '{{[''Папа вернется через'',''Папа приедет через'',''Через'',''Папа вернется из командировки через'']|random}} {{ (states(''input_datetime.dima_return_date'') | as_datetime | as_local - today_at()).days|format(morph=''день'', as_text=false) }}' extra: volume_level: '{{states("input_number.main_volume")|float(0)}}' - alias: system_ya_speaker_k_volume_set id: system_ya_speaker_k_volume_set initial_state: true max_exceeded: silent triggers: - trigger: time at: 06:25:00 actions: - action: media_player.volume_set data: entity_id: media_player.yandex_k volume_level: '0.2' - action: media_player.volume_set data: entity_id: media_player.yandex_k volume_level: '0.2'