Automation for humidifier

Automation for humidifier

I suggest that those who are not indifferent share their options for automating the humidifier, sensors, and also share cards. Each of us can do something interesting and your idea may be useful.

Smartmi Evaporative Humidifier 2 CJXJSQ04ZM EU added through this integration xiaomi airpurifier

My automation option is like this. I am using a humidity sensor and have created an auxiliary number element for the target humidity. I made a difference between them so that the fan speed was adaptive and depended on the difference between the humidity sensor and the auxiliary number element. Thus, if the room humidity and the target humidity will have more than the specified, then the fan speed will be high, but as the difference between the humidity sensor and the auxiliary number element decreases, the fan speed will decrease, and when the specified humidity reaches, the speed will be minimal.

Sensor
sensor:
  - platform: template
    sensors:
      livingroom_airhumidifier_auto_speed:
        friendly_name: "Living Room: Humidifier. Auto speed"
        value_template: >
            {% set tiv_humidity = states("sensor.livingroom_tiv_humidity") %}
            {% set target_humidity = states("input_number.livingroom_humidifier_target_humidity") %}
            {% set sum = target_humidity|int - tiv_humidity |int  %}
            {% if sum < 0 %} Silent
            {% elif sum >= 0 and sum < 4.8 %} Silent
            {% elif sum > 4.9 and sum < 9.8 %} Medium
            {% elif sum > 9.9 %} High
            {% endif %}
Automation

Automation No. 1: Living Room: Humidifier. Automatic ventilation speed

alias: 'Living Room: Humidifier. Automatic ventilation speed'
description: >-
    The fan speed is determined by the difference between the target and room
    humidity
trigger:
  - platform: state
    entity_id: sensor.livingroom_airhumidifier_auto_speed
    id: 'Humidifier: Auto speed'
  - platform: state
    entity_id: input_boolean.livingroom_humidifier_auto_power_on_off
    from: 'off'
    to: 'on'
    id: 'Humidifier: Auto speed enabled'
  - platform: state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    from: 'off'
    to: 'on'
    id: Humidifier included
condition:
  - condition: state
    entity_id: input_boolean.livingroom_humidifier_auto_power_on_off
    state: 'on'
  - condition: state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    state: 'on'
action:
  - service: fan.set_preset_mode
    target:
      entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    data:
      preset_mode: '{{states("sensor.livingroom_airhumidifier_auto_speed")}}'
mode: single

Automation No. 2: Living Room: Humidifier. Switching on and off. Auto

alias: 'Living Room: Humidifier. Switching on and off. Auto'
description: >-
  The humidifier will automatically turn on and off. If the water level
  is below 20%, the humidifier will be turned off and there will be a notification in the telegram
  and Alice
trigger:
  - platform: numeric_state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    attribute: water_level
    above: '0'
    id: 'Humidifier: Water level below 20'
    below: '20'
  - platform: numeric_state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    attribute: water_level
    id: 'Humidifier: Water level below 40'
    below: '40'
    above: '20'
  - platform: numeric_state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    attribute: water_level
    id: 'Humidifier: Water level above 50'
    above: '50'
    below: '100'
condition:
  - condition: state
    entity_id: input_boolean.livingroom_humidifier_auto_power_on_off
    state: 'on'
