Загрузка данных


# Loads default set of integrations. Do not remove.
default_config:

frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

# Виртуальные переменные для отслеживания конечного автомата ворот
input_select:
  garage_door_state:
    name: "Расчетное состояние ворот"
    options:
      - "closed"
      - "opening"
      - "open"
      - "closing"
      - "stopped_opening"
      - "stopped_closing"

input_number:
  kalitka_vremya:
    name: "Время открытия калитки"
    min: 5
    max: 20
    step: 1
    initial: 12
    unit_of_measurement: "сек"

# Единый блок шаблонов (Стиралка + Умный Cover для ворот)
template:
  - switch:
      - name: "Стиральная машина"
        unique_id: washing_machine_virtual_switch
        state: >
          {{ is_state('binary_sensor.stiralka_rabotaet', 'on') }}
        turn_on:
          - service: homeassistant.update_entity
            target:
              entity_id: binary_sensor.stiralka_rabotaet
        turn_off:
          - service: homeassistant.update_entity
            target:
              entity_id: binary_sensor.stiralka_rabotaet

  - cover:
      - name: "Гаражные ворота"
        unique_id: alutech_roteo_smart_cover
        device_class: garage
        
        # Исправлено на современный синтаксис 'state'
        state: >
          {% set s = states('input_select.garage_door_state') %}
          {% if s in ['opening', 'closing', 'closed'] %}
            {{ s }}
          {% else %}
            open
          {% endif %}
          
        # Исправлено на современный синтаксис 'icon'
        icon: >
          {% set s = states('input_select.garage_door_state') %}
          {% if s == 'closed' %}
            mdi:garage
          {% elif s == 'opening' %}
            mdi:arrow-up-bold-box
          {% elif s == 'closing' %}
            mdi:arrow-down-bold-box
          {% elif 'stopped' in s %}
            mdi:garage-alert
          {% else %}
            mdi:garage-open
          {% endif %}

        open_cover:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ states('input_select.garage_door_state') in ['closed', 'stopped_closing'] }}"
                sequence:
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
              - conditions:
                  - condition: template
                    value_template: "{{ states('input_select.garage_door_state') == 'closing' }}"
                sequence:
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
                  - delay: "00:00:01"
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
              - conditions:
                  - condition: template
                    value_template: "{{ states('input_select.garage_door_state') == 'stopped_opening' }}"
                sequence:
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
                  - delay: "00:00:01"
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
                  - delay: "00:00:01"
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state

        close_cover:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ states('input_select.garage_door_state') in ['open', 'stopped_opening'] }}"
                sequence:
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
              - conditions:
                  - condition: template
                    value_template: "{{ states('input_select.garage_door_state') == 'opening' }}"
                sequence:
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
                  - delay: "00:00:01"
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
              - conditions:
                  - condition: template
                    value_template: "{{ states('input_select.garage_door_state') == 'stopped_closing' }}"
                sequence:
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
                  - delay: "00:00:01"
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state
                  - delay: "00:00:01"
                  - service: switch.toggle
                    target:
                      entity_id: switch.maingaragedoor_state

        stop_cover:
          - condition: template
            value_template: "{{ states('input_select.garage_door_state') in ['opening', 'closing'] }}"
          - service: switch.toggle
            target:
              entity_id: switch.maingaragedoor_state

yandex_smart_home:
  entity_config:
    switch.stiralnaia_mashina:
      name: Стиральная machine
      type: devices.types.washing_machine

    sensor.0xa4c1383f99bf61e8_temperature:
      name: Климат Кухня
      room: Кухня
      properties:
        - type: temperature
          entity: sensor.0xa4c1383f99bf61e8_temperature
        - type: humidity
          entity: sensor.0xa4c1383f99bf61e8_humidity
        - type: battery_level
          entity: sensor.0xa4c1383f99bf61e8_battery

    sensor.0xa4c1388484f63104_temperature:
      name: Климат Максимская
      room: Максимская
      properties:
        - type: temperature
          entity: sensor.0xa4c1388484f63104_temperature
        - type: humidity
          entity: sensor.0xa4c1388484f63104_humidity
        - type: battery_level
          entity: sensor.0xa4c1388484f63104_battery

    sensor.0xa4c13893291f688a_temperature:
      name: Климат Родительская
      room: Родительская
      properties:
        - type: temperature
          entity: sensor.0xa4c13893291f688a_temperature
        - type: humidity
          entity: sensor.0xa4c13893291f688a_humidity
        - type: battery_level
          entity: sensor.0xa4c13893291f688a_battery

    switch.artlight:
      name: Люстра Артёма
      type: devices.types.light.ceiling

    switch.maxlight:
      name: Люстра Максима
      type: devices.types.light.ceiling

    light.yeelight_mono5_0x1a58bf55:
      name: Светильник
      type: devices.types.light

    media_player.samsung_kukhnia:
      name: Телевизор Кухня
      type: devices.types.media_device.tv