openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

[Netatmo] Binding fail with exception #15858

Closed cr1581 closed 10 months ago

cr1581 commented 10 months ago

Hi, at home I have a netatmo thermometer (1st relay) and two valves (2nd relay). The first relay directly controls the boiler while the second has no pins to control the boiler so, until last winter I used a shelly 1pm to activate the boiler if one of the valves required it. Until last winter everything worked, but now the binding is struggling to work. Last winter I was using version 3.3 of openhab, now I upgraded (new installation) to version 4.0.4. When I create the Things the bridge it works, then after a few hours it no longer updates the values ​​of the items, this error appears in the logs:

2023-11-06 08:07:40.719 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: Cannot invoke "org.openhab.binding.netatmo.internal.deserialization.NAObjectMap.getOpt(String)" because "<parameter1>" is null
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.lambda$7(EnergyCapability.java:94) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
    at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720) ~[?:?]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.updateHomeStatus(EnergyCapability.java:92) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.Capability.setNewData(Capability.java:70) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.setNewData(CommonInterface.java:161) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.lambda$12(CommonInterface.java:188) ~[?:?]
    at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.proceedWithUpdate(CommonInterface.java:188) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.proceedWithUpdate(RefreshCapability.java:81) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.lambda$2(RefreshCapability.java:122) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
    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:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]

However, if I try to change a setpoint from openhab (without using the netatmo app) the binding restarts working again (for a few more hours) I activated the debug log for the netatmo binding but I don’t seem to see anything interesting. I noticed that often when the binding fails other queries on other Things also fail:

2023-11-06 20:05:11.934 [DEBUG] [handler.capability.RefreshCapability] - Module refreshed, next one in 60 s
2023-11-06 20:06:12.299 [DEBUG] [handler.capability.RefreshCapability] - Module refreshed, next one in 60 s
2023-11-06 20:07:03.524 [WARN ] [p.internal.http.HttpResponseListener] - Requesting 'http://192.168.1.207/settings/relay/0' (method='GET', content='null') failed: java.util.concurrent.TimeoutException: Total timeout 3000 ms elapsed
2023-11-06 20:07:03.527 [WARN ] [p.internal.http.HttpResponseListener] - Requesting 'http://192.168.1.207/settings/relay/1' (method='GET', content='null') failed: java.util.concurrent.TimeoutException: Total timeout 3000 ms elapsed
2023-11-06 20:07:03.561 [WARN ] [p.internal.http.HttpResponseListener] - Requesting 'http://192.168.1.215/settings/relay/1' (method='GET', content='null') failed: java.util.concurrent.TimeoutException: Total timeout 3000 ms elapsed
2023-11-06 20:07:03.563 [WARN ] [p.internal.http.HttpResponseListener] - Requesting 'http://192.168.1.215/settings/relay/0' (method='GET', content='null') failed: java.util.concurrent.TimeoutException: Total timeout 3000 ms elapsed
2023-11-06 20:07:03.624 [WARN ] [p.internal.http.HttpResponseListener] - Requesting 'http://192.168.1.205/settings/relay/0' (method='GET', content='null') failed: java.util.concurrent.TimeoutException: Total timeout 3000 ms elapsed
2023-11-06 20:07:22.529 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: Cannot invoke "org.openhab.binding.netatmo.internal.deserialization.NAObjectMap.getOpt(String)" because "<parameter1>" is null
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.lambda$7(EnergyCapability.java:94) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
    at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720) ~[?:?]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.updateHomeStatus(EnergyCapability.java:92) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.Capability.setNewData(Capability.java:70) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.setNewData(CommonInterface.java:161) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.lambda$12(CommonInterface.java:188) ~[?:?]
    at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.proceedWithUpdate(CommonInterface.java:188) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.proceedWithUpdate(RefreshCapability.java:81) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.lambda$2(RefreshCapability.java:122) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
    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:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
2023-11-06 21:32:05.707 [DEBUG] [handler.capability.RefreshCapability] - Module refreshed, next one in 60 s
2023-11-06 21:32:10.701 [DEBUG] [handler.capability.RefreshCapability] - Module refreshed, next one in 60 s
2023-11-06 21:32:12.905 [DEBUG] [handler.capability.RefreshCapability] - Module refreshed, next one in 60 s

Thanks, Cristian

[OpenHab version: 4.0.4]

openhab-bot commented 10 months ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/netatmo-binding-fail-with-exception/151022/3

clinique commented 10 months ago