action:
  - choose:
      - conditions:
          - condition: trigger
            id: 'Humidifier: Water level below 40'
          - condition: state
            entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            state: 'on'
        sequence:
          - choose:
              - conditions:
                  - condition: time
                    after: '10:00'
                    before: '23:59'
                  - condition: state
                    entity_id: input_select.divan_aktivnost
                    state: Home
                sequence:
                  - service: script.tts_yandex_station_say
                    data:
                      device: media_player.yandex_station_xxxxxxxxxxxxx
                      volume: 7
                      message: >-
                        Host, the humidifier is running out of water, you need to top up
                        water
                  - service: notify.divan
                    data:
                      title: '*Living Room: Humidifier*'
                      message: >-
                        Host, the humidifier is running out of water, you need to top up
                        water
              - conditions:
                  - condition: time
                    after: '00:00'
                    before: '09:59'
                sequence:
                  - service: notify.divan
                    data:
                      title: '*Living Room: Humidifier*'
                      message: >-
                        Host, the humidifier is running out of water, you need to top up
                        water
            default: []
      - conditions:
          - condition: trigger
            id: 'Humidifier: Water level below 20'
          - condition: state
            entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            state: 'on'
        sequence:
          - choose:
              - conditions:
                  - condition: time
                    after: '10:00'
                    before: '23:59'
                  - condition: state
                    entity_id: input_select.divan_aktivnost
                    state: Home
                sequence:
                  - service: script.tts_yandex_station_say
                    data:
                      device: media_player.yandex_station_xxxxxxxxxxxxx
                      volume: 7
                      message: >-
                        Host, the water level in the humidifier is below 20 percent,
                        the humidifier will be turned off
                  - service: notify.divan
                    data:
                      title: '*Living Room: Humidifier*'
                      message: >-
                        Host, the water level in the humidifier is below 20 percent,
                        the humidifier will be turned off
                  - service: fan.turn_off
                    target:
                      entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
              - conditions:
                  - condition: time
                    after: '00:00'
                    before: '09:59'
                sequence:
                  - service: notify.divan
                    data:
                      title: '*Living Room: Humidifier*'
                      message: >-
                        Host, the water level in the humidifier is below 20 percent,
                        the humidifier will be turned off
                  - service: fan.turn_off
                    target:
                      entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
              - conditions:
                  - condition: state
                    entity_id: input_select.divan_aktivnost
                    state: Not at home
                sequence:
                  - service: notify.divan
                    data:
                      title: '*Living Room: Humidifier*'
                      message: >-
                        Host, the water level in the humidifier is below 20 percent,
                        the humidifier will be turned off
                  - service: fan.turn_off
                    target:
                      entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            default: []
      - conditions:
          - condition: trigger
            id: 'Humidifier: Water level above 50'
          - condition: state
            entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            state: 'off'
        sequence:
          - service: fan.turn_on
            target:
              entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
          - service: notify.divan
            data:
              title: '*Living Room: Humidifier*'
              message: Host, thank you for pouring water, the humidifier will be on
    default: []
mode: single

Automation No. 3: Living Room: Humidifier. Switching on and off. Windows

alias: 'Living Room: Humidifier. Switching on and off. Windows'
description: >-
  If we open the window and the humidifier is running at this time, then the condition of the humidifier
  it will be saved to history and the humidifier will be turned off. When we close the windows, the
  humidifier will be turned on or not, it all depends on the history
trigger:
  - platform: state
    entity_id: group.livingroom_all_windows
    from: 'off'
    to: 'on'
    id: 'Living room: windows are open'
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - platform: state
    entity_id: group.livingroom_all_windows
    from: 'on'
    to: 'off'
    id: 'Living room: windows are closed'
    for:
      hours: 0
      minutes: 0
      seconds: 30
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: 'Living room: windows are open'
        sequence:
          - service: scene.create
            data:
              snapshot_entities:
                - fan.gostinaia_uvlazhnitel_xiaomi_evaporative
              scene_id: humidifier_livingroom_all_windows_history
          - delay:
              hours: 0
              minutes: 0
              seconds: 5
              milliseconds: 0
          - service: fan.turn_off
            target:
              entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
      - conditions:
          - condition: trigger
            id: 'Living room: windows are closed'
          - condition: state
            entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            state: 'off'
        sequence:
          - scene: scene.humidifier_livingroom_all_windows_history
    default: []
mode: single

Lovelace

image

Для создания Π΄Π°Π½Π½ΠΎΠΉ ΠΊΠ°Ρ€Ρ‚ΠΎΡ‡ΠΊΠΈ, я использовал ΠΈΠ½Ρ‚Π΅Π³Ρ€Π°Ρ†ΠΈΡŽ multiple entity row ΠΈ Π³Ρ€ΡƒΠΏΠΏΡƒ

