Repository navigation
Releases: DevinMB/sit-light-controller
Release list
Home Assistant backend
Replaces the Philips Hue bridge backend with Home Assistant. The bridge this project talked to no longer exists; Home Assistant now owns the bulbs.
hue_controller.py keeps its class name and method signatures and translates each Hue call into the equivalent Home Assistant service call, so sit_light_controller.py is unchanged from v2.1.1.
Breaking changes
BRIDGE_IP, USER_TOKEN and LIGHT_ID are no longer used. Set these instead:
| Variable | Example |
|---|---|
HA_BASE_URL |
http://192.168.1.5:8123 |
HA_TOKEN |
Home Assistant long-lived access token |
HA_ENTITY_ID |
light.basement_track_left |
HA_TIMEOUT |
optional, seconds, default 10 |
ON_CONFIG / OFF_CONFIG keep Hue's shape and are translated at the boundary, so no env reformatting is needed:
Hue PUT /lights/<id>/state {"on": true, "xy": [x,y], "bri": n}
HA POST /api/services/light/turn_on {"entity_id": E, "xy_color": [x,y], "brightness": n}
Hue PUT /lights/<id>/state {"on": false}
HA POST /api/services/light/turn_off {"entity_id": E}
Preserved
set_previous_light_config() still snapshots the light's current state into off_config, so sit-up restores whatever the light was before rather than forcing a fixed colour — it now reads Home Assistant's state object instead of the bridge's.
Network errors are caught and logged rather than raised, so an unreachable light cannot kill the Kafka consumer loop.
Changed
make_api_call_to_group() is a logged no-op. The 100-sit celebration used Hue group ids and a Hue scene that existed only on the bridge, so it degrades to the single light. To restore it, map those to a Home Assistant scene and call scene.turn_on.
Also fixed
compose.yaml declared LIGHT_OFF_CONFIG / LIGHT_ON_CONFIG, but the code has always read OFF_CONFIG / ON_CONFIG, and GROUP_OR_LIGHT was never declared at all. Also removed command: tail -f /dev/null, which keeps PID 1 alive after the app crashes so the container reports Up while doing nothing and restart: always never fires.
Use previous state of light so its less annoying
when getting out of chair, use the previous state of the light. When using LIGHT config. GROUP config operates the same as it used to.
yay groups and zones can now be controlled
we got zones
update for json parsing
second release of the sit light controller
now with env variables