Skip to content

GPIO

OS Support:
gpio:
device: raspberryPi
binary_sensor:
- platform: gpio
name: 'Motion'
icon: 'mdi:motion-sensor'
device_class: presence
pin: 23
switch:
- platform: gpio
name: 'Relay'
pin: 5
inverted: false # optional, defaults to false
restore_mode: ALWAYS_OFF # optional, see below for allowed values

Uses the same pin, inverted and restore_mode options as ESPHome’s GPIO Switch (interlocking between switches is not supported).

PropertyDescriptionDefault
pinGPIO pin number to drive.(required)
invertedInverts the pin logic (true = active-low).false
restore_modeOne of ALWAYS_OFF, ALWAYS_ON, DISABLED.ALWAYS_OFF