WiZ lamps
WiZ bulbs accept JSON over UDP port 38899 on the local network, no cloud or account needed. The controller isn't on your LAN, so the phone sends the packets:
adb shell 'echo "{\"method\":\"setPilot\",\"params\":{\"state\":true,\"sceneId\":12,\"dimming\":100}}" | nc -u -w 2 192.168.1.50 38899'
# reply: {"method":"setPilot","env":"pro","result":{"success":true}}(or from Termux over SSH: echo '{...}' | nc -u -w2 <bulb-ip> 38899)
Methods
| Method | Params | |
|---|---|---|
getPilot |
{} |
current state, scene, dimming, rssi |
setPilot |
state |
true/false |
sceneId |
see below | |
dimming |
10–100 | |
temp |
2200–6500 (K) | |
r,g,b |
0–255 | |
getSystemConfig |
{} |
MAC, firmware |
Scene ids
1 Ocean · 2 Romance · 3 Sunset · 4 Party · 5 Fireplace · 6 Cozy · 7 Forest · 8 Pastel colors · 9 Wake up · 10 Bedtime · 11 Warm white · 12 Daylight · 13 Cool white · 14 Night light · 15 Focus · 16 Relax · 17 True colors · 18 TV time · 19 Plantgrowth · 20 Spring · 21 Summer · 22 Fall · 23 Deepdive · 24 Jungle · 25 Mojito · 26 Club · 27 Christmas · 28 Halloween · 29 Candlelight · 30 Golden white · 31 Pulse · 32 Steampunk
Room = all bulbs together
scripts/lamps.py sends the same command to every bulb in BULB_MACS, with 3 attempts, and only reports ok when every bulb answered success:true.
Discovery by MAC
Bulb IPs change after power cuts and router restarts. MACs never change. lamps.py discover:
- ping-sweeps
LAN_PREFIX.2-254from the phone (fills the ARP table), - reads
ip neigh, - maps
BULB_MACS→ IPs and caches them inbulbs.json. It runs automatically when the first attempt fails.
Schedule
scripts/scheduler.py reads LAMP_SCHEDULE (default 18:00=day,22:00=on,02:00=night,04:00=off). Each slot fires once, no catch-up (a slot missed by more than SCHEDULE_GRACE_MIN is skipped) and restarting the scheduler never re-applies the current slot.
Backup in the WiZ app: create the same schedules in the app (Automation → Schedules → add, pick the room/all bulbs, fixed time, Sun–Sat, mode, no end time). These run on the bulbs themselves, so they work even when the phone or controller is offline, as long as the bulbs are on Wi-Fi. Running both is harmless, since they set the same modes.
Gotchas
- Bulbs that drop off the extender overnight will miss both schedules. Restart the extender or move the bulb closer to the main router.
ncon Android/Termux: use-u -w 2, and wrap intimeout 4so it never hangs.