Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lesson9 - integrate KC868-Server to home assistant by MQTT
#34
(04-21-2023, 10:49 AM)admin Wrote: 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


i have write the code in file , getting some error - tried to fix but seems some "TAB" "SPACE" issue please help below code 

switch:
  - platform: gpio
    name: "e16s-output1"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true


binary_sensor:
  - platform: gpio
    name: "e16s-input1"
    on_press:
    then:
    - switch.toggle: output1
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true
Thanks & Regards,
Arshad Abbas
Smile
Reply


Messages In This Thread
RE: Lesson9 - integrate KC868-Server to home assistant by MQTT - by ARSHAD - 04-21-2023, 12:22 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)