Looping custom animation causes panels to turn on by themselves

Started by ForgedReality

ForgedReality

Hello. I wondered if anyone has encountered this before.

If I send a custom animation to a controller, but then turn it off, shortly after, it turns itself on again. I can only assume this happens when the loop restarts. It seems like a bug with the firmware. It should stay off, and resume the animation when turned back on again, but it seems to be conscious of the animation, and turns on when the loop value is set to true.

Example:
[code]
{
"write": {
"animData": "26 1 12 237 253 164 0 83 225 180 205 0 83 114 30 44 0 83 138 33 28 0 83 202 159 170 0 83 190 117 251 0 83 109 186 196 0 83 9 223 40 0 83 27 78 17 0 83 53 19 102 0 83 191 86 253 0 83 176 41 237 0 83 2 12 255 255 209 0 83 225 180 205 0 83 114 30 44 0 83 138 33 28 0 83 164 121 132 0 83 215 142 255 0 83 109 186 196 0 83 9 223 40 0 83 27 78 17 0 83 148 114 197 0 83 231 126 255 0 83 176 41 237 0 83 3 12 237 253 164 0 83 225 180 205 0 83 114 30 44 0 83 143 38 33 0 83 202 159 170 0 83 190 117 251 0 83 109 186 196 0 83 5 211 28 0 83 27 78 17 0 83 94 60 143 0 83 171 66 233 0 83 176 41 237 0 83 4 12 237 253 164 0 83 215 170 195 0 83 99 15 29 0 83 163 58 53 0 83 191 148 159 0 83 190 117 251 0 83 167 244 254 0 83 40 254 71 0 83 27 78 17 0 83 94 60 143 0 83 238 133 255 0 83 176 41 237 0 83 5 12 211 227 138 0 83 225 180 205 0 83 114 30 44 0 83 138 33 28 0 83 255 224 235 0 83 219 146 255 0 83 181 255 255 0 83 9 223 40 0 83 27 78 17 0 83 72 38 121 0 83 191 86 253 0 83 162 27 223 0 83 6 12 253 255 180 0 83 225 180 205 0 83 114 30 44 0 83 197 92 87 0 83 255 230 241 0 83 190 117 251 0 83 169 246 255 0 83 9 223 40 0 83 27 78 17 0 83 94 60 143 0 83 199 94 255 0 83 129 5 190 0 83 7 12 255 255 193 0 83 225 180 205 0 83 114 30 44 0 83 138 33 28 0 83 202 159 170 0 83 190 117 251 0 83 109 186 196 0 83 9 223 40 0 83 27 78 17 0 83 137 103 186 0 83 134 29 196 0 83 242 107 255 0 83 8 12 186 202 113 0 83 225 180 205 0 83 170 86 100 0 83 138 33 28 0 83 202 159 170 0 83 245 172 255 0 83 93 170 180 0 83 9 223 40 0 83 81 132 71 0 83 167 133 216 0 83 255 153 255 0 83 176 41 237 0 83 9 12 237 253 164 0 83 225 180 205 0 83 114 30 44 0 83 138 33 28 0 83 202 159 170 0 83 218 145 255 0 83 109 186 196 0 83 5 187 5 0 83 27 78 17 0 83 94 60 143 0 83 153 48 215 0 83 176 41 237 0 83 10 12 226 242 153 0 83 255 242 255 0 83 114 30 44 0 83 138 33 28 0 83 217 174 185 0 83 159 86 220 0 83 152 229 239 0 83 9 223 40 0 83 41 92 31 0 83 47 13 96 0 83 166 61 228 0 83 176 41 237 0 83 11 12 237 253 164 0 83 177 132 157 0 83 114 30 44 0 83 138 33 28 0 83 202 159 170 0 83 253 180 255 0 83 38 115 125 0 83 9 223 40 0 83 5 10 5 0 83 32 5 81 0 83 191 86 253 0 83 245 110 255 0 83 12 12 237 253 164 0 83 150 105 130 0 83 114 30 44 0 83 138 33 28 0 83 187 144 155 0 83 190 117 251 0 83 109 186 196 0 83 74 255 105 0 83 27 78 17 0 83 64 30 113 0 83 118 13 180 0 83 176 41 237 0 83 13 12 237 253 164 0 83 225 180 205 0 83 185 101 115 0 83 111 6 5 0 83 145 102 113 0 83 145 72 206 0 83 47 124 134 0 83 84 255 115 0 83 5 40 5 0 83 94 60 143 0 83 197 92 255 0 83 245 110 255 0 83 14 12 255 255 228 0 83 216 139 150 0 83 205 145 136 0 83 186 211 191 0 83 63 62 185 0 83 145 235 203 0 83 204 30 118 0 83 188 63 103 0 83 83 71 5 0 83 255 255 229 0 83 136 21 144 0 83 62 63 55 0 83 15 12 247 218 191 0 83 250 173 184 0 83 205 145 136 0 83 186 211 191 0 83 55 54 177 0 83 99 189 157 0 83 178 4 92 0 83 128 5 43 0 83 124 112 5 0 83 247 234 201 0 83 120 5 128 0 83 123 124 116 0 83 16 12 206 177 150 0 83 216 139 150 0 83 205 145 136 0 83 150 175 155 0 83 84 83 206 0 83 104 194 162 0 83 178 4 92 0 83 115 5 30 0 83 124 112 5 0 83 186 173 140 0 83 136 21 144 0 83 81 82 74 0 83 17 12 237 253 164 0 83 255 219 244 0 83 114 30 44 0 83 138 33 28 0 83 214 171 182 0 83 131 58 192 0 83 151 228 238 0 83 5 217 34 0 83 27 78 17 0 83 94 60 143 0 83 191 86 253 0 83 176 41 237 0 83 18 12 237 253 164 0 83 225 180 205 0 83 114 30 44 0 83 138 33 28 0 83 202 159 170 0 83 190 117 251 0 83 40 117 127 0 83 5 155 5 0 83 27 78 17 0 83 94 60 143 0 83 191 86 253 0 83 133 5 194 0 83 19 12 237 253 164 0 83 159 114 139 0 83 114 30 44 0 83 138 33 28 0 83 194 151 162 0 83 190 117 251 0 83 109 186 196 0 83 56 255 87 0 83 36 87 26 0 83 88 54 137 0 83 191 86 253 0 83 221 86 255 0 83 20 12 237 253 164 0 83 255 242 255 0 83 41 5 5 0 83 138 33 28 0 83 217 174 185 0 83 172 99 233 0 83 109 186 196 0 83 5 187 5 0 83 27 78 17 0 83 156 122 205 0 83 125 20 187 0 83 216 81 255 0 83 23 12 253 255 180 0 83 225 180 205 0 83 138 54 68 0 83 138 33 28 0 83 202 159 170 0 83 190 117 251 0 83 145 222 232 0 83 9 223 40 0 83 63 114 53 0 83 94 60 143 0 83 191 86 253 0 83 176 41 237 0 83 24 12 212 183 156 0 83 216 139 150 0 83 137 77 68 0 83 255 255 255 0 83 63 62 185 0 83 145 235 203 0 83 192 18 106 0 83 109 5 24 0 83 124 112 5 0 83 255 252 219 0 83 136 21 144 0 83 62 63 55 0 83 25 12 247 218 191 0 83 216 139 150 0 83 134 74 65 0 83 210 235 215 0 83 124 123 246 0 83 76 166 134 0 83 133 5 47 0 83 143 18 58 0 83 124 112 5 0 83 239 226 193 0 83 165 50 173 0 83 110 111 103 0 83 26 12 247 218 191 0 83 216 139 150 0 83 136 76 67 0 83 246 255 251 0 83 63 62 185 0 83 145 235 203 0 83 146 5 60 0 83 143 18 58 0 83 87 75 5 0 83 255 255 227 0 83 196 81 204 0 83 62 63 55 0 83 27 12 247 218 191 0 83 216 139 150 0 83 199 139 130 0 83 116 141 121 0 83 137 136 255 0 83 106 196 164 0 83 147 5 61 0 83 159 34 74 0 83 81 69 5 0 83 239 226 193 0 83 136 21 144 0 83 20 21 13 0 83 21 12 224 195 168 0 83 216 139 150 0 83 205 145 136 0 83 154 179 159 0 83 63 62 185 0 83 171 255 229 0 83 178 4 92 0 83 80 5 5 0 83 106 94 5 0 83 192 179 146 0 83 175 60 183 0 83 36 37 29 0 83",
"loop": true,
"animType": "custom",
"version": "2.0",
"command": "display",
"palette": []
}
}[/code]