type: entities
entities:
  - entity: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    type: custom:multiple-entity-row
    name: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ
    toggle: false
    state_color: true
    show_state: false
    secondary_info:
      attribute: water_level
      name: Π£Ρ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹
      unit: '%'
    entities:
      - entity: group.livingroom_airhumidifier_info_and_menu
        name: МСню
        state_color: true
        icon: mdi:information-outline
        styles:
          width: 40px
      - entity: sensor.gostinaia_tiv_humidity
        name: Π’Π»Π°ΠΆΠ½ΠΎΡΡ‚ΡŒ
        unit: '%'
        styles:
          width: 55px
      - entity: sensor.livingroom_airhumidifier_speed
        secondary_info: false
        name: Π‘ΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ
        styles:
          width: 55px
      - entity: input_boolean.livingroom_humidifier_auto_power_on_off
        name: Авто
        toggle: true
        state_color: true
        styles:
          width: 55px
  - type: section
title: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ


ВСкст Π½Π° русском (Text in Russian)

Автоматизация для увлаТнитСля

ΠŸΡ€Π΅Π΄Π»Π°Π³Π°ΡŽ Π½Π΅ Ρ€Π°Π²Π½ΠΎΠ΄ΡƒΡˆΠ½Ρ‹ΠΌ Π΄Π΅Π»ΠΈΡ‚ΡŒΡΡ своими Π²Π°Ρ€ΠΈΠ°Π½Ρ‚Π°ΠΌΠΈ Π°Π²Ρ‚ΠΎΠΌΠ°Ρ‚ΠΈΠ·Π°Ρ†ΠΈΠΈ увлаТнитСля, сСнсорами, Π° Ρ‚Π°ΠΊΠΆΠ΅ Π΄Π΅Π»ΠΈΡ‚ΡŒΡΡ ΠΊΠ°Ρ€Ρ‚ΠΎΡ‡ΠΊΠ°ΠΌΠΈ. ΠšΠ°ΠΆΠ΄Ρ‹ΠΉ ΠΈΠ· нас ΠΌΠΎΠΆΠ΅Ρ‚ ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ Ρ‡Ρ‚ΠΎ-Ρ‚ΠΎ интСрСсноС ΠΈ ваша идСя ΠΌΠΎΠΆΠ΅Ρ‚ ΠΎΠΊΠ°Π·Π°Ρ‚ΡŒΡΡ ΠΏΠΎΠ»Π΅Π·Π½Ρ‹ΠΌ.

Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Smartmi Evaporative Humidifier 2 CJXJSQ04ZM EU Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ Ρ‡Π΅Ρ€Π΅Π· эту ΠΈΠ½Ρ‚Π΅Π³Ρ€Π°Ρ†ΠΈΡŽ xiaomi airpurifier

