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 for more details. Unfortunately, this setup is not currently possible with remote, Raspberry Pi 5 hosts, due to a lack of support in pigiod.

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.yamlThe 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.yamlThe 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

Configuration Variables

host string Required

IP Address of remote Raspberry Pi.

ports map Required

List of used ports.

port: name string Required

The port numbers (BCM mode pin numbers) and corresponding names.

invert_logic boolean (Optional)

If true, inverts the output logic

Default:

false (ACTIVE HIGH)

pull_mode string (Optional, default: UP)

Type of internal pull resistor to use. Options are UP - pull-up resistor and DOWN - pull-down resistor. Pull-Up defaults to active LOW and Pull-down defaults to active HIGH. This can be adjusted with invert_logic

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.yamlThe 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

Configuration Variables

host string Required

IP Address of remote Raspberry Pi.

ports list Required

Array of used ports.

port integer | string Required

Port numbers and corresponding names (GPIO

invert_logic boolean (Optional, default: false)

If true, inverts the output logic to ACTIVE LOW.

For more details about the GPIO layout, visit the Wikipedia article about the Raspberry Pi.

Note

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.