Static Effects

Started by empty__wind
Fef2c97cb297ddb23c872f3dc1ea7385?s=128&d=mm

empty__wind

Hello, I put together a module a while back and there was the ability to set static scenes. I've upgraded everything and picked up another aurora, however it looks like the static URL I tried in the past doesn't work anymore. This is the command that used to work:

Putting this JSON
'{"write":{"command":"display","version":"1.0","animType":"static","animData":"1 74 1 255 0 0 0 1","loop":false}}'

To this endpoint
"http://192.168.0.1:16021/api/v1/APITOKENj/effects"

It sets the effect to static, in this case just a single red panel. However, the actual panel isn't red. On the app, it shows that the static scene is active, however turning the panel off and then back on, I get an unlit panel.

What am I missing to activate a static effect?

C39416f4bdabbd5010f596095fb24348?s=128&d=mm

Aliakbar Eski

Hey @empty__wind

panelIds are not the same between 2 different Aurora's and panels. Static effects cannot be shared between controllers because the panelId from one layout will not correspond to a panel on another layout (it may not even exist).

In this case, the panel 74 does not exist in your layout. It existed in a previous layout, yes. In which case it would turn red.

The controller does not throw an error because it cannot determine if you actually do not own a panel with Id 74 or you simply removed it from the layout for the time being. In this case, it will defer this decision to the user, who has more knowledge.

If you need information / help about how to get the panelIds for the panels and so on, I am right here to help!

Hope this helps.

Regards

Fef2c97cb297ddb23c872f3dc1ea7385?s=128&d=mm

empty__wind

It absolutely does. D'oh! Rookie mistake, should have read the docs more carefully. Thanks!!

Fef2c97cb297ddb23c872f3dc1ea7385?s=128&d=mm

empty__wind

If it might not be asking too much, I have another question. Rather than setting static, I thought it might be simpler to directly change the hue/saturation/brightness on my single panel display. I think I'm missing something, as I'm writing this json

{"write":{"command":"displayTemp","version":"1.0","animType":"solid","palette":[{"hue":"40","saturation":"50","brightness":"30"}],"colorType":"HSB"}}

To this endpoint

"http://192.168.0.1:16021/api/v1/token/effects"

But getting RESPONSECODE:400 Bad Request

Am I missing something simple again?

Fef2c97cb297ddb23c872f3dc1ea7385?s=128&d=mm

empty__wind

Sorry to answer my own post, but figured it out, proper JSON is:

{"write":{"command":"display","version":"1.0","animType":"solid","palette":[{"hue":181,"saturation":9,"brightness":100}],"colorType":"HSB"}}

I had to change displayTemp to display, which is different from the docs on this page:

https://forum.nanoleaf.me/docs/openapi#_yvkl74bgmtgu

C39416f4bdabbd5010f596095fb24348?s=128&d=mm

Aliakbar Eski

actually surprised that worked haha.

The even more easier and correct way is to set the hue and saturation values from the /state endpoint rather than effects

Fef2c97cb297ddb23c872f3dc1ea7385?s=128&d=mm

empty__wind

I did it via an effect so that I can change all three values simultaneously rather than 3 separate operations.

If I send all three values to the state endpoint, I get a bad request:

{"hue":181,"saturation":200,"brightness":50}'

"http://192.168.0.1:16021/api/v1/token/state"

returns RESPONSECODE:400 Bad Request

C39416f4bdabbd5010f596095fb24348?s=128&d=mm

Aliakbar Eski

try:
{"hue":{"value":181}, "sat":{"value":100}, {"brightness":{"value":50}}

Also saturation cannot be more than 100. Its actually a percentage

Regards