Nanoleaf Binding OH3 - Stabilization Update

Just a heads up:

  • First of all, I would recommend to anyone who runs the Nanoleaf Binding to “watch” this thread here as I intend to give updates from time to time.
  • Second: There is another update coming soon. The background behind that is that Kai Kreuzer (Openhab Lead) who himself owns a Nanoleaf supported us by providing some improvements on the binding. Though it will improve the binding, it will break the usage a bit. I am working on checking the impacts and after I am done with the testing (which will take some more days) I will provide a detailed “migration” plan which will hopefully not very painful (I doubt it) :slight_smile: So stay tuned.
1 Like

Great news, thank you :slight_smile: I subscribed to this thread.

If There is any need for further testing, I’ll gladly assist! I’ve also access to a friend’s installation with further nanoleaf.

We’re both on oh 3.0 stable.

Hello @Kai , Stefan suggested I copy you in this.

I installed the snapshot from above for a buddy in his installation, because we didn’t get the hexagons working with the 3.0.0 version.

His current OH3 version:

[21:34:00] openhabian@Jarilo:~$ openhab-cli info
Version:     3.0.0 (Build)

bundle:list
275 │ Active │  80 │ 3.1.0.202103211236      │ openHAB Add-ons :: Bundles :: Nanoleaf Binding

After installing, we were finally able to add the hexagons from the inbox as a thing and get an auth token. Everything seems to be working fine, just two minor issues:

  • the hexagon controller has a built in mic / rhythm module, yet the channels concerning the rhythm say it’s neither connected nor active
  • i get an occasional error in the logs like this

openhab.log:2021-03-21 21:10:20.103 [WARN ] [ore.internal.thing.ThingTypeResourc
e] - Cannot find channel type: system:color-temperature-abs

I assume that’s some new OH 3.1 feature that’s not active with this install (I didn’t want to change somebody else’s full install to an experimental/testing branch …)

So after adding the hexagons to the model etc, I went to the inbox again to scan for the individual panels. That worked fine and I randomly added two panels as things and linked new items to their color channels. (goal: identify the channels to start testing the touch event).

But with those items, I couldn’t control the panels at all.

2021-03-21 16:20:46.020 [WARN ] [nternal.handler.NanoleafPanelHandler] - Handling command 272,100,100 for channelUID nanoleaf:lightpanel:5B4338595BC9:37180:color failed: Nanoleaf did not expect this request. HTTP response code 400

I figured, maybe I should switch the thing type from “canvas” to “Lightpanel”, it’s not the canvas after all, but the new panels.

And that broke it completely:

2021-03-21 16:30:18.190 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/nanoleaf:controller:5B4338595BC9/config'

java.lang.IllegalStateException: Thing with UID nanoleaf:controller:5B4338595BC9 has no handler attached.

	at org.openhab.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:96) ~[?:?]

	at org.openhab.core.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:504) [bundleFile:?]

	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]

	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]

	at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) [bundleFile:1.0.9]

	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [bundleFile:1.0.9]

	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) [bundleFile:1.0.9]

	at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) [bundleFile:1.0.9]

	at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [bundleFile:1.0.9]

	at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) [bundleFile:1.0.9]

	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [bundleFile:1.0.9]

	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [bundleFile:1.0.9]

	at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [bundleFile:1.0.9]

	at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [bundleFile:1.0.9]

	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [bundleFile:1.0.9]

	at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [bundleFile:1.0.9]

	at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [bundleFile:1.0.9]

	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [bundleFile:1.0.9]

	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPut(AbstractHTTPServlet.java:237) [bundleFile:1.0.9]

	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) [bundleFile:3.1.0]

	at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [bundleFile:1.0.9]

	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:852) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:544) [bundleFile:9.4.20.v20190813]

	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [bundleFile:?]

	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:536) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1581) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1307) [bundleFile:9.4.20.v20190813]

	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:293) [bundleFile:?]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:482) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1204) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [bundleFile:9.4.20.v20190813]

	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [bundleFile:?]

	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.Server.handle(Server.java:494) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:374) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:268) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:367) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) [bundleFile:9.4.20.v20190813]

	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) [bundleFile:9.4.20.v20190813]

	at java.lang.Thread.run(Thread.java:834) [?:?]

I unliked and deleted the items and deleted the entire thing (panels + controller).

The panels weren’t found with an inbox scan any more. I added them manually, and when trying to get a token, this happened:

