03-27-2023, 12:44 AM
it's normal, work well, because you have not set the INPUT trigger OUTPUT command.
such as these code:
switch:
- platform: gpio
name: "light1"
id: light1
pin:
pcf8574: pcf8574_hub_out_1
number: 0
mode: OUTPUT
inverted: true
------------------------------------
binary_sensor:
- platform: gpio
name: "input1"
on_press:
then:
- switch.toggle: light1
pin:
pcf8574: pcf8574_hub_in_1
number: 0
mode: INPUT
inverted: true
-----------------------------------------
the important is add these code:
on_press:
then:
- switch.toggle: light1
such as these code:
switch:
- platform: gpio
name: "light1"
id: light1
pin:
pcf8574: pcf8574_hub_out_1
number: 0
mode: OUTPUT
inverted: true
------------------------------------
binary_sensor:
- platform: gpio
name: "input1"
on_press:
then:
- switch.toggle: light1
pin:
pcf8574: pcf8574_hub_in_1
number: 0
mode: INPUT
inverted: true
-----------------------------------------
the important is add these code:
on_press:
then:
- switch.toggle: light1