adonno / tagreader

Simple to build/use NFC tag reader, specially created for Home Assistant
https://adonno.com
GNU General Public License v3.0
1.13k stars 176 forks source link

Can't find a way... adding a swich to pin 5. #197

Closed Erestes closed 1 year ago

Erestes commented 1 year ago

I would like to add a piece of config that would allow connecting a switch to pin:5 but I keep failing... I've added the following into the switch section: `# Define the switch

What am I doing wrong?

adonno commented 1 year ago
binary_sensor:
  - platform: gpio
    id: button
    pin:
      number: GPIO14
      mode: INPUT_PULLUP
      inverted: true
    on_press:
      - switch.toggle: relay

this part is to have the switch working. in your Case the pin is GIPO14 (CF image)

image

This adds a switch in the interface that react base on the binary_sensor

switch:
  - platform: gpio
    name: ${plug_name}_relay
    id: relay
    pin: GPIO12