Hello Fellow ESP-Homers,
I am busy with a gate project so that I can control and monitor my gates. I am using a Sonoff SV, using GPIO 4+5 (SDA/SCL) with a PCF8574. I have connected a 3channel relay board to the PCF8574 (P0;P1;P2 (output mode)) for controlling the gate to open/close - pedestrian open - close disable. P5;P6;P7 (input mode) are used as binary_sensors for the gate status. Let me elaborate the latter …
P7 = Status ;;; P6 = Alarm ;;; P5 = Clutch Released.
P7 is the “Tri_State” related to this query here posted.
State=0 is the state given when the gate is fully closed;
State=1 is the state given when the gate is not closed (i.e. fully open or partially open);
State=0-1-0-1-0-1-0-1 … (and so on) when the gate is in motion (moving). The toggling of this state is 0.5s on ; 0.5s off ; 0.5s on ; 0.5s off ; … and so onward until the gate comes to rest where State 0 or State 1 will be reported. I would like to have the three state as: Open ; Closed ; Moving.
I hope I have given enough info here above.
How does one write the yaml on the ESP for the state of P7?
Here is the yaml I have done currently -
### Individual inputs on PCF8574 ###
- platform: gpio
name: "PCF8574 InputPin #7"
id: pin7
internal: false
pin:
pcf8574: pcf8574_hub
number: 7
mode: input
inverted: false
- platform: gpio
name: "PCF8574 InputPin #6"
id: pin6
internal: false
pin:
pcf8574: pcf8574_hub
number: 6
mode: input
inverted: false
- platform: gpio
name: "PCF8574 InputPin #5"
id: pin5
internal: false
pin:
pcf8574: pcf8574_hub
number: 5
mode: input
inverted: false
Any help will be highly appreciated. Thanks in advance.
Brian.