Мой Π²Π°Ρ€ΠΈΠ°Π½Ρ‚ Π°Π²Ρ‚ΠΎΠΌΠ°Ρ‚ΠΈΠ·Π°Ρ†ΠΈΠΈ Ρ‚Π°ΠΊΠΎΠΉ. Π― ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡŽ Π΄Π°Ρ‚Ρ‡ΠΈΠΊ влаТности ΠΈ создал Π²ΡΠΏΠΎΠΌΠΎΠ³Π°Ρ‚Π΅Π»ΡŒΠ½Ρ‹ΠΉ элСмСнт число для Ρ†Π΅Π»Π΅Π²ΠΎΠΉ влаТности. Π‘Π΄Π΅Π»Π°Π» Ρ€Π°Π·Π½ΠΈΡ†Ρƒ ΠΌΠ΅ΠΆΠ΄Ρƒ Π½ΠΈΠΌΠΈ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ вСнтилятора Π±Ρ‹Π»Π° Π°Π΄Π°ΠΏΡ‚ΠΈΠ²Π½ΠΎΠΉ ΠΈ зависСла ΠΎΡ‚ Ρ€Π°Π·Π½ΠΈΡ†Ρ‹ ΠΌΠ΅ΠΆΠ΄Ρƒ Π΄Π°Ρ‚Ρ‡ΠΈΠΊΠΎΠΌ влаТности ΠΈ Π²ΡΠΏΠΎΠΌΠΎΠ³Π°Ρ‚Π΅Π»ΡŒΠ½Ρ‹ΠΌ элСмСнтом число. Π’Π°ΠΊΠΈΠΌ ΠΎΠ±Ρ€Π°Π·ΠΎΠΌ, Ссли комнатная Π²Π»Π°ΠΆΠ½ΠΎΡΡ‚ΡŒ ΠΈ цСлСвая Π²Π»Π°ΠΆΠ½ΠΎΡΡ‚ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ ΠΈΠΌΠ΅Ρ‚ΡŒ большС ΡƒΠΊΠ°Π·Π°Π½Π½ΠΎΠ³ΠΎ, Ρ‚ΠΎ ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ вСнтилятора Π±ΡƒΠ΄Π΅Ρ‚ высокой, Π½ΠΎ ΠΏΠΎ ΠΌΠ΅Ρ€Π΅ сокращСния Ρ€Π°Π·Π½ΠΈΡ†Ρ‹ ΠΌΠ΅ΠΆΠ΄Ρƒ Π΄Π°Ρ‚Ρ‡ΠΈΠΊΠΎΠΌ влаТности ΠΈ Π²ΡΠΏΠΎΠΌΠΎΠ³Π°Ρ‚Π΅Π»ΡŒΠ½Ρ‹ΠΌ элСмСнтом число, ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ вСнтилятора Π±ΡƒΠ΄Π΅Ρ‚ ΡΠ½ΠΈΠΆΠ°Ρ‚ΡŒΡΡ, Π° ΠΊΠΎΠ³Π΄Π° достигнСт ΡƒΠΊΠ°Π·Π°Π½Π½ΡƒΡŽ Π²Π»Π°ΠΆΠ½ΠΎΡΡ‚ΡŒ, Ρ‚ΠΎ ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ минимальной.

БСнсор
sensor:
  - platform: template
    sensors:
      livingroom_airhumidifier_auto_speed:
        friendly_name: "Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ. Авто ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ"
        value_template: >
            {% set tiv_humidity = states("sensor.livingroom_tiv_humidity") %}
            {% set target_humidity = states("input_number.livingroom_humidifier_target_humidity") %}
            {% set sum = target_humidity|int - tiv_humidity |int  %}
            {% if sum < 0 %} Silent
            {% elif sum >= 0 and sum < 4.8 %} Silent
            {% elif sum > 4.9 and sum < 9.8 %} Medium
            {% elif sum > 9.9 %} High
            {% endif %}
Автоматизация

Автоматизация β„–1: Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ. АвтоматичСская ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ вСнтиляции

alias: 'Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ. АвтоматичСская ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ вСнтиляции'
description: >-
  Π‘ΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ вСнтилятора опрСдСляСтся Ρ€Π°Π·Π½ΠΈΡ†Π΅ΠΉ ΠΌΠ΅ΠΆΠ΄Ρƒ Ρ†Π΅Π»Π΅Π²ΠΎΠΉ ΠΈ ΠΊΠΎΠΌΠ½Π°Ρ‚Π½ΠΎΠΉ
  Π²Π»Π°ΠΆΠ½ΠΎΡΡ‚ΡŒΡŽ
trigger:
  - platform: state
    entity_id: sensor.livingroom_airhumidifier_auto_speed
    id: 'Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ: Π°Π²Ρ‚ΠΎ ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ'
  - platform: state
    entity_id: input_boolean.livingroom_humidifier_auto_power_on_off
    from: 'off'
    to: 'on'
    id: 'Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ: Π°Π²Ρ‚ΠΎ ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ Π²ΠΊΠ»ΡŽΡ‡Π΅Π½Π°'
  - platform: state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    from: 'off'
    to: 'on'
    id: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π²ΠΊΠ»ΡŽΡ‡Π΅Π½
