Esp home does not enable GPIOs

Hello, I’m running HA in Windows Docker. ESP Home is running on my ESP32 (Lillygo T-Display). https://www.espboards.dev/esp32/lilygo-ttgo-t-display-1-14/

When I toggle the GPIO entity in HA, the command reaches ESP Home, but it doesn’t toggle GPIO 2. Why is that?

Thats my Yaml Code for the GPIO:

switch:

  • platform: gpio
    pin: GPIO2
    name: “ESP Relais”
    id: esp_relais
    restore_mode: ALWAYS_OFF

My wiring and voltage are correct; I’ve tested them with a multimeter. The relay also switches when GPIO02 is connected to a 3.3V source. I’ve also tried GPIO 17, but unfortunately I’ve had the same problem.

You need to format your code using the </> button as the code is not easy to read if unformated. But your code looks fine, and the messages are getting to the esp, so its a wiring issue. How are you wiring it up, if powering the relay from a separate supply the GNDs will need to be connected. I am just guessing here, so tell us a bit more and we might spot the issue.

Hi Arh,

The relay is connected to the ESP’s GND. The relay does switch when GPIO02 is connected to 3.3V.

I get the feeling that ESP Home isn’t switching the GPIOs. I’m currently trying out some other GPIOs to find the fault.

Hell Arh,

I’ve discovered that not all the pins on my LilyGo ESP32 TDisplay can be controlled via ESPHome. Only pins 12, 13, 25 and 27. I’ve no idea what the others are used for.

Thanks for help!!!

I seriously doubt your solution is valid.

Show us ALL your yaml - you have possibly defined your board incorrectly.