Плавное открытие штор / Smooth opening curtains

Долго думал куда записывать свои автоматизации, решил что буду сюда.
Хочу рассказать как я научился плавно открывать шторы с утра.
Переводить текст на Английский буду через Google переводчик.

I thought for a long time where to write down my automations, I decided that I would be here.
I want to tell you how I learned to smoothly open the curtains in the morning.
I will translate the text into English through Google translator.

Нужно сделать это настроить таймер для открытия штор, чтобы кажды раз не залазить в автоматизацию. Данна интеграция позволит на dashboard вводить время.

You need to do this to set up a timer to open the curtains so that you don’t get into automation every time. This integration will allow you to enter the time on the dashboard.

  input_datetime: 
# Время открытия штор / curtain opening time     
    hall_cover_curtains_open: 
      has_date: false
      has_time: true  

Нужно настроить в какие дни недели будет открываться окно.

You need to configure which days of the week the window will open.

  input_boolean:
# День открытия штор  / curtain opening day
    hall_cover_curtains_1_monday:    
        name: hall_cover_curtains_1_monday
        icon: mdi:alpha-m-circle   
    hall_cover_curtains_1_tuesday:    
        name: hall_cover_curtains_1_tuesday
        icon: mdi:alpha-t-circle  
    hall_cover_curtains_1_wednesday:    
        name: hall_cover_curtains_1_wednesday
        icon: mdi:alpha-w-circle      
    hall_cover_curtains_1_thursday:    
        name: hall_cover_curtains_1_thursday
        icon: mdi:alpha-t-circle  
    hall_cover_curtains_1_friday:    
        name: hall_cover_curtains_1_friday
        icon: mdi:alpha-f-circle      
    hall_cover_curtains_1_saturday:    
        name: hall_cover_curtains_1_saturday
        icon: mdi:alpha-s-circle     
    hall_cover_curtains_1_sunday:    
        name: hall_cover_curtains_1_sunday
        icon: mdi:alpha-s-circle    

Нужно чтобы штора открывалась с определенным интервалом.

It is necessary that the curtain opens at a certain interval.

# Открывает шторы на 10 пунктов от текущего значения / Opens curtains 10 points from the current value
  script:
   cover_position_curtains_open:
    sequence:
    - service: cover.set_cover_position
      data:
        entity_id: cover.0x00158d00079b0468
        position: "{{ state_attr('cover.0x00158d00079b0468', 'current_position')|int + 10|int}}"

Теперь соберем автоматизацию.

Now let’s assemble the automation.

  automation:          
# Открыть шторы /open curtains
  - alias: hall_cover_curtains_open
    initial_state: true
    trigger:
      platform: time
      at: input_datetime.hall_cover_curtains_open
    condition: 
      - condition: template
        value_template: '{{ states("input_boolean.hall_cover_curtains_1_"+now().strftime("%A"))== "on"}}'
    action:
      - repeat:
         sequence:
          - service: script.turn_on
            entity_id: script.cover_position_curtains_open
          - delay: "00:02:00"
         until: 
           - condition: template
             value_template: "{{ state_attr('cover.0x00158d00079b0468', 'current_position') == 100 }}"
    mode: single

Дальше вам останется оформить в UI-lovelace =)

Then you just have to arrange in UI-lovelace =)

โปรดสนทนาเป็นภาษาอังกฤษเพื่อให้เราทุกคนได้เรียนรู้และมีส่วนร่วม :wink:

(English translation: please keep the conversation in English, so we can all lean and contribute).

1 Like

Good afternoon, is that okay? =)

That is great, thanks for sharing!
To be fair, I returned the favour :smile:

Hi, show you UI-lovelace code, please