Venetian blinds


In Esphome covers doesn’t have tilt functions. Because of that we use custom component made by Vaclav (thanks for that!): https://github.com/bruxy70/Venetian-Blinds-Control It supports tilting. It’s called venetian blinds.

Esphome Cover

We use switch component for venetian blinds as only those support interlock.

switch:
  - platform: gpio
    id: cover_open_01_out01
    pin:
      pcf8574: pcf_left
      number: 15
      mode:
        output: true
      inverted: true
    interlock: &cover_interlock_01 [cover_open_01_out01, cover_close_01_out02]
    interlock_wait_time: 5ms
    restore_mode: always off

User don’t need to edit that unless you want to edit interlock_wait_time.

Naming for outputs are:

  • cover_open_01_out01
  • cover_close_01_out02
  • cover_open_02_out03
  • cover_close_02_out04
  • and go on…

Install proper firmware

You have to install Cover (or Cover Mix) configuration from our website and adopt device in Esphome addon to get it working properly:

Esphome Cover install

Recompile with custom component

Add this to the top of your adopted configuration

external_components:
  - source:
      type: git
      url: https://github.com/bruxy70/Venetian-Blinds-Control
      ref: master
    components: [venetian_blinds]

Configure venetian blind

Always have venetian blind fully open when configuring first time!

We want to change Cover 01 to be venetian blind.

Put some safe long time to open and close your venetian blind (do it carefully! We’re not responsible for any damage made by you). Let’s say 60 seconds. Configure tilt duration in ms as it should be calibrate precisely.

cover:
  - platform: venetian_blinds
    name: 'Blind 01'
    id: blind_01
    open_action:
      - switch.turn_on: cover_open_01_out01
    open_duration: 60s
    close_action:
      - switch.turn_on: cover_close_01_out02
    close_duration: 60s
    tilt_duration: 2000ms
    stop_action:
      - switch.turn_off: cover_open_01_out01
      - switch.turn_off: cover_close_01_out02

As you can see I edited platform, open_duration: 60s and close_duration: 60s to 60seconds.

Compile your firmware and upload it.

  1. Without power attached (turn off the fuse) open cover it in Home Assistant, so state of cover is synchronized between boneIO device and real state of cover.
  2. Prepare stopwatch.
  3. Now turn on power (turn on fuse)
  4. Click close and start stopwatch simultaneously
  5. When motor is stopped stop the stopwatch and note the closing time.
  6. Wait a few seconds (2 is ok) and stop cover in Home Assistant UI by clicking stop.
  7. Now let’s measure opening time. Click on open button and start stopwatch.
  8. Note tilting time without stopping the motor!
  9. When motor is stopped, stop the stopwatch and note the opening time.
  10. Ok, let’s power down the cover, edit open_duration time, close_duration time and tilting time.
  11. Compile firmware and compile it.
  12. Your venetian blind is ready.

Configure inputs

This config is provided by default in our firmware.

Open, close and tilt with 2 buttons

In this scenario single click will control tilt and long for at least 2s will open/close blind.

binary_sensor:
  - platform: gpio
    name: 'IN_01'
    id: in_01
    pin:
      pcf8574: pcf_inputs_1to14
      number: 0
      mode:
        input: true
      inverted: true
    on_multi_click:
      - timing: #long click
          - ON for at least 2s
        then:
          - lambda: |
              auto call = id(blind_01).make_call();
              if(id(blind_01).current_operation == COVER_OPERATION_IDLE){
                call.set_command_open();
              }
              else {
                call.set_command_stop();
              }
              call.perform();
      - timing: #short click
          - ON for at most 0.4s
          - OFF for at least 0.1s
        then:
          - lambda: |
              auto call = id(blind_01).make_call();
              if (id(blind_01).current_operation == COVER_OPERATION_IDLE){
                    if (id(blind_01).tilt < 1.0){
                      float new_tilt = std::min(id(blind_01).tilt + 0.1f, 1.0f);
                      call.set_tilt(new_tilt);
                    }
              }
              else {
                call.set_command_stop();
              }
              call.perform();

  - platform: gpio
    name: 'IN_02'
    id: in_02
    pin:
      pcf8574: pcf_inputs_1to14
      number: 1
      mode:
        input: true
      inverted: true
    on_multi_click:
      - timing: #long click
          - ON for at least 2s
        then:
          - lambda: |
              auto call = id(blind_01).make_call();
              if(id(blind_01).current_operation == COVER_OPERATION_IDLE){
                call.set_command_close();
              }
              else {
                call.set_command_stop();
              }
              call.perform();
      - timing: #short click
          - ON for at most 0.4s
          - OFF for at least 0.1s
        then:
          - lambda: |
              auto call = id(blind_01).make_call();
              if (id(blind_01).current_operation == COVER_OPERATION_IDLE){
                    if (id(blind_01).tilt > 0.0){
                      float new_tilt = std::max(id(blind_01).tilt - 0.1f, 0.0f);
                      call.set_tilt(new_tilt);
                    }
              }
              else {
                call.set_command_stop();
              }
              call.perform();