Aliakbar Eski

I cannot reproduce this at all. I am running 5.1.0 as well

I send the following to my controller

{
    "write": {
        "animData": "2 1 2 255 0 0 0 20 0 0 0 0 20 2 2 0 0 0 0 20 0 255 0 0 20",
        "loop": true,
        "animType": "custom",
        "palette": [],
        "command": "display"
    }
}

And then I turn it off from the buttons on the controller. And it remains off.
The same behaviour if I turn it off from the openAPI as well by sending the following to /api/v1/<auth>/state:

{
    "on": {
        "value": false
    }
}

How are you turning it off?

ForgedReality

Either via the app, Google Home app, or the schedule I have set up which turns them off at night and back on in the morning. It's only ever an issue if I have sent a custom animation to the controller.

I've been able to work around the issue by setting the controller to one of the scenes in the Nanoleaf app, and then when I turn it off, it doesn't come back on by itself.

Aliakbar Eski

You should contact support. I am unable to reproduce this issue, which means probably this is something specific to your setup. I suspect something is turning your device on explicitly.

Regards

ForgedReality

Thanks for trying.

Your example doesn't trigger the issue on my panels, but perhaps a longer number of frames is doing it, or the fact that I'm changing every panel on my controller has something to do with it.

Aliakbar Eski

No problem!

