Repository navigation
rocker Device
A rocker device exposes a rocker switch connected to a GPIO pin.
Homebridge RPi configures the GPIO pin for input.
By default, Homebridge RPi configures the internal pull-up resister for the GPIO pin.
Homebridge RPi configures pigpiod to send real-time notifications when the GPIO state changes.
Homebridge RPi debounces the input signal.
The device is exposed to HomeKit as a Stateless Programmable Switch service. The switch issues a Single Press event, each time the rocker is flipped.
All button and rocker devices for the same host are exposed under a single HomeKit accessory,
each as a separate Stateless Programmable Switch service.
Through this service, you can configure actions in HomeKit for Single Press, Double Press, and/or Long Press.
Apple's Home app shows one tile for all the Stateless Programmable Switch services,
with a separate Button section per service in the Configuration screen to configure the actions.
Note that you need a home hub for this.
The rocker device uses the following config.json keys:
| key | type | Description |
|---|---|---|
name |
string | The name for the device in HomeKit. |
gpio |
integer | The GPIO pin. |
pull |
string | The configuration of the internal pull-up/pull-down resistor for the GPIO pin: off, down, or up (default). |
debounceTimeout |
integer | Time in ms to ignore state changes after initial change. Default 20ms. |