**The context
Note :** This was the last thing I was doing, after that I’ll leave you alone, sorry for the flood of the last few days. But I wanted to close this home automation migration because afterwards I won’t have much time to take care of it.
When migrating from Home Assistant to Gladys, one of my biggest challenges was managing lighting scenes. I have 22 lights on 4 different protocols (Philips Hue, Z-Wave, MQTT, Tuya) and I wanted scenes that adapt to the time of day and the weather.
Gladys scenes allow controlling lights, but as soon as you want to manage variants (warmer colors when it’s gray, different ambiance day/night), it quickly becomes complex with many scenes to maintain.
So I created a Scenes Manager: a lightweight Docker container (~25 MB RAM) with a web interface that:
-
Captures the state of your lights in one click — all protocols, via the Gladys API
-
Stores presets with adaptive variants (day/night, weather)
-
Applies the right variant automatically when a Gladys scene calls it
How it works
Scene Gladys (trigger heure, presence, bouton, etc.)
└→ Action \"HTTP Request\" : POST http://localhost:8890/scenes/soiree-chambre/apply
└→ Scenes Manager
├─ Check : jour ou nuit ? (calcul local)
├─ Check : clair ou couvert ? (OpenWeatherMap, cache 10 min)
└─ Applique la bonne variante via l'API Gladys
The key point: the Scenes Manager knows no protocols. It goes through the Gladys API (POST /api/v1/device_feature/{selector}/value). If Gladys manages your light, the Scenes Manager manages it too.
Separation of responsibilities: Gladys decides when, the Scenes Manager decides how.
Tested protocols
| Protocole | Status |
|---|---|
| Philips Hue | OK (on/off, brightness, color, temperature) |
| Z-Wave (Fibaro Dimmer) | OK (dimmer 0-99) |
| MQTT custom | OK (on/off, brightness, color) |
| Tuya | OK (on/off) |
Performance
| Operation | Time |
|---|---|
| Capture 20 devices | ~80 ms |
| Apply 6 Hue in parallel | ~70 ms |
Negligible — it’s the same code path as native Gladys scenes.
Installation and documentation
Everything is on GitHub with the complete README, installation instructions, the API reference and screenshots.
GitHub — gladys-scenes-manager
In short:
-
Clone the repo
-
docker build -t scenes-manager . -
docker runwith yourpresets.json(Gladys API key config + GPS coordinates) -
Open
http://YOUR_IP:8890 -
Capture your ambiances, call them from Gladys scenes via « HTTP Request »
Stack
-
Node.js 22 Alpine, 2 dependencies (mqtt.js, suncalc)
-
Frontend vanilla (HTML/CSS/JS), dark theme inspired by Gladys
-
No framework, no database — a JSON file