condition:
  - condition: state
    entity_id: input_boolean.livingroom_humidifier_auto_power_on_off
    state: 'on'
  - condition: state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    state: 'on'
action:
  - service: fan.set_preset_mode
    target:
      entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    data:
      preset_mode: '{{states("sensor.livingroom_airhumidifier_auto_speed")}}'
mode: single

Автоматизация β„–2: Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ. Π’ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΈ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅. Авто

alias: 'Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ. Π’ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΈ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅. Авто'
description: >-
  Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ автоматичСски Π²ΠΊΠ»ΡŽΡ‡Π°Ρ‚ΡŒΡΡ ΠΈ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π°Ρ‚ΡŒΡΡ. Если ΡƒΡ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹
  Π±ΡƒΠ΄Π΅Ρ‚ Π½ΠΈΠΆΠ΅ 20%, Ρ‚ΠΎ ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½ ΠΈ Π±ΡƒΠ΄Π΅Ρ‚ ΡƒΠ²Π΅Π΄ΠΎΠΌΠ»Π΅Π½ΠΈΠ΅ Π² Ρ‚Π΅Π»Π΅Π³Ρ€Π°ΠΌΠΌ
  ΠΈ Π² Алису
trigger:
  - platform: numeric_state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    attribute: water_level
    above: '0'
    id: 'Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ: Π£Ρ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π½ΠΈΠΆΠ΅ 20'
    below: '20'
  - platform: numeric_state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    attribute: water_level
    id: 'Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ: Π£Ρ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π½ΠΈΠΆΠ΅ 40'
    below: '40'
    above: '20'
  - platform: numeric_state
    entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    attribute: water_level
    id: 'Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ: Π£Ρ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π²Ρ‹ΡˆΠ΅ 50'
    above: '50'
    below: '100'
condition:
  - condition: state
    entity_id: input_boolean.livingroom_humidifier_auto_power_on_off
    state: 'on'