@cr1581 : I can see what generates the error but this condition is hard to understand. Could you increase log level to trace so we get the requested URL and the json response just before the NPE ? Thanks.

cr1581 commented 10 months ago

Hi @clinique, here is the trace before the NPE. It seems like it's a network issue, right?

Cristian

2023-11-08 08:07:10.570 [TRACE] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homestatus?home_id=xxxxxxxxxxxxx 
2023-11-08 08:07:10.574 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -with headers : Accept-Encoding: gzip, User-Agent: Jetty/9.4.50.v20221201, Authorization: Bearer xxxxxxxxx|xxxxxxxxxxx 
2023-11-08 08:07:20.660 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -returned : code [200 OK] body {"status":"ok","time_server":1699427241,"body":{"home":{"id":"xxxxxxxxxxxx"},"errors":[{"code":6,"id":"xx:xx:xx:xx:xx:xx"},{"code":6,"id":"yy:yy:yy:yy:yy:yy"}]}}
2023-11-08 08:07:20.675 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: Cannot invoke "org.openhab.binding.netatmo.internal.deserialization.NAObjectMap.getOpt(String)" because "<parameter1>" is null
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.lambda$7(EnergyCapability.java:94) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
    at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720) ~[?:?]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.updateHomeStatus(EnergyCapability.java:92) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.Capability.setNewData(Capability.java:70) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.setNewData(CommonInterface.java:161) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.lambda$12(CommonInterface.java:188) ~[?:?]
    at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.proceedWithUpdate(CommonInterface.java:188) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.proceedWithUpdate(RefreshCapability.java:81) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.lambda$2(RefreshCapability.java:122) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
    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:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
clinique commented 10 months ago

Two of your modules are in error (6 = unreachable) and this should be handled by the binding but apparently it's not the case. I'll have a look.

clinique commented 10 months ago

Do you errored module stay "Unknown" ?

clinique commented 10 months ago

Can you please try with this updated binding ?

cr1581 commented 10 months ago

Can you please try with this updated binding ?

Forgive me @clinique, I'm a newbie ... what should I do to install the new package? Just copy it to a folder? Which folder? Thanks

clinique commented 10 months ago

Can you please try with this updated binding ?

Forgive me @clinique, I'm a newbie ... what should I do to install the new package? Just copy it to a folder? Which folder? Thanks

Remove the installed binding and put the jar file in the add-ons folder of openhab

cr1581 commented 10 months ago

The binding not start ... is it compatible with openhab v4.0.4?

2023-11-08 21:36:56.669 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.netatmo-4.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.netatmo [290]
  Unresolved requirement: Import-Package: com.google.gson; version="[2.10.0,3.0.0)"

    at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) ~[?:?]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]
clinique commented 10 months ago

The binding not start ... is it compatible with openhab v4.0.4?

2023-11-08 21:36:56.669 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.netatmo-4.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.netatmo [290]
  Unresolved requirement: Import-Package: com.google.gson; version="[2.10.0,3.0.0)"

  at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
  at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
  at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
  at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
  at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) ~[?:?]
  at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
  at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]

Unfortunately not, you'll need to upgrade to 4.1

cr1581 commented 10 months ago

I'll try to upgrade to 4.1 and then I'll let you know if the error remains

cr1581 commented 10 months ago

I upgraded to 4.1 and after a few hours everything still works. I tried disconnecting the network to check how the binding behaves and after 5 minutes it started again. I'll try for a few days then give you another feedback. Thank you so much for your support. Cristian

