Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to connect switch to A32Pro
#6
for example: INPUT1 button TOGGLE switch01

  - platform: gpio
    name: A32 Pro Switch01
    id: "a32_pro_switch01"
    pin:
      xl9535: xl9535_hub_out1
      number: 0
      mode: OUTPUT
      inverted: true
 
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch01 Tuya
    dp_id: 101
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch01"


# ----------------------------------------------------------------

binary_sensor:
  - platform: gpio
    name: A32 Pro DI01
    on_press:
      then:
        - switch.toggle: a32_pro_switch01
    id: "a32_pro_di01"
    pin:
      xl9535: xl9535_hub_in1
      number: 0
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro DI01 Tuya
    dp_id: 133
    bind_binary_sensor_id: a32_pro_di01
    internal: true

--------------------------------------
so it's very easy, only add these command to your binary_sensor:
    on_press:
      then:
        - switch.toggle: a32_pro_switch01


if you want INPUT2 TOGGLE switch2, just add:
    on_press:
      then:
        - switch.toggle: a32_pro_switch02


understand now?
Reply


Messages In This Thread
How to connect switch to A32Pro - by drazvan2003 - 10-05-2024, 02:44 PM
RE: How to connect switch to A32Pro - by admin - 10-06-2024, 12:43 AM
RE: How to connect switch to A32Pro - by admin - 10-06-2024, 12:27 PM
RE: How to connect switch to A32Pro - by admin - 10-07-2024, 01:02 AM
RE: How to connect switch to A32Pro - by admin - 10-07-2024, 06:56 AM
RE: How to connect switch to A32Pro - by admin - 10-07-2024, 07:51 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)