action:
  - choose:
      - conditions:
          - condition: trigger
            id: 'Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ: Π£Ρ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π½ΠΈΠΆΠ΅ 40'
          - condition: state
            entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            state: 'on'
        sequence:
          - choose:
              - conditions:
                  - condition: time
                    after: '10:00'
                    before: '23:59'
                  - condition: state
                    entity_id: input_select.divan_aktivnost
                    state: Π”ΠΎΠΌΠ°
                sequence:
                  - service: script.tts_yandex_station_say
                    data:
                      device: media_player.yandex_station_xxxxxxxxxxxxx
                      volume: 7
                      message: >-
                        Π₯озяин, Π² ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»Π΅ заканчиваСтся Π²ΠΎΠ΄Π°, Π½ΡƒΠΆΠ½ΠΎ Π΄ΠΎΠ»ΠΈΡ‚ΡŒ
                        Π²ΠΎΠ΄Ρ‹
                  - service: notify.divan
                    data:
                      title: '*Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ*'
                      message: >-
                        Π₯озяин, Π² ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»Π΅ заканчиваСтся Π²ΠΎΠ΄Π°, Π½ΡƒΠΆΠ½ΠΎ Π΄ΠΎΠ»ΠΈΡ‚ΡŒ
                        Π²ΠΎΠ΄Ρ‹
              - conditions:
                  - condition: time
                    after: '00:00'
                    before: '09:59'
                sequence:
                  - service: notify.divan
                    data:
                      title: '*Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ*'
                      message: >-
                        Π₯озяин, Π² ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»Π΅ заканчиваСтся Π²ΠΎΠ΄Π°, Π½ΡƒΠΆΠ½ΠΎ Π΄ΠΎΠ»ΠΈΡ‚ΡŒ
                        Π²ΠΎΠ΄Ρ‹
            default: []
      - conditions:
          - condition: trigger
            id: 'Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ: Π£Ρ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π½ΠΈΠΆΠ΅ 20'
          - condition: state
            entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            state: 'on'
        sequence:
          - choose:
              - conditions:
                  - condition: time
                    after: '10:00'
                    before: '23:59'
                  - condition: state
                    entity_id: input_select.divan_aktivnost
                    state: Π”ΠΎΠΌΠ°
                sequence:
                  - service: script.tts_yandex_station_say
                    data:
                      device: media_player.yandex_station_xxxxxxxxxxxxx
                      volume: 7
                      message: >-
                        Π₯озяин, Π² ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»Π΅ ΡƒΡ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π½ΠΈΠΆΠ΅ 20 ΠΏΡ€ΠΎΡ†Π΅Π½Ρ‚ΠΎΠ²,
                        ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½
                  - service: notify.divan
                    data:
                      title: '*Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ*'
                      message: >-
                        Π₯озяин, Π² ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»Π΅ ΡƒΡ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π½ΠΈΠΆΠ΅ 20 ΠΏΡ€ΠΎΡ†Π΅Π½Ρ‚ΠΎΠ²,
                        ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½
                  - service: fan.turn_off
                    target:
                      entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
              - conditions:
                  - condition: time
                    after: '00:00'
                    before: '09:59'
                sequence:
                  - service: notify.divan
                    data:
                      title: '*Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ*'
                      message: >-
                        Π₯озяин, Π² ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»Π΅ ΡƒΡ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π½ΠΈΠΆΠ΅ 20 ΠΏΡ€ΠΎΡ†Π΅Π½Ρ‚ΠΎΠ²,
                        ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½
                  - service: fan.turn_off
                    target:
                      entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
              - conditions:
                  - condition: state
                    entity_id: input_select.divan_aktivnost
                    state: НС дома
                sequence:
                  - service: notify.divan
                    data:
                      title: '*Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ*'
                      message: >-
                        Π₯озяин, Π² ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»Π΅ ΡƒΡ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π½ΠΈΠΆΠ΅ 20 ΠΏΡ€ΠΎΡ†Π΅Π½Ρ‚ΠΎΠ²,
                        ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½
                  - service: fan.turn_off
                    target:
                      entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            default: []
      - conditions:
          - condition: trigger
            id: 'Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ: Π£Ρ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹ Π²Ρ‹ΡˆΠ΅ 50'
          - condition: state
            entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            state: 'off'
        sequence:
          - service: fan.turn_on
            target:
              entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
          - service: notify.divan
            data:
              title: '*Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ*'
              message: Π₯озяин, спасибо, Ρ‡Ρ‚ΠΎ Π½Π°Π»ΠΈΠ»ΠΈ Π²ΠΎΠ΄Ρ‹, ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ Π²ΠΊΠ»ΡŽΡ‡Π΅Π½
    default: []
mode: single

Автоматизация β„–3: Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ. Π’ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΈ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅. Окна

alias: 'Гостиная: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ. Π’ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅ ΠΈ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½ΠΈΠ΅. Окна'
description: >-
  Если ΠΎΡ‚ΠΊΡ€ΠΎΠ΅ΠΌ ΠΎΠΊΠ½ΠΎ ΠΈ Π² это врСмя Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚ ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ, Ρ‚ΠΎ состояниС увлаТнитСля
  Π±ΡƒΠ΄Π΅Ρ‚ сохранСно Π² ΠΈΡΡ‚ΠΎΡ€ΠΈΡŽ ΠΈ ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ Π²Ρ‹ΠΊΠ»ΡŽΡ‡Π΅Π½. Когда Π·Π°ΠΊΡ€ΠΎΠ΅ΠΌ ΠΎΠΊΠ½Π°, Ρ‚ΠΎ
  ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ Π±ΡƒΠ΄Π΅Ρ‚ Π²ΠΊΠ»ΡŽΡ‡Π΅Π½ ΠΈΠ»ΠΈ Π½Π΅ Π²ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡΡ, всС зависит ΠΎΡ‚ истории
