Superrollo GW60 with ESPHome

Hi,

I more or less solved the same problem as Max Winterstein described in Control Superrollo GW60 (and more!) by enhancing remote with ESP8266 , but I did it with ESPHome.

Step 1 is the same as described in the above mentioned posting. Note: If you connect + from the remote with 3V3 you do not need a battery on the remote.

For step 2 I assume basic knowledge of Home Assistant and ESPHome, so what I did is in the end quite simple:

  1. I defined the GPIOs, where the 4 bit from the remote are connected as switches.
  2. Then I created buttons for up, down and stop for each cover. Each of this buttons switches the switches on press as needed to get the required signal from the remote.
  3. The last step was to define time based covers with button press for the related actions.

For reading the code it might help to know, that “Rollo” is the German word for cover.

Here’s the code:

#Bit #:    3 2 1 0
#GPIO#:  19 18 17 16
#
#all up    0 0 0 1
#all down  0 0 1 0
#all stop  0 0 1 1
#
#1 up      0 1 0 1
#1 down    0 1 1 0
#1 stop    0 1 1 1
#
#2 up      1 0 0 1
#2 down    1 0 1 0
#2 stop    1 0 1 1
#
#3 up      1 1 0 1
#3 down    1 1 1 0
#3 stop    1 1 1 1 

switch:
  - platform: gpio
    id: sr_out_0
    pin: 
      number: GPIO16
    on_turn_on:
      - delay: 0.5s
      - switch.turn_off: sr_out_0
  - platform: gpio
    id: sr_out_1
    pin: 
      number: GPIO17
    on_turn_on:
      - delay: 0.5s
      - switch.turn_off: sr_out_1
  - platform: gpio
    id: sr_out_2
    pin: 
      number: GPIO18
    on_turn_on:
      - delay: 0.5s
      - switch.turn_off: sr_out_2
  - platform: gpio
    id: sr_out_3
    pin: 
      number: GPIO19
    on_turn_on:
      - delay: 0.5s
      - switch.turn_off: sr_out_3
button:
### Cover 1 ###
  - platform: template
    name: "SR R1 up"
    id: sr_r1_up
    on_press:
      - switch.turn_on: sr_out_0
      - switch.turn_off: sr_out_1
      - switch.turn_on: sr_out_2
      - switch.turn_off: sr_out_3
  - platform: template
    name: "SR R1 down"
    id: sr_r1_down
    on_press:
      - switch.turn_off: sr_out_0
      - switch.turn_on: sr_out_1
      - switch.turn_on: sr_out_2
      - switch.turn_off: sr_out_3
  - platform: template
    name: "SR R1 stop"
    id: sr_r1_stop
    on_press:
      - switch.turn_on: sr_out_0
      - switch.turn_on: sr_out_1
      - switch.turn_on: sr_out_2
      - switch.turn_off: sr_out_3
### Cover 2 ###
  - platform: template
    name: "SR R2 up"
    id: sr_r2_up
    on_press:
      - switch.turn_on: sr_out_0
      - switch.turn_off: sr_out_1
      - switch.turn_off: sr_out_2
      - switch.turn_on: sr_out_3
  - platform: template
    name: "SR R2 down"
    id: sr_r2_down
    on_press:
      - switch.turn_off: sr_out_0
      - switch.turn_on: sr_out_1
      - switch.turn_off: sr_out_2
      - switch.turn_on: sr_out_3
  - platform: template
    name: "SR R2 stop"
    id: sr_r2_stop
    on_press:
      - switch.turn_on: sr_out_0
      - switch.turn_on: sr_out_1
      - switch.turn_off: sr_out_2
      - switch.turn_on: sr_out_3

# Now let's make a cover out of it
cover:
### Cover Bathroom ###
  - platform: time_based
    name: "Bad Rollo"
    id: badrollo
    open_action:
      - button.press: sr_r1_up
    open_duration: 19s
    close_action:
      - button.press: sr_r1_down
    close_duration: 16s
    stop_action:
      - button.press: sr_r1_stop