2021-03-21 16:38:54.482 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:controller:752cc08d79' changed from UNKNOWN to OFFLINE (CONFIGURATION_PENDING): Kein Authentifizierungstoken gefunden. Um das Pairing zu starten, den An/Aus-Knopf am Controller für 5-7 Sekunden lang gedrückt halten, bis die LED anfängt zu blinken.
2021-03-21 16:39:14.481 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:controller:752cc08d79' changed from OFFLINE (CONFIGURATION_PENDING): Kein Authentifizierungstoken gefunden. Um das Pairing zu starten, den An/Aus-Knopf am Controller für 5-7 Sekunden lang gedrückt halten, bis die LED anfängt zu blinken. to OFFLINE (COMMUNICATION_ERROR): Pairing fehlgeschlagen. Berechtigungsanfrage konnte nicht an den Controller gesendet werden.0

Apparently something really got stuck … due to changing the thing type?

I restarted the openhab.service … and after that, the panels appeared in the inbox again and I could add them as a thing just fine, again.

Since it’s an experimental snapshot, for now I will cease experimenting with the indidivual panel things, but also since it’s an experimental snapshot, I figured those logs might be helpful for Stefan or you :slight_smile:

Maybe the tinkering with the panel thing wasn’t the cause after all?

It was working fine for some time, but now this happened:

==> /var/log/openhab/openhab.log <==

2021-03-22 00:11:06.702 [WARN ] [al.handler.NanoleafControllerHandler] - Status update failed: Failed to send OpenAPI request

==> /var/log/openhab/events.log <==

2021-03-22 00:11:06.707 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:controller:B150AB0CFC01' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Netzwerk und Konfiguration des Controllers prüfen.

Note that this is a different controller, one of the old triangle shapes that was running fine before.

shortly after the hexagon controller suffered the same fate:

==> /var/log/openhab/openhab.log <==

2021-03-22 00:16:33.991 [WARN ] [al.handler.NanoleafControllerHandler] - Status update failed: Failed to send OpenAPI request

==> /var/log/openhab/events.log <==

2021-03-22 00:16:33.998 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:controller:5B4338595BC9' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Netzwerk und Konfiguration des Controllers prüfen.

and now it’s back

2021-03-22 00:25:49.408 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:controller:5B4338595BC9' changed from OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Netzwerk und Konfiguration des Controllers prüfen. to ONLINE

the other one is still offline though. I can’t rule out that this is just a wifi problem, but at the same time, the controllers still were available in the nanoleaf app.

I am having similar issues with my new canvas panel. Openhab loses connection so I need to use the normal app. It used to work great with my original nanoleafs. Don’t know the status now though because I have not mounted them after moving.

I think there’s something that makes the binding lose connection until you restart openhab currently.

This is exactly the issue I am having that I described here: [SOLVED] httpClient keeps failing Get-Request after onQueued with Timeout

We basically had the hope it would only appear in my environment but it turns out that it seems to be a more common issue. As you can see in the thread I do have a solution but we are not sure if it is okay to solve it that way (I basically cure the symptom because I tried to find the root cause which seems to be buried very deep somewhere else in a library that I have no access to).

I can provide with a patched version that I am using for 2 weeks now which at least in my environment turned out to be stable.

@Daniel_O @Masssssy tell me if you want to try out that version and I will upload a binding file. Do you know how to install that?

regards
Stefan

You mean like a .jar? Sure, that’s what I did with the snapshot already :slight_smile:

I didn’t notice this behavior at my own installation so far though! Or maybe I just didn’t notice it. I’ll keep an eye on it.

The risk of side effects would be higher in connection with other http bindings, right? That should be a lot? At home I can think of xiamo cloud vacuum robot and weather binding, maybe also sonos. my friend has WLED and shelly (not sure if it’s http?).

what kind of possible side effects could be expected? I don’t fear them, just to know what to look for. if it’s something severe, i’ll just revert back :slight_smile:

I cannot tell you for sure what the sideeffects are or could be but I can try to guess:

