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 valuesSwitch
Section titled “Switch”Uses the same pin, inverted and restore_mode options as ESPHome’s GPIO Switch (interlocking between switches is not supported).
| Property | Description | Default |
|---|---|---|
pin | GPIO pin number to drive. | (required) |
inverted | Inverts the pin logic (true = active-low). | false |
restore_mode | One of ALWAYS_OFF, ALWAYS_ON, DISABLED. | ALWAYS_OFF |