trigger:
  - platform: state
    entity_id: group.livingroom_all_windows
    from: 'off'
    to: 'on'
    id: 'Гостиная: ΠΎΠΊΠ½Π° ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚Ρ‹'
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - platform: state
    entity_id: group.livingroom_all_windows
    from: 'on'
    to: 'off'
    id: 'Гостиная: ΠΎΠΊΠ½Π° Π·Π°ΠΊΡ€Ρ‹Ρ‚Ρ‹'
    for:
      hours: 0
      minutes: 0
      seconds: 30
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: 'Гостиная: ΠΎΠΊΠ½Π° ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚Ρ‹'
        sequence:
          - service: scene.create
            data:
              snapshot_entities:
                - fan.gostinaia_uvlazhnitel_xiaomi_evaporative
              scene_id: humidifier_livingroom_all_windows_history
          - delay:
              hours: 0
              minutes: 0
              seconds: 5
              milliseconds: 0
          - service: fan.turn_off
            target:
              entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
      - conditions:
          - condition: trigger
            id: 'Гостиная: ΠΎΠΊΠ½Π° Π·Π°ΠΊΡ€Ρ‹Ρ‚Ρ‹'
          - condition: state
            entity_id: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
            state: 'off'
        sequence:
          - scene: scene.humidifier_livingroom_all_windows_history
    default: []
mode: single

Lovelace

image

Для создания Π΄Π°Π½Π½ΠΎΠΉ ΠΊΠ°Ρ€Ρ‚ΠΎΡ‡ΠΊΠΈ, я использовал ΠΈΠ½Ρ‚Π΅Π³Ρ€Π°Ρ†ΠΈΡŽ multiple entity row ΠΈ Π³Ρ€ΡƒΠΏΠΏΡƒ

type: entities
entities:
  - entity: fan.gostinaia_uvlazhnitel_xiaomi_evaporative
    type: custom:multiple-entity-row
    name: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ
    toggle: false
    state_color: true
    show_state: false
    secondary_info:
      attribute: water_level
      name: Π£Ρ€ΠΎΠ²Π΅Π½ΡŒ Π²ΠΎΠ΄Ρ‹
      unit: '%'
    entities:
      - entity: group.livingroom_airhumidifier_info_and_menu
        name: МСню
        state_color: true
        icon: mdi:information-outline
        styles:
          width: 40px
      - entity: sensor.gostinaia_tiv_humidity
        name: Π’Π»Π°ΠΆΠ½ΠΎΡΡ‚ΡŒ
        unit: '%'
        styles:
          width: 55px
      - entity: sensor.livingroom_airhumidifier_speed
        secondary_info: false
        name: Π‘ΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ
        styles:
          width: 55px
      - entity: input_boolean.livingroom_humidifier_auto_power_on_off
        name: Авто
        toggle: true
        state_color: true
        styles:
          width: 55px
  - type: section
title: Π£Π²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ

ПодскаТи, ΠΊΠ°ΠΊ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅ΡˆΡŒ этот ΠΈΠ½ΠΏΡƒΡ‚ сСлСкт? КакиС Π°Π²Ρ‚ΠΎΠΌΠ°Ρ‚ΠΈΠ·Π°Ρ†ΠΈΠΈ Π½Π° Π½Π΅Π³ΠΎ завязаны?

