I recently upgraded to OH 2.3.0 but this issue already existed before. I tried to clear the cache and restart the OH server but the issue persist so I hope that someone more knowledgeable will be able to direct me to a solution.
It seems that the Netatmo binding is trying to create the webhook servlet over and over. I’m repeatedly getting this error in the events.log
2018-06-01 13:09:41.479 [ERROR] [tatmo.internal.WelcomeWebHookServlet] - Could not start Netatmo Webhook servlet: servlet already registered with a different alias
javax.servlet.ServletException: servlet already registered with a different alias
at org.ops4j.pax.web.service.spi.model.ServerModel.addServletModel(ServerModel.java:119) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:241) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:221) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:205) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:65) ~[?:?]
at org.openhab.binding.netatmo.internal.WelcomeWebHookServlet.activate(WelcomeWebHookServlet.java:60) ~[?:?]
at org.openhab.binding.netatmo.handler.NetatmoBridgeHandler.connectionSucceed(NetatmoBridgeHandler.java:110) ~[?:?]
at org.openhab.binding.netatmo.handler.NetatmoBridgeHandler.lambda$0(NetatmoBridgeHandler.java:136) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
Everything else, except the Live snapshot pic that never update seems to be working.
The webhook address is defined in the Paper UI as the public address of the http tunnel for port 8080 of the openhab server local host.
So in my case it’s typed as http://XXXXX.ngrok.io in the paper UI and the devnetatmo application. Please note that with ngrok I’m able to replay the events and I see in their lof that all events gets a 200 reply and they appear in the openhab events log.
I cleared the log, restarted openhab from the console, set the log level to debug by issuing the command:
log:set DEBUG org.openhab.binding.netatmo
The resulting log file is quite large, too long to include here. What would be the best way to send it to you?
It used to be defined through a “thing” file but this binding instance was erased and the file deleted. Do you think that some residues were left despite that and also clearing the cache and temp directories?
The webhook seems to connect with the correct directory “9eb67ddb”, I don’t see an attempt to create another one and the (useless) error message doesn’t say which name is supposedly already registered.
2018-06-04 04:56:01.235 [DEBUG] [netatmo.handler.NetatmoBridgeHandler] - Initializing API Connection and scheduling token refresh every 5400s
2018-06-04 04:56:02.385 [ERROR] [tatmo.internal.WelcomeWebHookServlet] - Could not start Netatmo Webhook servlet: servlet already registered with a different alias
javax.servlet.ServletException: servlet already registered with a different alias
at org.ops4j.pax.web.service.spi.model.ServerModel.addServletModel(ServerModel.java:119) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:241) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:221) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:205) ~[?:?]
at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:65) ~[?:?]
at org.openhab.binding.netatmo.internal.WelcomeWebHookServlet.activate(WelcomeWebHookServlet.java:60) ~[?:?]
at org.openhab.binding.netatmo.handler.NetatmoBridgeHandler.connectionSucceed(NetatmoBridgeHandler.java:110) ~[?:?]
at org.openhab.binding.netatmo.handler.NetatmoBridgeHandler.lambda$0(NetatmoBridgeHandler.java:136) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
2018-06-04 04:56:02.406 [DEBUG] [netatmo.handler.NetatmoBridgeHandler] - Setting up Netatmo Welcome WebHook
You got the error 2 days after the initial OH startup ?
Why your bridge thing is initializing again ?
Don’t you see any logs about disposing the thing just before the second initializing ?
No I didn’t. The first error popped up within the first hour. I just grabbed the last one because i was too lazy to scroll up in the log.
Anyway, despite the errors the binding seems to work correctly, except for the Live Snapshot image, but that’s something which never worked for me in any case.
From my understanding, the webhook works/should work but it is delicate and tedious to work with because of Netatmo policy that bans it for 24h as soon as he is not responded 10 times in a row. So, if your OH server stops for too long, it does not respond.
In version 2 of the binding, when an url is provided, the binding pushes the webhook URL at start and removes it at stop, so if for any reason your OH instance is not properly close, it will ban.
While reworking the binding, I’m trying to find a better way to handle this. I think I’m going to remove autosubscription of the webhook, so you get back control over it.
You can set a DDNS or directly you IP address.
Regarding ports, Netatmo should accept 80, 88, 443 and 9443.
In the Netatmo binding, you should define something like this : https://my.public.ip:choosen_port
Then the binging declares https://my.public.ip:choosen_port/netatmo itself to netatmo via the API, you’ve got nothing to do yourself. BUT : the weird thing is that in Netatmo console, you do not see it (I don’t know why), reason why I think it should be better to let the user do it himself.
Getting live publications from Netatmo is really not an easy thing.
On my side, in OH2.5 production I ended up having a php script on my public cloud server as webhook that push the json notification to openhabcloud on a dedicated item. Uggly.
Ok so I built a basic JSON php script but although the webhook is registered at the dev.netatmo site, I am only able to retrieve this each time from the JSON.
Am I missing something to retrieve the last event notification?
Do not use this in parallel with webhook handling in the Netatmo binding. You should receive full notification messages as stated in the netatmo dev documentation