The way it works is that

  • each binding that uses http requires a so-called http-client to perform requests which basically is a parallel thread that handles http requests.
  • from what I understood openhab provides such a client thread from a pool (I which basically allows to create a http connection to a binding and the number by default in the whole openhab instance is 64 (parallel threads for the bindings)
  • if more than “64” bindings (or anything else within OH) requires an http client these are most likely shared between the ones that need it (I don’t know the insides but that’s what I think happens).
  • what I can see in my installation that all bridges (controllers) of the nanolead binding get the same client connection thread (I have four nano controllers and all use the same http client instance id)
  • what the fix does is that it checks if a client connection runs into a timeout and then “restarts” the http client connection that was given to the binding (note that afaik there is no way of detecting on the http-client from the outside if there is something wrong).

So what could happen?

My guess is: IF the same client connection was used by a different binding and the other binding is in the midst of running a request when the nanoleaf binding is restarting the http client I think this request would probably fail. However, I would think that if that binding used that same client for its request it would fail with the request anyway similar to why the nanoleaf binding failed towards a timeout.

Does that answer your question?

So just have a lookout for similiar error messages. Got it.

Alright, I tested the snapshot binding that you sent. Removed the thing, stopped OH service, copied the jar and started OH again. Waited a bit and then added the thing again.

At first there was quite some action:

2021-03-22 22:07:22.044 [WARN ] [nding.nanoleaf.internal.OpenAPIUtils] - OpenAPI request failed with timeout

java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed

	at org.eclipse.jetty.client.HttpDestination$TimeoutTask.onTimeoutExpired(HttpDestination.java:529) ~[?:?]

	at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:282) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:834) [?:?]

2021-03-22 22:07:22.050 [WARN ] [nding.nanoleaf.internal.OpenAPIUtils] - restarting httpClient

==> /var/log/openhab/events.log <==

2021-03-22 22:07:23.826 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'wled:wled:8fa7313c45' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): ExecutionException: java.util.concurrent.RejectedExecutionException: HttpClient@1f597c3{STOPPING} is stopped

2021-03-22 22:07:24.058 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'wled:wled:ecfabc5f1455' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): ExecutionException: java.util.concurrent.RejectedExecutionException: HttpClient@1f597c3{STOPPING} is stopped


==> /var/log/openhab/openhab.log <==

2021-03-22 22:07:52.066 [WARN ] [e.jetty.util.thread.QueuedThreadPool] - QueuedThreadPool[OH-httpClient-common]@9fb5c9{STOPPING,10<=0<=40,i=8,r=-1,q=0}[NO_TRY] Couldn't stop Thread[OH-httpClient-common-136,5,main]

2021-03-22 22:07:52.069 [WARN ] [e.jetty.util.thread.QueuedThreadPool] - QueuedThreadPool[OH-httpClient-common]@9fb5c9{STOPPING,10<=0<=40,i=8,r=-1,q=0}[NO_TRY] Couldn't stop Thread[OH-httpClient-common-137,5,main]

2021-03-22 22:07:52.101 [WARN ] [nding.nanoleaf.internal.OpenAPIUtils] - OpenAPI request failed. Couldn't restart httpClient: 

org.openhab.binding.nanoleaf.internal.NanoleafException: Failed to send OpenAPI request: Timeout. Restarted httpclient

	at org.openhab.binding.nanoleaf.internal.OpenAPIUtils.restartHttpClient(OpenAPIUtils.java:149) [bundleFile:?]

	at org.openhab.binding.nanoleaf.internal.OpenAPIUtils.sendOpenAPIRequest(OpenAPIUtils.java:134) [bundleFile:?]

	at org.openhab.binding.nanoleaf.internal.handler.NanoleafControllerHandler.receiveControllerInfo(NanoleafControllerHandler.java:628) [bundleFile:?]

	at org.openhab.binding.nanoleaf.internal.handler.NanoleafControllerHandler.updateFromControllerInfo(NanoleafControllerHandler.java:542) [bundleFile:?]

	at org.openhab.binding.nanoleaf.internal.handler.NanoleafControllerHandler.runUpdate(NanoleafControllerHandler.java:360) [bundleFile:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:834) [?:?]

Caused by: java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed

	at org.eclipse.jetty.client.HttpDestination$TimeoutTask.onTimeoutExpired(HttpDestination.java:529) ~[?:?]

	at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:282) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]

	... 3 more

2021-03-22 22:07:52.105 [WARN ] [al.handler.NanoleafControllerHandler] - Status update failed for controller nanoleaf:controller:5B4338595BC9 : Failed to send OpenAPI request: Timeout

==> /var/log/openhab/events.log <==

2021-03-22 22:07:52.107 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:controller:5B4338595BC9' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Konfiguration des Controllers prüfen.