2023-11-09 16:44:06.520 [DEBUG] [handler.capability.RefreshCapability] - Module refreshed, next one in 60s
2023-11-09 16:45:06.523 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homesdata?home_id=xxxxxxxxxxx 
2023-11-09 16:45:06.527 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -with headers : Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, Authorization: Bearer xxxxxxxxxxx|xxxxxxxxxxx 
2023-11-09 16:45:26.532 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Request timedout, retry counter : 3
2023-11-09 16:45:26.533 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homesdata?home_id=xxxxxxxxxxx 
2023-11-09 16:45:26.537 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -with headers : Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, Authorization: Bearer xxxxxxxxxxx|xxxxxxxxxxx 
2023-11-09 16:45:32.752 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Request timedout, retry counter : 2
2023-11-09 16:45:32.753 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homesdata?home_id=xxxxxxxxxxx 
2023-11-09 16:45:32.763 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -with headers : Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, Authorization: Bearer xxxxxxxxxxx|xxxxxxxxxxx 
2023-11-09 16:45:32.766 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Request timedout, retry counter : 1
2023-11-09 16:45:32.768 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homesdata?home_id=xxxxxxxxxxx 
2023-11-09 16:45:32.773 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -with headers : Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, Authorization: Bearer xxxxxxxxxxx|xxxxxxxxxxx 
2023-11-09 16:45:32.780 [DEBUG] [tatmo.internal.handler.DeviceHandler] - bridgeStatusChanged for bridge netatmo:home:myaccount:casa to OFFLINE (COMMUNICATION_ERROR): @text/request-time-out
2023-11-09 16:45:32.784 [DEBUG] [tatmo.internal.handler.ModuleHandler] - bridgeStatusChanged for thing netatmo:room:myaccount:casa:cucina to OFFLINE (BRIDGE_OFFLINE)
2023-11-09 16:45:32.785 [DEBUG] [tatmo.internal.handler.DeviceHandler] - bridgeStatusChanged for bridge netatmo:plug:myaccount:casa:termostato_relay to OFFLINE (BRIDGE_OFFLINE)
2023-11-09 16:45:32.785 [DEBUG] [tatmo.internal.handler.ModuleHandler] - bridgeStatusChanged for thing netatmo:room:myaccount:casa:bagno to OFFLINE (BRIDGE_OFFLINE)
2023-11-09 16:45:32.785 [DEBUG] [tatmo.internal.handler.ModuleHandler] - bridgeStatusChanged for thing netatmo:room:myaccount:casa:bagnetto to OFFLINE (BRIDGE_OFFLINE)
2023-11-09 16:45:32.785 [DEBUG] [tatmo.internal.handler.DeviceHandler] - bridgeStatusChanged for bridge netatmo:plug:myaccount:casa:valvole_relay to OFFLINE (BRIDGE_OFFLINE)
2023-11-09 16:45:32.789 [DEBUG] [tatmo.internal.handler.ModuleHandler] - bridgeStatusChanged for thing netatmo:thermostat:myaccount:casa:termostato_relay:termostato to OFFLINE (BRIDGE_OFFLINE)
2023-11-09 16:45:32.792 [DEBUG] [tatmo.internal.handler.ModuleHandler] - bridgeStatusChanged for thing netatmo:valve:myaccount:casa:valvole_relay:valvola_bagno to OFFLINE (BRIDGE_OFFLINE)
2023-11-09 16:45:32.792 [DEBUG] [tatmo.internal.handler.ModuleHandler] - bridgeStatusChanged for thing netatmo:valve:myaccount:casa:valvole_relay:valvola_bagnetto to OFFLINE (BRIDGE_OFFLINE)
2023-11-09 16:45:32.785 [WARN ] [al.handler.capability.HomeCapability] - Error getting Home informations: java.util.concurrent.ExecutionException: "java.net.UnknownHostException: api.netatmo.com"
2023-11-09 16:45:32.796 [DEBUG] [handler.capability.RefreshCapability] - Module is not ONLINE; special refresh interval is used
2023-11-09 16:45:32.798 [DEBUG] [handler.capability.RefreshCapability] - Module refreshed, next one in 900s
2023-11-09 16:50:32.785 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Connecting to Netatmo API.
2023-11-09 16:50:32.788 [DEBUG] [tatmo.internal.handler.DeviceHandler] - bridgeStatusChanged for bridge netatmo:home:myaccount:casa to ONLINE
2023-11-09 16:50:32.794 [DEBUG] [tatmo.internal.handler.ModuleHandler] - bridgeStatusChanged for thing netatmo:room:myaccount:casa:cucina to UNKNOWN
2023-11-09 16:50:32.794 [DEBUG] [tatmo.internal.handler.DeviceHandler] - bridgeStatusChanged for bridge netatmo:plug:myaccount:casa:valvole_relay to UNKNOWN
2023-11-09 16:50:32.794 [DEBUG] [tatmo.internal.handler.DeviceHandler] - bridgeStatusChanged for bridge netatmo:plug:myaccount:casa:termostato_relay to UNKNOWN
2023-11-09 16:50:32.794 [DEBUG] [tatmo.internal.handler.ModuleHandler] - bridgeStatusChanged for thing netatmo:room:myaccount:casa:bagno to UNKNOWN
2023-11-09 16:50:32.795 [DEBUG] [tatmo.internal.handler.ModuleHandler] - bridgeStatusChanged for thing netatmo:room:myaccount:casa:bagnetto to UNKNOWN
2023-11-09 16:50:34.794 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homesdata?home_id=xxxxxxxxxxx 
2023-11-09 16:50:34.797 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -with headers : Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, Authorization: Bearer xxxxxxxxxxx|xxxxxxxxxxx 
2023-11-09 16:50:35.099 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -returned : code [200 OK] body {"body":{"homes":[{................
cr1581 commented 10 months ago

Unfortunately it happened again :(

2023-11-09 20:30:11.737 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homestatus?home_id=xxxxxxxxxxxxx 
2023-11-09 20:30:11.741 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -with headers : Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, Authorization: Bearer xxxxxxxxxxxxx|xxxxxxxxxxxxx 
2023-11-09 20:30:21.820 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -returned : code [200 OK] body {"status":"ok","time_server":1699558222,"body":{"home":{"id":"xxxxxxxxxxxxx"},"errors":[{"code":6,"id":"xx:xx:xx:xx:xx:xx"},{"code":6,"id":"yy:yy:yy:yy:yy:yy"}]}}
2023-11-09 20:30:21.837 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: Cannot invoke "org.openhab.binding.netatmo.internal.deserialization.NAObjectMap.getOpt(String)" because "<parameter1>" is null
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.lambda$7(EnergyCapability.java:94) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
    at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720) ~[?:?]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.updateHomeStatus(EnergyCapability.java:92) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.Capability.setNewData(Capability.java:73) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.setNewData(CommonInterface.java:180) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.lambda$15(CommonInterface.java:207) ~[?:?]
    at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.proceedWithUpdate(CommonInterface.java:207) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.proceedWithUpdate(RefreshCapability.java:82) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.lambda$3(RefreshCapability.java:122) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
    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:1136) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
    at java.lang.Thread.run(Thread.java:833) [?:?]
2023-11-09 20:35:59.881 [WARN ] [.io.rest.auth.internal.TokenResource] - Couldn't find a user with a session matching the provided refresh_token
2023-11-09 20:35:59.884 [WARN ] [.io.rest.auth.internal.TokenResource] - Token issuing failed: invalid_grant
clinique commented 10 months ago

Ok. I increased logging to understand what is going on. Can you please : 1°/ ensure that you have removed the installed binding via the add-on store 2°/ delete previous version I gave you from the addons folder 3°/ install this one 4°/ stay at trace level and wait this error to happen

This version does not correct this issue but gives more informations on what is going on. Thanks

cr1581 commented 10 months ago
2023-11-10 20:29:58.532 [DEBUG] [handler.capability.RefreshCapability] - Module refreshed, next one in 60s
2023-11-10 20:30:58.534 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homesdata?home_id=xxxxxxxx 
2023-11-10 20:30:58.544 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -with headers : Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, Authorization: Bearer xxxxxxxx|xxxxxxxx 
2023-11-10 20:30:58.653 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -returned : code [200 OK] body {"body":{"homes":[{"id":"xxxxxxxx","name":"Casa","altitude":114,"coordinates":[xx.xxxx,yy.yyyy],"country":"IT","timezone":"Europe\/Rome","rooms":[{"id":"xxxxxxxx","name":"Bagnetto","type":"bathroom","module_ids":["xx:xx:xx:xx:xx:xx"]},{"id":"xxxxxxxx","name":"Bagno","type":"bathroom","module_ids":["xx:xx:xx:xx:xx:xx"]},{"id":"xxxxxxxx","name":"Cucina","type":"kitchen","module_ids":["xx:xx:xx:xx:xx:xx"]},{"id":"xxxxxxxx","name":"Altro","type":"custom","module_ids":["xx:xx:xx:xx:xx:xx","xx:xx:xx:xx:xx:xx"]}],"modules":[{"id":"xx:xx:xx:xx:xx:xx","type":"NAPlug","name":"Rel\u00e8 valvole","setup_date":1673622739,"room_id":"xxxxxxxx","modules_bridged":["xx:xx:xx:xx:xx:xx","xx:xx:xx:xx:xx:xx"]},{"id":"xx:xx:xx:xx:xx:xx","type":"NRV","name":"Bagno","setup_date":1673624344,"room_id":"xxxxxxxx","bridge":"xx:xx:xx:xx:xx:xx"},{"id":"xx:xx:xx:xx:xx:xx","type":"NRV","name":"Bagnetto","setup_date":1673624362,"room_id":"xxxxxxxx","bridge":"xx:xx:xx:xx:xx:xx"},{"id":"7xx:xx:xx:xx:xx:xx","type":"NAPlug","name":"Rel\u00e8 cucina","setup_date":1673623539,"room_id":"xxxxxxxx","modules_bridged":["xx:xx:xx:xx:xx:xx"]},{"id":"xx:xx:xx:xx:xx:xx","type":"NATherm1","name":"Termostato","setup_date":1673623539,"room_id":"xxxxxxxx","bridge":"7xx:xx:xx:xx:xx:xx"}],"temperature_control_mode":"heating","therm_mode":"schedule","therm_setpoint_default_duration":60,"schedules":[{"timetable":[{"zone_id":1,"m_offset":0},{"zone_id":1972,"m_offset":300},{"zone_id":1,"m_offset":360},{"zone_id":3,"m_offset":435},{"zone_id":4,"m_offset":465},{"zone_id":1866,"m_offset":600},{"zone_id":4,"m_offset":660},{"zone_id":1981,"m_offset":900},{"zone_id":4,"m_offset":1080},{"zone_id":5048,"m_offset":1185},{"zone_id":1,"m_offset":1245},{"zone_id":1113,"m_offset":1740},{"zone_id":1,"m_offset":1800},{"zone_id":3,"m_offset":1875},{"zone_id":4,"m_offset":1905},{"zone_id":6621,"m_offset":2040},{"zone_id":4,"m_offset":2100},{"zone_id":6372,"m_offset":2340},{"zone_id":4,"m_offset":2520},{"zone_id":5548,"m_offset":2625},{"zone_id":1,"m_offset":2685},{"zone_id":1813,"m_offset":3180},{"zone_id":1,"m_offset":3240},{"zone_id":3,"m_offset":3315},{"zone_id":4,"m_offset":3345},{"zone_id":1813,"m_offset":3480},{"zone_id":4,"m_offset":3540},{"zone_id":1813,"m_offset":3780},{"zone_id":4,"m_offset":3960},{"zone_id":5548,"m_offset":4065},{"zone_id":1,"m_offset":4125},{"zone_id":1813,"m_offset":4620},{"zone_id":1,"m_offset":4680},{"zone_id":3,"m_offset":4755},{"zone_id":4,"m_offset":4785},{"zone_id":1813,"m_offset":4920},{"zone_id":4,"m_offset":4980},{"zone_id":1813,"m_offset":5220},{"zone_id":4,"m_offset":5400},{"zone_id":5548,"m_offset":5505},{"zone_id":1,"m_offset":5565},{"zone_id":1813,"m_offset":6060},{"zone_id":1,"m_offset":6120},{"zone_id":3,"m_offset":6195},{"zone_id":4,"m_offset":6225},{"zone_id":1813,"m_offset":6360},{"zone_id":4,"m_offset":6420},{"zone_id":1813,"m_offset":6660},{"zone_id":4,"m_offset":6840},{"zone_id":5548,"m_offset":6945},{"zone_id":1,"m_offset":7005},{"zone_id":1813,"m_offset":7650},{"zone_id":4,"m_offset":7725},{"zone_id":1813,"m_offset":7860},{"zone_id":4,"m_offset":7920},{"zone_id":1813,"m_offset":8190},{"zone_id":1,"m_offset":8310},{"zone_id":1813,"m_offset":9090},{"zone_id":4,"m_offset":9165},{"zone_id":1813,"m_offset":9300},{"zone_id":4,"m_offset":9360},{"zone_id":1813,"m_offset":9630},{"zone_id":1,"m_offset":9750}],"zones":[{"name":"Notte","id":1,"type":1,"rooms_temp":[{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16}]},{"name":"Pavimento","id":1813,"type":4,"rooms_temp":[{"room_id":"xxxxxxxx","temp":16.5},{"room_id":"xxxxxxxx","temp":16.5},{"room_id":"xxxxxxxx","temp":21.5}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":16.5},{"id":"xxxxxxxx","therm_setpoint_temperature":16.5},{"id":"xxxxxxxx","therm_setpoint_temperature":21.5}]},{"name":"Scaldasalviette","id":5548,"type":4,"rooms_temp":[{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":18}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":18}]},{"name":"Economico","id":4,"type":5,"rooms_temp":[{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16}]},{"name":"Comfort","id":0,"type":0,"rooms_temp":[{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":21}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":21}]},{"name":"Comfort +","id":3,"type":8,"rooms_temp":[{"room_id":"xxxxxxxx","temp":25},{"room_id":"xxxxxxxx","temp":25},{"room_id":"xxxxxxxx","temp":22}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":25},{"id":"xxxxxxxx","therm_setpoint_temperature":25},{"id":"xxxxxxxx","therm_setpoint_temperature":22}]}],"name":"Inverno","default":false,"away_temp":12,"hg_temp":7,"id":"xxxxxxxx","type":"therm"},{"timetable":[{"zone_id":1,"m_offset":0},{"zone_id":1813,"m_offset":300},{"zone_id":4,"m_offset":360},{"zone_id":1813,"m_offset":900},{"zone_id":4,"m_offset":1080},{"zone_id":5548,"m_offset":1185},{"zone_id":1,"m_offset":1245},{"zone_id":1813,"m_offset":1740},{"zone_id":4,"m_offset":1800},{"zone_id":1813,"m_offset":2340},{"zone_id":4,"m_offset":2520},{"zone_id":5548,"m_offset":2625},{"zone_id":1,"m_offset":2685},{"zone_id":1813,"m_offset":3180},{"zone_id":4,"m_offset":3240},{"zone_id":1813,"m_offset":3780},{"zone_id":4,"m_offset":3960},{"zone_id":5548,"m_offset":4065},{"zone_id":1,"m_offset":4125},{"zone_id":1813,"m_offset":4620},{"zone_id":4,"m_offset":4680},{"zone_id":1813,"m_offset":5220},{"zone_id":4,"m_offset":5400},{"zone_id":5548,"m_offset":5505},{"zone_id":1,"m_offset":5565},{"zone_id":1813,"m_offset":6060},{"zone_id":4,"m_offset":6120},{"zone_id":1813,"m_offset":6660},{"zone_id":4,"m_offset":6840},{"zone_id":5548,"m_offset":6945},{"zone_id":1,"m_offset":7005},{"zone_id":1813,"m_offset":7650},{"zone_id":4,"m_offset":7725},{"zone_id":1813,"m_offset":7860},{"zone_id":4,"m_offset":7920},{"zone_id":1813,"m_offset":8190},{"zone_id":1,"m_offset":8310},{"zone_id":1813,"m_offset":9090},{"zone_id":4,"m_offset":9165},{"zone_id":1813,"m_offset":9300},{"zone_id":4,"m_offset":9360},{"zone_id":1813,"m_offset":9630},{"zone_id":1,"m_offset":9750}],"zones":[{"name":"Notte","id":1,"type":1,"rooms_temp":[{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16}]},{"name":"Scaldasalviette","id":5548,"type":4,"rooms_temp":[{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":18}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":18}]},{"name":"Economico","id":4,"type":5,"rooms_temp":[{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16}]},{"name":"Comfort","id":0,"type":0,"rooms_temp":[{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":21}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":21}]},{"name":"Comfort +","id":3,"type":8,"rooms_temp":[{"room_id":"xxxxxxxx","temp":25},{"room_id":"xxxxxxxx","temp":25},{"room_id":"xxxxxxxx","temp":22}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":25},{"id":"xxxxxxxx","therm_setpoint_temperature":25},{"id":"xxxxxxxx","therm_setpoint_temperature":22}]},{"name":"Pavimento","id":1813,"type":4,"rooms_temp":[{"room_id":"xxxxxxxx","temp":16.5},{"room_id":"xxxxxxxx","temp":16.5},{"room_id":"xxxxxxxx","temp":21.5}],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":16.5},{"id":"xxxxxxxx","therm_setpoint_temperature":16.5},{"id":"xxxxxxxx","therm_setpoint_temperature":21.5}]}],"name":"Primavera ","default":false,"away_temp":12,"hg_temp":7,"id":"xxxxxxxx","type":"therm"},{"timetable":[{"zone_id":4,"m_offset":0},{"zone_id":1243,"m_offset":270},{"zone_id":4,"m_offset":375},{"zone_id":7358,"m_offset":1170},{"zone_id":4,"m_offset":1260},{"zone_id":1243,"m_offset":1710},{"zone_id":4,"m_offset":1815},{"zone_id":7358,"m_offset":2610},{"zone_id":4,"m_offset":2700},{"zone_id":1243,"m_offset":3150},{"zone_id":4,"m_offset":3255},{"zone_id":7358,"m_offset":4050},{"zone_id":4,"m_offset":4140},{"zone_id":1243,"m_offset":4590},{"zone_id":4,"m_offset":4695},{"zone_id":7358,"m_offset":5490},{"zone_id":4,"m_offset":5580},{"zone_id":1243,"m_offset":6030},{"zone_id":4,"m_offset":6135},{"zone_id":7358,"m_offset":6930},{"zone_id":4,"m_offset":7020},{"zone_id":1243,"m_offset":7620},{"zone_id":4,"m_offset":7770},{"zone_id":1243,"m_offset":9060},{"zone_id":4,"m_offset":9210}],"zones":[{"name":"Comfort","id":0,"type":0,"rooms_temp":[{"room_id":"xxxxxxxx","temp":22},{"room_id":"xxxxxxxx","temp":22},{"room_id":"xxxxxxxx","temp":22}],"modules":[],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":22},{"id":"xxxxxxxx","therm_setpoint_temperature":22},{"id":"xxxxxxxx","therm_setpoint_temperature":22}]},{"name":"Notte","id":1,"type":1,"rooms_temp":[{"room_id":"xxxxxxxx","temp":19},{"room_id":"xxxxxxxx","temp":19},{"room_id":"xxxxxxxx","temp":19}],"modules":[],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":19},{"id":"xxxxxxxx","therm_setpoint_temperature":19},{"id":"xxxxxxxx","therm_setpoint_temperature":19}]},{"name":"Pavimento","id":1243,"type":4,"rooms_temp":[{"room_id":"xxxxxxxx","temp":7},{"room_id":"xxxxxxxx","temp":7},{"room_id":"xxxxxxxx","temp":22}],"modules":[],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":7},{"id":"xxxxxxxx","therm_setpoint_temperature":7},{"id":"xxxxxxxx","therm_setpoint_temperature":22}]},{"name":"Comfort +","id":3,"type":8,"rooms_temp":[{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":24},{"room_id":"xxxxxxxx","temp":22}],"modules":[],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":24},{"id":"xxxxxxxx","therm_setpoint_temperature":22}]},{"name":"Economico","id":4,"type":5,"rooms_temp":[{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16},{"room_id":"xxxxxxxx","temp":16}],"modules":[],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16},{"id":"xxxxxxxx","therm_setpoint_temperature":16}]},{"name":"Scaldasalviette","id":7358,"type":4,"rooms_temp":[{"room_id":"xxxxxxxx","temp":25},{"room_id":"xxxxxxxx","temp":25},{"room_id":"xxxxxxxx","temp":7}],"modules":[],"rooms":[{"id":"xxxxxxxx","therm_setpoint_temperature":25},{"id":"xxxxxxxx","therm_setpoint_temperature":25},{"id":"xxxxxxxx","therm_setpoint_temperature":7}]}],"name":"autunno","default":false,"away_temp":12,"hg_temp":7,"id":"xxxxxxxx","type":"therm","selected":true}]}],"user":{"email":"xxxxxxxx.xxxxxxxx@xxx.xxx","language":"it","locale":"it-IT","feel_like_algorithm":0,"unit_pressure":0,"unit_system":0,"unit_wind":0,"id":"xxxxxxxx"}},"status":"ok","time_exec":0.028015851974487305,"time_server":1699644658}
2023-11-10 20:30:58.663 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - executeUri GET  https://api.netatmo.com/api/homestatus?home_id=xxxxxxxx 
2023-11-10 20:30:58.667 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -with headers : Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, Authorization: Bearer xxxxxxxx|xxxxxxxx 
2023-11-10 20:30:58.732 [TRACE] [mo.internal.handler.ApiBridgeHandler] -  -returned : code [200 OK] body {"status":"ok","time_server":1699644659,"body":{"home":{"id":"xxxxxxxx"},"errors":[{"code":6,"id":"xx:xx:xx:xx:xx:xx"},{"code":6,"id":"7xx:xx:xx:xx:xx:xx"}]}}
2023-11-10 20:30:58.745 [TRACE] [.handler.capability.EnergyCapability] - childId: xxxxxxxx
2023-11-10 20:30:58.752 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: Cannot invoke "org.openhab.binding.netatmo.internal.deserialization.NAObjectMap.getOpt(String)" because "<parameter1>" is null
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.lambda$7(EnergyCapability.java:95) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
    at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
    at java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720) ~[?:?]
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.EnergyCapability.updateHomeStatus(EnergyCapability.java:92) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.Capability.setNewData(Capability.java:73) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.setNewData(CommonInterface.java:180) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.lambda$15(CommonInterface.java:207) ~[?:?]
    at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.CommonInterface.proceedWithUpdate(CommonInterface.java:207) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.proceedWithUpdate(RefreshCapability.java:82) ~[?:?]
    at org.openhab.binding.netatmo.internal.handler.capability.RefreshCapability.lambda$3(RefreshCapability.java:122) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
    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:1136) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
    at java.lang.Thread.run(Thread.java:833) [?:?]
clinique commented 10 months ago

I'm going to investigate this but at first look it still weird having this error. Can you on your side check and ensure in the Netatmo app that each valve and thermostat are associated to a room ?

cr1581 commented 10 months ago

This is my configurations:

sudo openhab-cli console openhab:netatmo showIds

Logging in as openhab
Password:  
Account bridge: Netatmo Account
    - ID "___casaId___" for "Casa" (thing type netatmo:home)
        - ID "___BagnettoRoomId___" for "Bagnetto" (thing type netatmo:room)
        - ID "___AltroRoomId___" for "Altro" (thing type netatmo:room)
        - ID "___BagnoRoomId___" for "Bagno" (thing type netatmo:room)
        - ID "___CucinaRoomId___" for "Cucina" (thing type netatmo:room)
        - ID "___ReleCucinaAddress___" for "Relè cucina" (thing type netatmo:plug)
        - ID "___ReleValvoleAddress___" for "Relè valvole" (thing type netatmo:plug)
            - ID "___BagnoAddress___" for "Bagno" (thing type netatmo:valve)
            - ID "___BagnettoAddress___" for "Bagnetto" (thing type netatmo:valve)
            - ID "___TermostatoAddress___" for "Termostato" (thing type netatmo:thermostat)

netatmo.things

Bridge netatmo:account:myaccount "Netatmo Account" [
    clientId="xxxxxxxxxx",
    clientSecret="yyyyyyyyyy"
    ]
    {
        Bridge home casa "Riscaldamento casa" [ id="___casaId___", refreshInterval=60 ] 
        {
            Bridge plug valvole_relay "Valvole relay" [ id="___ReleValvoleAddress___" ] 
            {
                valve valvola_bagno "Valvola bagno" [ id="___BagnoAddress___" ]
                valve valvola_bagnetto "Valvola bagnetto" [ id="___BagnettoAddress___" ]
            }
            Bridge plug termostato_relay "Termostato relay" [ id="___ReleCucinaAddress___" ] 
            {
                thermostat termostato "Termostato" [ id="___TermostatoAddress___" ]
            }
            room cucina "Riscaldamento cucina" [ id="___CucinaRoomId___" ]
            room bagno "Riscaldamento bagno" [ id="___BagnoRoomId___" ]
            room bagnetto "Riscaldamento bagnetto" [ id="___BagnettoRoomId___" ]
        }
    }
clinique commented 10 months ago

Thanks for this but can you check in the Energy app of Netatmo (on you smartphone) that each are assigned to a room ?

cr1581 commented 10 months ago

Yes, one valve is associated with "Bagno" room, the other is associated with "Bagnetto" and the thermostat is associated with "Cucina", while the two relays are associated with "Altro" room. IMG_DB4F47C80774-1

clinique commented 10 months ago

I see in your configuration : Bridge plug valvole_relay "Valvole relay" [ id="___ReleValvoleAddress___" ] Does this mean that a valve is a bridge for other valves or is it a boiler plug ?

cr1581 commented 10 months ago

valvole_relay it's only a bridge.

In my home there is underfloor heating and in the bathrooms there are 2 towel warmers. Initially I tried the two netatmo valves but I realized that unfortunately the netatmo bridge valvole_relay does not have a relay to activate the boiler, so to activate the boiler I check if the valves are open and then I use a Shelly 1 Plus to activate the boiler. The thermostat instead is connected to another netatmo bridge termostato_relay which has a relay inside it to turn on the boiler and activate the pump for the underfloor heating.

I tried to associate the valves with the thermostat but unfortunately if I open a valve the underfloor heating also turns on.

Heating system diagram: unnamed (1)

clinique commented 10 months ago

Ok, thanks a lot for your detailed informations. I think I understand your setup but not where the problem comes. BTW it's located on a single line, always the same. I made a new modification. Can you try this new one ?

cr1581 commented 10 months ago

Hi @clinique, everything still works from 3 days, I never seen an exception with your release. The strange thing, is that the error doesn't even appear on another machine with openhab 4.0.4... Maybe it was a Netatmo problem. What do you think? I continue to monitor the situation on both openhab installations.

cr1581 commented 10 months ago

Good news .... In openhab 4.0.4 the netatmo binding was crashed, while in version 4.1 with the last jar you sent me it handled the exception. Great!!!

clinique commented 10 months ago

Good news .... In openhab 4.0.4 the netatmo binding was crashed, while in version 4.1 with the last jar you sent me it handled the exception. Great!!!

I'm sure this is the first time you're happy to see the binding crash 🤣🎊