Raspberry Pi Remote GPIO
The remote_rpi_gpio
integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] 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 configured to be able to run remote_rpi_gpio
, see Configuring Remote GPIO
Note that for virtual environments, you may need to set an environment variable when starting the environment to set the pin factory, for example:
Environment = GPIOZERO_PIN_FACTORY=pigpio PIGPIO_ADDR=YOUR_RPi_IP_ADDRESS
Binary sensor
The remote_rpi_gpio
binary sensor integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] 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
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file.
After changing the configuration.yaml
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] file, restart Home Assistant to apply the changes. The integration is now shown on the integrations page under Settings > Devices & services. Its entities are listed on the integration card itself and on the Entities tab.
# 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
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
The configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more] 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
Note that a pin managed by Home Assistant is expected to be exclusive to Home Assistant.
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 GPIOZERO_PIN_FACTORY
environment variable from pigpio
to mock
, as this addresses a known issue