2021-03-22 22:07:53.900 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'wled:wled:8fa7313c45' changed from OFFLINE (COMMUNICATION_ERROR): ExecutionException: java.util.concurrent.RejectedExecutionException: HttpClient@1f597c3{STOPPING} is stopped to ONLINE

2021-03-22 22:07:54.148 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'wled:wled:ecfabc5f1455' changed from OFFLINE (COMMUNICATION_ERROR): ExecutionException: java.util.concurrent.RejectedExecutionException: HttpClient@1f597c3{STOPPING} is stopped to ONLINE


2021-03-22 22:08:52.520 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:controller:5B4338595BC9' changed from OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Konfiguration des Controllers prüfen. to ONLINE

Note how it also killed the WLED binding.

However, after that massacre, no further error messages in that regard.

Then I wanted to try to add an individual panel again.

Wanted to choose which one, but

openhab> openhab:nanoleaf layout nanoleaf:controller:5B4338595BC9
35050

only gave me this one ID back (there should be 9 panels)

I started a scan from the inbox and chose the one that was listed there, and another random one (25198). Create an item for the color channel and add it to the model.

Now, first weird thing … although in the ui, it’s configured like the controller color channel, in the model, it doesn’t have the color selector widget per default? I added it through meta data and then it works … at least in the ui. When choosing a color, this happens:

2021-03-22 22:20:20.362 [INFO ] [al.handler.NanoleafControllerHandler] - Received command 140,100,58 for channel nanoleaf:controller:5B4338595BC9:color

==> /var/log/openhab/events.log <==

2021-03-22 22:20:22.315 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Hexagon_Farbe' received command 140,100,56

2021-03-22 22:20:22.317 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Hexagon_Farbe' predicted to become 140,100,56

2021-03-22 22:20:22.324 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Hexagon_Farbe' changed from 140,100,58 to 140,100,56

==> /var/log/openhab/openhab.log <==

2021-03-22 22:20:22.328 [INFO ] [al.handler.NanoleafControllerHandler] - Received command 140,100,56 for channel nanoleaf:controller:5B4338595BC9:color

==> /var/log/openhab/events.log <==

2021-03-22 22:20:22.526 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Hexagon_Farbe' received command 140,100,39

2021-03-22 22:20:22.529 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Hexagon_Farbe' predicted to become 140,100,39

2021-03-22 22:20:22.537 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Hexagon_Farbe' changed from 140,100,56 to 140,100,39

2021-03-22 22:20:24.679 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'mqtt:topic:dc7c69f665:0f55b4fd9c' changed from OFFLINE to ONLINE

2021-03-22 22:20:27.684 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'LightPanel25198_Farbe' received command 68,100,100

2021-03-22 22:20:27.686 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'LightPanel25198_Farbe' predicted to become 68,100,100

2021-03-22 22:20:27.689 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LightPanel25198_Farbe' changed from 66,100,100 to 68,100,100

2021-03-22 22:20:28.110 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'LightPanel25198_Farbe' received command 76,100,100

2021-03-22 22:20:28.112 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'LightPanel25198_Farbe' predicted to become 76,100,100

2021-03-22 22:20:28.118 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LightPanel25198_Farbe' changed from 68,100,100 to 76,100,100

2021-03-22 22:20:28.904 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'LightPanel25198_Farbe' received command 165,100,100

2021-03-22 22:20:28.907 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'LightPanel25198_Farbe' predicted to become 165,100,100

2021-03-22 22:20:28.914 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LightPanel25198_Farbe' changed from 76,100,100 to 165,100,100

==> /var/log/openhab/openhab.log <==

2021-03-22 22:20:29.372 [INFO ] [nternal.handler.NanoleafPanelHandler] - sending effect command from panel nanoleaf:lightpanel:5B4338595BC9:25198: {"write":{"command":"display","animType":"static","animName":"","palette":[],"colorType":"","animData":"1 25198 1 221 255 0 0 10","loop":false}}

2021-03-22 22:20:29.397 [WARN ] [nternal.handler.NanoleafPanelHandler] - Handling command 68,100,100 for channelUID nanoleaf:lightpanel:5B4338595BC9:25198:color failed: Nanoleaf did not expect this request. HTTP response code 400

==> /var/log/openhab/events.log <==

2021-03-22 22:20:29.412 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:lightpanel:5B4338595BC9:25198' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Konfiguration des Controllers prüfen.

==> /var/log/openhab/openhab.log <==

