-
Notifications
You must be signed in to change notification settings - Fork 1
Development Notes
djmattyb206 edited this page Feb 4, 2026
·
2 revisions
TrimlightHomeAssistant/
custom_components/trimlight/
__init__.py
api.py
coordinator.py
light.py
select.py
button.py
config_flow.py
const.py
strings.json
translations/en.json
Base URL: https://trimlight.ledhue.com/trimlight
Trimlight uses HMAC auth: authorization = base64(HMAC_SHA256("Trimlight|<client_id>|<timestamp_ms>", client_secret))
Headers: authorization: S-ClientId: <client_id> S-Timestamp: <timestamp_ms> Content-Type: application/json
-
List devices
GET /v1/oauth/resources/devices?page=0- Fallback: POST with JSON body
{ "page": 0 }
-
Get device details
POST /v1/oauth/resources/device/get- Requires
currentDatepayload
-
Update switch state
POST /v1/oauth/resources/device/update- Payload:
{"deviceId": "...", "payload": {"switchState": 1}}
-
Preview built‑in
POST /v1/oauth/resources/device/effect/preview- Payload includes
category=0,mode,speed,brightness
-
Run preset
POST /v1/oauth/resources/device/effect/view- Payload includes
id
{ "year": YY, // year - 2000 "month": M, "day": D, "weekday": 1..7, // Sunday=1 "hours": H, "minutes": M, "seconds": S }
- Built‑in presets cached once.
- Custom presets cached in HA storage.
- Human‑readable cache stored in HA config folder.
Recommended:
- HACS validation
- hassfest