Get Free Shipping & Prusaments with the Prusa XL Summer Deal!

ESP32-DevKit-v1 ⨯ Somfy Keygo remote case

When it's easier to clone a remote, just make an ESP32 press its buttons.
2
15
0
675
updated March 17, 2025

Description

PDF

Solder an ESP32 to a Somfy Keygo series remote. Those remotes use a similar case and should have the same PCB form factor. I tested with a Keygo io model.

On the back of the PCB, solder 3V3 to the metal plate and GND to the gold disc (i used the most top little hole in it). The ESP32 will supply power to the remote.

The 3 aligned switches are active high. The alone one is active low.
Solder as depicted on photo:
left button ("4"): top side to GPIO27,
middle button ("3"): right side to GPIO12,
right button ("2"): top side to GPIO14,
bottom button ("1"): right side to GPIO13.

The GPIO will either send high impedance (mode input) or connect to 3V3/GND (mode output, high/low).

switch:
  - platform: template
    id: switch_1
    name: 'button 1'
    optimistic: true
    lambda: return id(switch_1).state;
    turn_on_action:
    - lambda: |-
        pinMode(13, OUTPUT);
        digitalWrite(13, LOW);
    turn_off_action:
    - lambda: |-
        pinMode(13, INPUT);
  - platform: template
    id: switch_2
    name: 'button 2'
    optimistic: true
    lambda: return id(switch_2).state;
    turn_on_action:
    - lambda: |-
        pinMode(27, OUTPUT);
        digitalWrite(27, HIGH);
    turn_off_action:
    - lambda: |-
        pinMode(27, INPUT);
  - platform: template
    id: switch_3
    name: 'button 3'
    optimistic: true
    lambda: return id(switch_3).state;
    turn_on_action:
    - lambda: |-
        pinMode(12, OUTPUT);
        digitalWrite(12, HIGH);
    turn_off_action:
    - lambda: |-
        pinMode(12, INPUT);
  - platform: template
    id: switch_4
    name: 'button 4'
    optimistic: true
    lambda: return id(switch_4).state;
    turn_on_action:
    - lambda: |-
        pinMode(14, OUTPUT);
        digitalWrite(14, HIGH);
    turn_off_action:
    - lambda: |-
        pinMode(14, INPUT);

button:
  - platform: template
    id: gate
    name: 'gate'
    icon: 'mdi:gate'
    on_press:
      then:
        - switch.turn_on: switch_2
        - delay: !lambda |-
            int delay_time = 600 + (rand() % 301);
            return (delay_time);
        - switch.turn_off: switch_2

The ESPHome switches are for pressing the buttons the same way it is possible to do physically, thus allowing to enter the settings. The ESPHome buttons are for reliable triggering of the gate opening/closing using the switches.

The random pressing time is to imitate a human behavior.

AliExpress link to buy the ESP32-DevKit-v1: https://l.kioa.net/printables/esp32-devkit-v1
(this link is affiliated, using it will cost you nothing, but will support my work)
(you can try and browse for other cheaper sellers, this is the one i ordered from)

Model origin

The author marked this model as their own original creation.

License