2021-03-22 22:20:29.421 [INFO ] [nternal.handler.NanoleafPanelHandler] - sending effect command from panel nanoleaf:lightpanel:5B4338595BC9:25198: {"write":{"command":"display","animType":"static","animName":"","palette":[],"colorType":"","animData":"1 25198 1 186 255 0 0 10","loop":false}}

==> /var/log/openhab/events.log <==

2021-03-22 22:20:29.424 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:lightpanel:5B4338595BC9:25198' changed from OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Konfiguration des Controllers prüfen. to ONLINE

==> /var/log/openhab/openhab.log <==

2021-03-22 22:20:29.429 [WARN ] [nternal.handler.NanoleafPanelHandler] - Handling command 76,100,100 for channelUID nanoleaf:lightpanel:5B4338595BC9:25198:color failed: Nanoleaf did not expect this request. HTTP response code 400

==> /var/log/openhab/events.log <==

2021-03-22 22:20:29.432 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:lightpanel:5B4338595BC9:25198' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Konfiguration des Controllers prüfen.

==> /var/log/openhab/openhab.log <==

2021-03-22 22:20:29.453 [INFO ] [nternal.handler.NanoleafPanelHandler] - sending effect command from panel nanoleaf:lightpanel:5B4338595BC9:25198: {"write":{"command":"display","animType":"static","animName":"","palette":[],"colorType":"","animData":"1 25198 1 0 255 191 0 10","loop":false}}

==> /var/log/openhab/events.log <==

2021-03-22 22:20:29.457 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:lightpanel:5B4338595BC9:25198' changed from OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Konfiguration des Controllers prüfen. to ONLINE

==> /var/log/openhab/openhab.log <==

2021-03-22 22:20:29.460 [WARN ] [nternal.handler.NanoleafPanelHandler] - Handling command 165,100,100 for channelUID nanoleaf:lightpanel:5B4338595BC9:25198:color failed: Nanoleaf did not expect this request. HTTP response code 400

==> /var/log/openhab/events.log <==

2021-03-22 22:20:29.463 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:lightpanel:5B4338595BC9:25198' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Konfiguration des Controllers prüfen.

2021-03-22 22:20:53.020 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'nanoleaf:lightpanel:5B4338595BC9:25198' changed from OFFLINE (COMMUNICATION_ERROR): Kommunikationsfehler. Konfiguration des Controllers prüfen. to ONLINE

Maybe the api call needs to be different for the shapes panels?

During startup I saw this:

openhab.log:2021-03-22 22:01:08.505 [INFO ] [al.handler.NanoleafControllerHandle
r] - --------------------------- touch job registering on: http://192.168.178.24
:16021/api/v1/246FT0Xs9QUOof6orghXMqjM5WRdghwb/events?id=4

So I thought, touch should work and I created a rule for both panels to test it:

triggers:
  - id: "1"
    configuration:
      thingUID: nanoleaf:lightpanel:5B4338595BC9:35050
      channelUID: nanoleaf:lightpanel:5B4338595BC9:35050:tap
      event: DOUBLE_PRESSED
    type: core.ChannelEventTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      type: application/vnd.openhab.dsl.rule
      script: logInfo("nanoleaf", "u touched me")
    type: script.ScriptAction

But … nothing. I had my buddy open up the nanoleaf app to see the settings there. he had “gestures” disabled, as the old firmware was detecting “ghost” gestures. but usual tap events were activated all the time. we also enabled gestures for testing purposes, but no difference.

there is a menu where you can set up home kit actions for certain panels, we activated them for all the panels, but didn’t bind a double tap action. didn’t change anything though :-/

But the good thing, after the initial error messages regarding the http threads, I didn’t see any further errors in that regard in the log. Not sure what is going on at startup, but afterwards it seems fine?

I would like to announce a major stability improvement on the whole binding and touch functionality itself. Honestly I fought over many weeks and tried to analyse why the binding keeps becoming unresponsive in general and in particular that touch wouldn’t work anymore at some point in time. As this was related to concurrency issues it took me ages to track down the issues (see here as well),

For those who are interested in details:

Basically “touch” is detected by using Server-Side-Events. The problem is that this requires an “infinite running” http request connection to the device as an open channel for the binding to receive these events. Unfortunately this leads to the issue that in case the device is removed from power the connection is gone which CANNOT be detected by openhab, which in turn results into a dead connection that does not receive anything. So I had to change the implementation completely internally.
Another side effect was caused due to the fact that the device needs another normal connection for controlling the panels. Hence it is better to have two separate connections internally that are managed in different ways. Besides that I detected a bug that made the binding interfere between connections of different devices (sigh).

