Hi I want use manual swich in esp when manual toggle change from off to on relay be on and when toggle swich changed from on to off relay be off too
I use 3 pin for it rx tx and sd3.
Pin rx and tx work fine.mean when I chang to toggle form on to of its been update very fast in home assistance but sd3 Stoke on off or on I test other pin like D1 ,D8 all other pin except rx and tx don’t be update and stock on off or on
switch:
- platform: gpio
name: "WC light"
pin:
number: 4
inverted: true
id: wc_light
- platform: gpio
name: "wc fan"
pin:
number: 2
inverted: true
id: wc_fan
- platform: gpio
name: "back yard light"
pin:
number: 14
inverted: true
id: bake_yard_light
#سنسور حرکت
binary_sensor:
- platform: gpio
pin: 16
# پین d5
name: "PIR Sensor"
device_class: motion
- platform: gpio
name: "wc light toggle"
pin:
number: 15
inverted: true
id: wc_light_toggle
on_press:
then:
- switch.turn_on: wc_light
on_release:
then:
- switch.turn_off: wc_light
- platform: gpio
name: "wc fan toggle"
pin:
number: 1
inverted: true
id: kitchin_light_toggle
on_press:
then:
- switch.turn_on: wc_fan
on_release:
then:
- switch.turn_off: wc_fan
- platform: gpio
name: "back yard light toggle"
pin:
number: 3
inverted: true
id: back_yard_light_toggle
on_press:
then:
- switch.turn_on: bake_yard_light
on_release:
then:
- switch.turn_off: bake_yard_light