Hi all,
Actualy I’m migrating my existing system from fhem/espeasy/tasmota to HA/esphome. Most parts are working fine but with one thing I’m struggeling.
I’ve a sonoff basic with esphome wich triggers a 2-pole impulse switch with 500ms pulses. This switch is used in combination with two 3-way switches to turn on/off ceiling lights.
Here a snip of my current esphome yaml:
binary_sensor:
- platform: gpio
pin:
number: GPIO14
mode:
input: true
pullup: true
inverted: true
name: "Sonoff Basic Button"
switch:
- platform: gpio
pin: GPIO12
id: relay
- platform: template
name: "Sonoff Basic Relay"
icon: "mdi:lightbulb"
turn_on_action:
- switch.turn_on: relay
- delay: 500ms
- switch.turn_off: relay
GPIO12 is controlling the original sonoff relay which triggers the impulse switch.
GPIO14 is a input using a opto-coupler to check if light are powered or not.
At HA I’m able to turn on and of the lights, but I don’t have any clue how to use GPIO14 as the state. The toggle button at HA turn off imediatelly after switching the button, because it represents the state of the sonoff relay, but I want to see the state of the lights.
Does anybody have a similar setup or any idea/hint how I can setup the ESPHome/Sonoff device that it behaves as wanted?
BR
Kauli80