So before I spread the new version that has been really stable with 5 devices in my house I would like to ask volunteers that are running 3.1 to try out the new version and provide feedback to me.

Please pm me, thanks
Stefan

2 Likes

I can announce, that there is another update on its way with 3.2 which is even better AND it does now support SWIPES on the panels.

Have fun,
Stefan

2 Likes

hi Stefan,
i am running lightpanels only but cannot set single colors on a panel directly anymore. it was working fine under 2.5 and i believe even 3.0.
were there any changes? previously i used channel panelcolor and i switched to „color“ as per documentation.
however when i select a color the log reports „error 400, nanoleaf did not expect this request“

my controller and panels are configured using a things file.


Bridge nanoleaf:controller:1627EE307799 @ "Wohnzimmer" [ address="10.194.83.217", port=16021, authToken="xxx", refreshInterval=60 ] {                              
    Thing lightpanel 10 [ id=10 ]                                                               
    Thing lightpanel 11 [ id=11 ]                                                               
    Thing lightpanel 12 [ id=12 ]                                                               
    Thing lightpanel 13 [ id=13 ]                                                               
    Thing lightpanel 14 [ id=14 ]                                                           
…

items


Switch NanoleafPower "Nano Power" (gHaus) { channel="nanoleaf:controller:1627EE307799:color" }  
Dimmer NanoleafBrightness "Nano [%.0f]" { channel="nanoleaf:controller:1627EE307799:color", alexa="PowerController.powerState,BrightnessController.brightness" [category="LIGHT"], homekit="Lighting, Lighting.Brightness"}                                                                     
Color NanoleafColor "Farbe" { channel="nanoleaf:controller:1627EE307799:color" }                
Number NanoleafColorTemp "Farbtemperatur [%.000f]" { channel="nanoleaf:controller:1627EE307799:colorTemperatureAbs" }                                                                           
String NanoleafColorMode "Farbmodus [MAP(nanoleaf.map):%s]" { channel="nanoleaf:controller:1627EE307799:colorMode" }                                                                            
String NanoleafEffect "Effekt" { channel="nanoleaf:controller:1627EE307799:effect" }            
Switch nanoleaf_fortuna "Fortuna - Gameday" {expire="1s,state=OFF"}                             
                                                                                                
                                                                                                
Color NanoleafPower10 "10" { channel="nanoleaf:lightpanel:1627EE307799:10:color" }              
Color NanoleafPower11 "11" { channel="nanoleaf:lightpanel:1627EE307799:11:color" }              
Color NanoleafPower12 "12" { channel="nanoleaf:lightpanel:1627EE307799:12:color" }              
Color NanoleafPower13 "13" { channel="nanoleaf:lightpanel:1627EE307799:13:color" }              
Color NanoleafPower14 "14" { channel="nanoleaf:lightpanel:1627EE307799:14:color" }              
Color NanoleafPower15 "15" { channel="nanoleaf:lightpanel:1627EE307799:15:color" }      
…

Which version are you using?

open the openhab console (see Binding Readme)

openhab> bundle:list | grep "Nano"
365 │ Active │  80 │ 3.2.0.M4              │ openHAB Add-ons :: Bundles :: Nanoleaf Binding

You should be on 3.2.0.M4 because it received a lot of improvements and has been stable without any issues with multiple devices in my house.

Ah, alright. Still on m1 3.2.0.
Let me try to update

I had the same issue when I installed my canvas panels two weeks ago. The panel thing went offline after sending a color to a single panel. I had to disable the controller thing and reanable it in order to get it working again (touch triggers etc).

I tried out the 3.2 snapshot and ever since it’s working much much better.
Even though after updating a rules file the first few touch triggers would not be received by OH…

But still very good work @stefan.hoehn!
Much appreciated :slight_smile:

1 Like

Touch is sometimes tricky. I had many conversations with nanoleaf about that. They recommend using the whole hand but even that doesn’t work all the time but at least mostly.

After upgrading to 3.2.0m4 and editing my rules for oh3 it is accepting single colors.

Christmas calendar is working again on my panels.

Thanks!

Hi Nanoleaf people, Hardware questions - I’m wanting to run these in my campervan and power from 12v. Can you please advise the spec of the PSU that comes with the nanoleafs? And a possible photograph of the power connectors. This information is impossible to find online.

You need to be more specific. Which one of the Nanoleaf models are you using?