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
This means many people (including myself) moved from RPi GPIO to Tasmota or ESPhome; less users means maintaining the GPIO integration may become an issue. I get the pain - my project needed a v2 complete with new hardware, new 3d printed case, and new software.
If you want a PIR sensor and controlled relay, my suggestion would be to avoid RPi GPIO and simply use the ESP8266 with ESPhome.
For many applications, the cost of parts is higher than buying a ready-made Sonoff or Shelly module and flashing with ESPhome / Tasmota (e.g. convenient, safe mains powered mains relays). Just be careful when adding sensors as these devices use mains-referenced power supplies.