Π­Ρ‚ΠΎ моя Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΡΡ‚ΡŒ, Ρ‡Ρ‚ΠΎ я дСлаю, сплю, Π΄ΠΎΠΌΠ°, Π½Π΅ Π΄ΠΎΠΌΠ°. Π― ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡŽ это для всСй Π°Π²Ρ‚ΠΎΠΌΠ°Ρ‚ΠΈΠ·Π°Ρ†ΠΈΠΈ. Если я сплю, Ρ‚ΠΎ Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Ρ‚Π° автоматизация, которая Π±ΡƒΠ΄Π΅Ρ‚ Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ для этой активности, Ссли я Π΄ΠΎΠΌΠ°, Ρ‚.Π΅ проснулся ΠΈΠ»ΠΈ ΠΏΡ€ΠΈΡˆΠ΅Π» Π΄ΠΎΠΌΠΎΠΉ, Ρ‚ΠΎ Ρ€Π°Π±ΠΎΡ‚Π°Π΅Ρ‚ другая автоматизация, Ссли я ΡƒΡˆΠ΅Π» ΠΈΠ· Π΄ΠΎΠΌΠ°, Ρ‚ΠΎ Π±ΡƒΠ΄Π΅Ρ‚ Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΡΡ‚ΡŒ Π½Π΅ Π΄ΠΎΠΌΠ°, Π·Π½Π°Ρ‡ΠΈΡ‚ Π±ΡƒΠ΄Π΅Ρ‚ Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ автоматизация для активности Π½Π΅ Π΄ΠΎΠΌΠ°. Π’ΠΎΠ·ΡŒΠΌΠ΅ΠΌ ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ

  1. Π― Π΄ΠΎΠΌΠ°. Если Π²ΠΎΠ·Π΄ΡƒΡ… сухой, Ρ‚ΠΎ Π²ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ Π²Π΅Π½Ρ‚ΠΈΠ»ΡΡ†ΠΈΡŽ Π½Π° ΠΌΠ°ΠΊΡΠΈΠΌΠ°Π»ΡŒΠ½ΡƒΡŽ ΡΠΊΠΎΡ€ΠΎΡΡ‚ΡŒ, Π²ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ Π·Π²ΡƒΠΊΠΎΠ²ΠΎΠ΅ ΠΎΠΏΠΎΠ²Π΅Ρ‰Π΅Π½ΠΈΠ΅ ΠΈ свСтодиоды
  2. Π― сплю. Π’Π΅Π½Ρ‚ΠΈΠ»ΡΡ†ΠΈΡŽ ΠΏΠ΅Ρ€Π΅ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ Π½Π° Ρ‚ΠΈΡ…ΠΈΠΉ Ρ€Π΅ΠΆΠΈΠΌ. Π’Ρ‹ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ Π·Π²ΡƒΠΊΠΎΠ²ΠΎΠ΅ ΠΎΠΏΠΎΠ²Π΅Ρ‰Π΅Π½ΠΈΠ΅ ΠΈ свСтодиоды
  3. Π― Π½Π΅ Π΄ΠΎΠΌΠ°. Π’Ρ‹ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ ΡƒΠ²Π»Π°ΠΆΠ½ΠΈΡ‚Π΅Π»ΡŒ ΠΏΠΎΠ»Π½ΠΎΡΡ‚ΡŒΡŽ
1 Like

And what does notify.divan mean, what kind of service does it have?

А Ρ‡Ρ‚ΠΎ Π·Π½Π°Ρ‡ΠΈΡ‚ notify.divan Ρ‡Ρ‚ΠΎ это Π·Π° слуТба ΠΈΠΌΠ΅Π½Π½ΠΎ Ρƒ вас?

@ivchi

notify.divan is a telegram notification, after notify comes any name that is specified in your config. Read the details here

НС получаСтся ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ сСнсор ΠΈ ΠΊΠ°Ρ€Ρ‚ΠΎΡ‡ΠΊΡƒ. Π― Π½Π°Ρ‡ΠΈΠ½Π°ΡŽΡ‰ΠΈΠΉ. ΠΠ²Ρ‚ΠΎΠΌΠ°Ρ‚ΠΈΠ·Π°Ρ†ΠΈΡŽ Π·Π°Π³Π½Π°Π», Π²Ρ€ΠΎΠ΄Π΅ всС ΠΏΠΎΠ»ΡƒΡ‡ΠΈΠ»ΠΎΡΡŒ, Π½ΠΎ Π²ΠΎΡ‚ сСнсор ΠΈ ΠΊΠ°Ρ€Ρ‚ΠΎΡ‡ΠΊΡƒ Π½Π΅ получаСтся. Описания Π½Π΅Ρ‚, ΠΌΠΎΠ³Ρƒ ΠΏΠΎΠΏΡ€ΠΎΡΠΈΡ‚ΡŒ ΠΎ ΠΏΠΎΠΌΠΎΡ‰ΠΈ?