I have a bunch of sonoff s31 power switches that I flashed with esphome long time ago and they have always worked fine. I’m repurposing one of them and updated the code. now I can’t get the power button status to show correctly or toggle.
this is what I had that worked.
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: bedroomff Power Button
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: bedroomff Power1
pin: GPIO12
id: relay
- platform: restart
name: bedroomff Restart
I changed it to this after looking at the docs, but still no luck. anything jump out at anyone?
binary_sensor:
- platform: gpio
pin:
number: 0
mode:
input: true
pullup: true
inverted: True
name: "Printer s31 Power Button"
on_press:
- switch.toggle: relay
switch:
- platform: gpio
name: "Printer s31"
pin: 12
id: relay
- platform: restart
name: "Printer s31"