servo device - ebaauw/homebridge-rpi GitHub Wiki
A servo device exposes a servo motor connected to a GPIO pin.
Homebridge RPi configures the GPIO pin for output.
Currently, Homebridge RPi is hard-coded to use pigpiod's default frequency and range for servo's.
The device is exposed as a separate HomeKit accessory, with a Switch service. Through this service, you can control the servo motor from HomeKit. The Target Tilt Angle values of -90°, ..., 0, ..., 90° are mapped to a pulse width of 500, ..., 1500, ..., 2500.
Homebridge RPi polls pigpiod to read back the servo motor's actual position, updating Current Tilt Angle.
rgpiod doesn't support reading the actual position.
Note that lg uses software timing for PWM and servo pulses, where pigpio uses hardware timing.
A note in the lg documentation warns about the use of software timed servo pulses:
I would only use software timed servo pulses for testing purposes. The timing jitter will cause the servo to fidget. This may cause it to overheat and wear out prematurely.
Note that Apple's Home app doesn't support the Tilt Angle characteristics. You need to use another HomeKit app to use them.
The servo device uses the following config.json keys:
| key | type | Description |
|---|---|---|
name |
string | The name for the device in HomeKit. |
gpio |
integer | The GPIO pin. |