I am new with HA and I cannot make the following to work.
I want to trigger a relay connected to the Raspberry Pi GPIO with a PIR sensor on a ESP8266.
I have the relay as a switch on the dashboard and working OK.
This is what I have so far.
On configuration.yaml I have the following:
switch:
- platform: rpi_gpio
switches:
- port: 20
name: `Relay 1`
unique_id: `pi_gpio_20`
invert_logic: true
ESP Wemos D1 with PIR sensor yaml:
binary_sensor:
- platform: gpio
pin: D6
name: `PIR Sensor`
device_class: motion
switch:
- platform: restart
name: `PIR Sensor Restart`