Raspberry Pi Remote GPIO
The rpi_gpio
integration is the base for all related GPIO platforms in Home Assistant. For the platform configurations, please check their corresponding sections.
The remote Raspberry Pi and the control computer where Home Assistant is running must be prepared to run remote_rpi_gpio, see details here.
Note that for virtual environments you may need to set an environment variable when starting the environment to set the pin factory, example:
Environment = GPIOZERO_PIN_FACTORY=pigpio PIGPIO_ADDR=YOUR_RPi_IP_ADDRESS
Binary Sensor
The remote_rpi_gpio
binary sensor platform allows you to read sensor values of the GPIOs of a Remote Raspberry Pi.
To use your Remote Raspberry Pi’s GPIO in your installation, add the following to your configuration.yaml
file:
# Example configuration.yaml entry
binary_sensor:
- platform: remote_rpi_gpio
host: IP_ADDRESS_OF_REMOTE_PI
ports:
11: PIR Office
12: PIR Bedroom
For more details about the GPIO layout, visit the Wikipedia article about the Raspberry Pi.
Switch
The remote_rpi_gpio
switch platform allows you to control the GPIOs of a Remote Raspberry Pi.
To use your Remote Raspberry Pi’s GPIO in your installation, add the following to your configuration.yaml
file:
# Example configuration.yaml entry
switch:
- platform: remote_rpi_gpio
host: IP_ADDRESS_OF_REMOTE_PI
ports:
11: Fan Office
12: Light Desk
For more details about the GPIO layout, visit the Wikipedia article about the Raspberry Pi.
A common question is what does port refer to, this number is the actual GPIO #, not the pin #. For example, if you have a relay connected to pin 11 its GPIO # is 17.
# Example configuration.yaml entry
switch:
- platform: remote_rpi_gpio
host: 192.168.0.123
ports:
17: Speaker Relay
Troubleshooting
If you receive an error such as gpiozero.exc.BadPinFactory: Unable to load any default pin factory!
try changing the pinfactory from pigpio
to mock
, this addresses a known issue.