Cover configuration


In Esphome covers doesn’t have tilt functions.

Esphome Cover install

For covers we prepared output file (which is bundled in new configurations). We use switch component for covers 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

Configure cover

Always have cover fully open when configuring first time!

Put some safe long time to open and close your cover (do it carefully! We’re not responsible for any damage made by you).

Let’s say 60 seconds

cover:
  - platform: time_based
    name: 'Cover 01'
    id: cover_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
    stop_action:
      - switch.turn_off: cover_open_01_out01
      - switch.turn_off: cover_close_01_out02

As you can see I edited 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. When motor is stopped, stop the stopwatch and note the opening time
  9. Ok, let’s power down the cover and edit open_duration time and close_duration time.
  10. Compile firmware and compile it.
  11. Your cover is ready.

Configure inputs

This config is provided by default in our firmware.

Open and close with holding buttons

binary_sensor:
  - platform: gpio
    name: 'IN_01'
    id: in_01
    pin:
      pcf8574: pcf_inputs_1to14
      number: 0
      mode:
        input: true
      inverted: true
    on_press:
      then:
        - cover.open: cover_01
    on_release:
      then:
        - cover.stop: cover_01

  - platform: gpio
    name: 'IN_02'
    id: in_02
    pin:
      pcf8574: pcf_inputs_1to14
      number: 1
      mode:
        input: true
      inverted: true
    on_press:
      then:
        - cover.close: cover_01
    on_release:
      then:
        - cover.stop: cover_01

Open and close on single click with 2 push buttons

binary_sensor:
  - platform: gpio
    name: 'IN_01'
    id: in_01
    pin:
      pcf8574: pcf_inputs_1to14
      number: 0
      mode:
        input: true
      inverted: true
    on_press:
      then:
        - lambda: |
            auto call = id(cover_01).make_call();
            if (id(cover_01).current_operation == COVER_OPERATION_IDLE){
                call.set_command_open();
            }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_press:
      then:
        - lambda: |
            auto call = id(cover_01).make_call();
            if (id(cover_01).current_operation == COVER_OPERATION_IDLE){
                call.set_command_close();
            }else{
                call.set_command_stop();
            }
            call.perform();

Toggle on single click with 1 push buttons

binary_sensor:
  - platform: gpio
    name: 'IN_01'
    id: in_01
    pin:
      pcf8574: pcf_inputs_1to14
      number: 0
      mode:
        input: true
      inverted: true
    on_click:
      then:
        - cover.toggle: cover_01