How do I refer to pins? No reaction from connected relay

I’m targeting the ESP32-POE. I’ve tried but I’m wondering if I should be referring to GPIO0 and GPIO1 instead as I get no reaction when I send messages to my predefined MQTT on_message

switch:
  - platform: gpio
    name: "Relay1"
    pin: 0
    id: relay1
    interlock: [relay2]
  - platform: gpio
    name: "Relay2"
    id: relay2
    pin: 1
    interlock: [relay1]
  on_message:
    - topic: traffic/green/on
      then:
        - switch.turn_on: relay2
    - topic: traffic/green/off
      then:
        - switch.turn_off: relay2

I’m not sending a payload, just sending a blank message to the topic.

I can see the device HAS connected to the broker.

Thank you

See: Configuration Types — ESPHome

So if you have this in your config:

esphome:
  board: esp32-poe

You can use any of the number mappings. e.g. pin: 1 or GPIO1

Try with a payload.

Thanks. I do have the board specified. I’ll do some more digging and see if I can figure it out! Posting full YAML below. Maybe I’m referring to the switches improperly here

    - switch.turn_off: relay2

Thanks for your help so far :slight_smile:

esphome:
  name: traffic
  platform: ESP32
  board: esp32-poe

mqtt:
  broker: 192.168.1.15
  client_id: Traffic
  topic_prefix: Traffic
  will_message:
    topic: traffic/avail
    payload: offline
  on_message:
    - topic: traffic/green/on
      then:
        - switch.turn_on: relay2
    - topic: traffic/green/off
      then:
        - switch.turn_off: relay2

logger:

api:
  password: "x"

ota:
  password: "x"

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0
  power_pin: GPIO12

switch:
  - platform: gpio
    name: "Relay1"
    pin: 0
    id: relay1
    interlock: [relay2]
  - platform: gpio
    name: "Relay2"
    id: relay2
    pin: 1
    interlock: [relay1]

Should there be any reason why I can’t use GPIO0 and GPIO1? The pinout suggests not, that they are free once programming is done, but in practice I can see that the software side of things is working - just that I/O pin isn’t responding on cue. I am using ethernet. Tempted to use WiFi temporarily and see if that resolves the issue…

EDIT: Moving to WiFi now gets me one of the relays working. The other one is just stuck on ‘ON’. So it looks like the pinout is wrong?

They’re probably not the best pins to use. See the table here: