SamNL
Hi everyone,
I’m trying to send custom effects to my Nanoleaf Shapes via the local API, but I keep getting a 400 Bad Request response. Here’s my situation:
- Device/Model: Nanoleaf Shapes (Firmware 12.0.0)
-
API Endpoint:
PUT /api/v1/<auth_token>/effects
-
Headers:
Content-Type: application/json
-
Body: JSON with
"write": { ... }
specifying custom animData (either RGB or HSB).
My goal in the end is to create a progressbar-like effect with 15 Shapes for Shopify-orders that fills up during the day. I'll figure all the steps that require that out later, first just creating a gradient with 7 Shapes.
What I’ve Tried
-
Single panel test: Attempted sending a minimal “1 panel” JSON body with either
rgb
orhsb
colorType — still getting 400. -
Multiple panels: Tried listing all 7 illuminated panels (skipping the controller with ID=0) in the
animData
string, using both"animType":"custom"
and"animType":"static"
— same 400 error. -
Adding
palette
: Included a palette array in the JSON, just in case the firmware expects it — no improvement. - Replacing transitionTime: Used 0, 1, or -1 for transitionTime, verifying if that changes anything — no luck.
-
Checked basic calls:
-
GET /panelLayout/layout
works fine and returns the correct panel IDs. -
PUT /api/v1/<token>/state {"on": {"value": true}}
works (returns 204, turns the panels on). -
GET /api/v1/<token>/state
returns valid state data. - Only the
/effects
PUT withanimData
keeps giving me 400.
-
Sample JSON Body (one of many variations):
1{ 2 "write": { 3 "command": "display", 4 "animName": "AllGreen", 5 "animType": "custom", 6 "colorType": "rgb", 7 "loop": false, 8 "animData": "1 23855 0 255 0 1" 9 } 10}
Or (for multiple panels):
1{ 2 "write": { 3 "command": "display", 4 "animName": "GreenToOff", 5 "animType": "custom", 6 "colorType": "hsb", 7 "loop": false, 8 "animData": "7 23855 120 100 100 1 55920 120 100 90 1 ... 47664 120 100 0 1" 9 } 10}
I’ve tried all these variations, but always get a 400 error specifically on the /effects
endpoint.
Questions:
- Why might the Nanoleaf return a 400 for these valid-looking requests?
- Is there a different format or required field for Shapes firmware v12.0.0 that we’re missing?
- Do I need a different
"command"
value or a different"animType"
for custom static effects? - Is there an up-to-date official doc that shows the exact JSON keys needed for Shapes specifically on 12.0.0?
Any help would be hugely appreciated! Thanks in advance.