### Cover Kitchen ###
  - platform: time_based
    name: "Kueche Rollo"
    id: kuecherollo
    open_action:
      - button.press: sr_r2_up
    open_duration: 18s
    close_action:
      - button.press: sr_r2_down
    close_duration: 15s
    stop_action:
      - button.press: sr_r2_stop

So with ESPHome Step 3 is not necessary any more, since the buttons and covers appear automatically in Home Assistant.

Special thanks to Max for his initial work and to everybody, who provided good ideas in the thread Set more than one GPIO pins *simultanously*, when I needed some hints.

I hope, this helps. Have fun.

mfg
CR

I want to avoid the remote completely.
What is the pinout on the back of the roller. Did somebody find out what’s going on there?

GPIO? I2C? Something special?

Just an enhancement.

Using “script:” and “queued”-mode to prevent overwriting pin states and have them run after each other automatically.
That way one can also create groups of “Rollladen” in HA and they will work.
This is not working with the way it’s done above, since the GPIO will be overwritten instantly.

cover_delay of 500ms works for me.

script:
  - id: cover_set_gpio
    mode: queued
    max_runs: 10
    parameters: 
      pattern: bool[]
    then:
      - switch.control: 
          id: sr_out_0
          state: !lambda return pattern[0];
      - switch.control: 
          id: sr_out_1
          state: !lambda return pattern[1];
      - switch.control: 
          id: sr_out_2
          state: !lambda return pattern[2];
      - switch.control:
          id: sr_out_3
          state: !lambda return pattern[3];
      - delay: ${cover_delay}
      - switch.turn_off: sr_out_0
      - switch.turn_off: sr_out_1
      - switch.turn_off: sr_out_2
      - switch.turn_off: sr_out_3

cover:
  - platform: time_based
    name: "Schlaf Rolladen"
    id: schlaf_rolladen
    manual_control: true
    open_action:
      - lambda: |-
          std::vector<bool> pattern{ true, false, true, false };
          id(cover_set_gpio)->execute(pattern);
    open_duration: 25s
    close_action:
      - lambda: |-
          std::vector<bool> pattern{ false, true, true, false };
          id(cover_set_gpio)->execute(pattern);
    close_duration: 23s
    stop_action:
      - lambda: |-
          std::vector<bool> pattern{ true, true, true, false };
          id(cover_set_gpio)->execute(pattern);

  - platform: time_based
    name: "Wohn Rolladen L"
    id: wohn_rolladen_l
    manual_control: true
    open_action:
      - lambda: |-
          std::vector<bool> pattern{ true, false, false, true };
          id(cover_set_gpio)->execute(pattern);
    open_duration: 25s
    close_action:
      - lambda: |-
          std::vector<bool> pattern{ false, true, false, true };
          id(cover_set_gpio)->execute(pattern);
    close_duration: 23s
    stop_action:
      - lambda: |-
          std::vector<bool> pattern{ true, true, false, true };
          id(cover_set_gpio)->execute(pattern);

  - platform: time_based
    name: "Wohn Rolladen R"
    id: wohn_rolladen_r
    manual_control: true
    open_action:
      - lambda: |-
          std::vector<bool> pattern{ true, false, true, true };
          id(cover_set_gpio)->execute(pattern);
    open_duration: 25s
    close_action:
      - lambda: |-
          std::vector<bool> pattern{ false, true, true, true };
          id(cover_set_gpio)->execute(pattern);
    close_duration: 23s
    stop_action:
      - lambda: |-
          std::vector<bool> pattern{ true, true, true, true };
          id(cover_set_gpio)->execute(pattern);

switch:
  - platform: gpio
    id: sr_out_0
    pin: 
      number: ${sr_out_0_pin}
  - platform: gpio
    id: sr_out_1
    pin: 
      number: ${sr_out_1_pin}
  - platform: gpio
    id: sr_out_2
    pin: 
      number: ${sr_out_2_pin}
  - platform: gpio
    id: sr_out_3
    pin: 
      number: ${sr_out_3_pin}