I understand you have 26 panels. I don't have nearly that many panels at my home right now, but I will give this a shot when I go to the office after our local lockdowns end

Regards

ForgedReality

That's just one of my controllers. On another, I have 27, another I have 14, and another that I'm using as an herb garden grow light has only 2. The issue is arising on the first three. I will try it on the grow light to see if it occurs there as well.

Thank you.

ForgedReality

Followup:

I just sent this to my growlight controller to the <IP>:16021/api/v1/<auth_token>/effects endpoint:
[code]{
"write": {
"animData": "2 45 24 156 5 175 0 230 8 159 142 0 230 0 228 215 0 230 73 113 139 0 230 195 162 150 0 230 175 184 198 0 230 148 143 230 0 230 31 8 13 0 230 214 202 171 0 230 157 105 5 0 230 85 173 255 0 230 214 155 35 0 230 49 87 23 0 230 197 92 193 0 230 154 170 41 0 230 88 29 95 0 230 146 226 97 0 230 156 8 143 0 230 152 5 25 0 230 219 82 220 0 230 223 123 77 0 230 32 35 99 0 230 47 201 133 0 230 98 128 254 0 230 46 24 197 36 216 0 230 8 159 142 0 230 0 228 215 0 230 71 111 137 0 230 243 210 198 0 230 220 229 243 0 230 173 168 255 0 230 31 8 13 0 230 172 160 129 0 230 208 156 52 0 230 80 168 255 0 230 214 155 35 0 230 49 87 23 0 230 128 23 124 0 230 218 234 105 0 230 13 5 20 0 230 211 255 162 0 230 89 5 76 0 230 224 56 97 0 230 219 82 220 0 230 187 87 41 0 230 106 109 173 0 230 18 172 104 0 230 80 110 236 0 230",
"loop": true,
"animType": "custom",
"version": "2.0",
"command": "display",
"palette": []
}
}[/code]

This started the animation in the panels.

Then, I immediately sent the following PUT request to the <IP>:16021/api/v1/<auth_token>/state endpoint:
[code]{"on":{"value": false}}[/code]

The panels then faded out, and stayed off for a couple of minutes before turning back on automatically.

Apparently, I was mistaken before when I assumed it was resuming the animation. My custom animations typically fade very slowly. The growlight appears stuck on the colors it was on when I sent the command to turn it off. It came back on, but it doesn't appear to be animating. So it seems like it reaches the end of the animation and then turns back on, but does not actually continue animating.

Additionally, I just discovered that sending the off command again does not turn the panels off. They remain on, but the controller THINKS they are off. When I send a GET request to <IP>:16021/api/v1/<auth_token>/state, it returns the following response. Notice the on object is set to false:

[code]{
"brightness": {
"value": 100,
"max": 100,
"min": 0
},
"colorMode": "effect",
"ct": {
"value": 6500,
"max": 6500,
"min": 1200
},
"hue": {
"value": 0,
"max": 360,
"min": 0
},
"on": {
"value": false
},
"sat": {
"value": 0,
"max": 100,
"min": 0
}
}[/code]

After this, I pressed the power button on the controller and nothing happened. I pressed it again, and it finally turned off. I believe from the app, I was turning it on and off again before they would turn off when they got in this state, but I assumed it was a fluke within the app itself.

Just now, while writing this, they have turned themselves on again. To stop this happening, I will have to select a solid color or other built in effect from the app.

Maybe there is something off in my custom animation request but it follows the API documentation, and works just fine aside from this one issue. It's a problem because I like to have them slowly animating during the day, but when I turn them off at night, they come back on again if I don't change them to some other scene from the Nanoleaf app first.

Thank you.

ForgedReality

One more thing:

I tried removing "version": "2.0", from my request, since I noticed yours does not include it, and it had no effect on this issue. In the docs, section 3.2.4 states that the version string is required, but it doesn't seem to be. The command works if you omit the version, but I assume it reverts to 1.0.

HOWEVER:
The physical power button seems to work around this issue. I tried sending the software off request and it comes back on whether or not the version was included in the effect request. Pressing the physical button seems to behave differently, and the panels don't appear to turn back on by themselves.

EDIT:

Nevermind on everything I said about the power button behaving differently. I probably just didn't wait long enough the couple of times I tried it. It still comes back on.

I decided to try your example again, but lengthening it so that it was guaranteed to last longer than the power-off fade effect, and it behaves the same as my custom animations, even on the controllers that have more than 2 tiles attached:
[code]{
"write": {
"animData": "2 1 2 255 0 0 0 75 0 0 0 0 75 2 2 0 0 0 0 75 0 255 0 0 75",
"loop": true,
"animType": "custom",
"palette": [],
"command": "display"
}
}[/code]

Setting loop to false prevents the panels erroneously turning on again, but this defeats the whole purpose of the custom animations in the first place.

Aliakbar Eski

Thanks for your input, I could finally reproduce the issue. The secret was that it does take a long time to actually happen.

In anycase I have now fixed and it will be in the next release.

Thanks once again for reporting, and apologies that you had to face it.

Have a great weekend!

Regards