Ewelink / Sonoff Binding - New binding without flashing

@delid4ve
I Updated the binding as suggested, the temperature reading go reflected immediate in the Sonoff TH16 Thing.
I then changed “Sonoff Account Thing” 's “Access Mode” to “Local only”, the Sonoff TH16 thing went “OFFLINE”.
In this mode the temperature (in the background) changed from 59.3 C to 58.7 C but did not update the TH16 openhab temp reading.
“Cloud connected” value was showing as “Disconnected”
Waited 15 minutes but the temperature did not update. I can say “Local only” mode does not seem to work.

I then changed Sonoff Account Thing “Access Mode” to “Cloud and Local”, the Sonoff TH16 Thing went immediately online, after around 30 seconds the Temperature got update to 58.7 C, and “Cloud connected” after a refresh showed “Connected”

I think it is a better behavior than before, the temperature reading is updating more frequently, I will monitor tomorrow and drop an update.

Thank you for the great work

Is the device on a network subnet that openhab also has access to? Either on the same subnet or a subnet that is also defined on another nic that openhab is running on. Local uses multicast so if the above is true also check that multicast is enabled in your router.

It’s not getting an ipaddress come back from multicast (hence offline)

The cloud connection will go online for the device but then streaming data will take up to 60 seconds before it becomes active for the first time

Really need the debug logs to see what’s going on with the local connection, without them I’m not going to be able to help further.

@delid4ve
logs below, it is not an issue of multicast from the router’s side (checked the settings)

2021-03-31 10:10:17.874 [DEBUG] [nternal.handler.SonoffAccountHandler] - Initialising Sonoff Account: sonoff:account:xxxxxx
2021-03-31 10:10:17.877 [DEBUG] [nternal.handler.SonoffAccountHandler] - Setting credentials
2021-03-31 10:10:17.879 [DEBUG] [nternal.handler.SonoffAccountHandler] - Clearing current message queue
2021-03-31 10:10:17.881 [DEBUG] [nternal.handler.SonoffAccountHandler] - Loading Device States
2021-03-31 10:10:18.077 [DEBUG] [internal.states.SonoffStateUtilities] - Added new state for device 1000aece9e
2021-03-31 10:10:18.081 [DEBUG] [nternal.handler.SonoffAccountHandler] - Starting the message Queue
2021-03-31 10:10:18.085 [DEBUG] [nternal.handler.SonoffAccountHandler] - Setting Mode Change Listeners
2021-03-31 10:10:18.087 [ERROR] [.connections.SonoffConnectionManager] - connection Manager mode changed to : local
2021-03-31 10:10:18.094 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 10:10:18.155 [DEBUG] [rnal.connections.SonoffLanConnection] - mDNS service has been started on IP 127.0.0.1
2021-03-31 10:10:18.230 [DEBUG] [rnal.connections.SonoffLanConnection] - mDNS service has been started on IP xxx.xxx.xx.xx
2021-03-31 10:10:18.232 [DEBUG] [.connections.SonoffConnectionManager] - Local Mode connected
2021-03-31 10:10:18.236 [DEBUG] [nternal.handler.SonoffAccountHandler] - Creating scheduled taks to run the queue
2021-03-31 10:10:18.241 [DEBUG] [ernal.messaging.SonoffCommandManager] - Message queue running
2021-03-31 10:10:18.255 [DEBUG] [nternal.handler.SonoffAccountHandler] - Creating refresh tasks
2021-03-31 10:10:18.299 [DEBUG] [nternal.handler.SonoffAccountHandler] - Setting an initial status
2021-03-31 10:10:18.630 [DEBUG] [ernal.messaging.SonoffCommandManager] - Lan event received from xxx.xxx.xx.xx -- note it found the correct IP of the TH16
2021-03-31 10:10:18.786 [ERROR] [ernal.messaging.SonoffCommandManager] - Cannot forward state for 1000aece9e, listener not present
2021-03-31 10:10:18.867 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'sonoff:15:da2f3c07:1000aece9e': org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler cannot be cast to org.openhab.binding.sonoff.internal.handlers.HandlerAccount
java.lang.ClassCastException: org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler cannot be cast to org.openhab.binding.sonoff.internal.handlers.HandlerAccount
	at org.openhab.binding.sonoff.internal.handlers.lansupported.HandlerBaseDual.getAccountHandler(HandlerBaseDual.java:114) ~[?:?]
	at org.openhab.binding.sonoff.internal.handlers.lansupported.HandlerBaseDual.initialize(HandlerBaseDual.java:59) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_275]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]
2021-03-31 10:10:20.163 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.sonoff.internal.handlers.lansupported.Handler15@3f5b7125': org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler cannot be cast to org.openhab.binding.sonoff.internal.handlers.HandlerAccount
java.lang.ClassCastException: org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler cannot be cast to org.openhab.binding.sonoff.internal.handlers.HandlerAccount
	at org.openhab.binding.sonoff.internal.handlers.lansupported.HandlerBaseDual.getAccountHandler(HandlerBaseDual.java:114) ~[?:?]
	at org.openhab.binding.sonoff.internal.handlers.lansupported.HandlerBaseDual.initialize(HandlerBaseDual.java:59) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_275]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]
2021-03-31 10:10:20.358 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'sonoff:15:da2f3c07:1000aece9e': org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler cannot be cast to org.openhab.binding.sonoff.internal.handlers.HandlerAccount
java.lang.ClassCastException: org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler cannot be cast to org.openhab.binding.sonoff.internal.handlers.HandlerAccount
	at org.openhab.binding.sonoff.internal.handlers.lansupported.HandlerBaseDual.getAccountHandler(HandlerBaseDual.java:114) ~[?:?]
	at org.openhab.binding.sonoff.internal.handlers.lansupported.HandlerBaseDual.initialize(HandlerBaseDual.java:59) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_275]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_275]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_275]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_275]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]
2021-03-31 10:10:20.528 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread HTTP Refresh Service
java.util.UnknownFormatConversionException: Conversion = 'p'
	at java.util.Formatter$FormatSpecifier.conversion(Formatter.java:2691) ~[?:1.8.0_275]
	at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2720) ~[?:1.8.0_275]
	at java.util.Formatter.parse(Formatter.java:2560) ~[?:1.8.0_275]
	at java.util.Formatter.format(Formatter.java:2501) ~[?:1.8.0_275]
	at java.util.Formatter.format(Formatter.java:2455) ~[?:1.8.0_275]
	at java.lang.String.format(String.java:2961) ~[?:1.8.0_275]
	at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:168) ~[?:?]
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) ~[bundleFile:?]
	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]
2021-03-31 10:10:21.539 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread HTTP Refresh Service
java.util.UnknownFormatConversionException: Conversion = 'p'
	at java.util.Formatter$FormatSpecifier.conversion(Formatter.java:2691) ~[?:1.8.0_275]
	at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2720) ~[?:1.8.0_275]
	at java.util.Formatter.parse(Formatter.java:2560) ~[?:1.8.0_275]
	at java.util.Formatter.format(Formatter.java:2501) ~[?:1.8.0_275]
	at java.util.Formatter.format(Formatter.java:2455) ~[?:1.8.0_275]
	at java.lang.String.format(String.java:2961) ~[?:1.8.0_275]
	at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:168) ~[?:?]
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) ~[bundleFile:?]
	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]
2021-03-31 10:10:22.550 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread HTTP Refresh Service
java.util.UnknownFormatConversionException: Conversion = 'p'
	at java.util.Formatter$FormatSpecifier.conversion(Formatter.java:2691) ~[?:1.8.0_275]
	at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2720) ~[?:1.8.0_275]
	at java.util.Formatter.parse(Formatter.java:2560) ~[?:1.8.0_275]
	at java.util.Formatter.format(Formatter.java:2501) ~[?:1.8.0_275]
	at java.util.Formatter.format(Formatter.java:2455) ~[?:1.8.0_275]
	at java.lang.String.format(String.java:2961) ~[?:1.8.0_275]
	at org.openhab.binding.http.internal.HttpBinding.execute(HttpBinding.java:168) ~[?:?]
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:146) ~[bundleFile:?]
	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169) [bundleFile:?]

the last few error lines not sure if they are related or not to your binding. Let me know if you need more info
Thank you

can you clear the cache. its attempting to use the old handler. if that doesn’t work delete the thing and recreate

not sure what im doing wrong with regards to clearing cache,
But what i did is

  1. Delete the Sonoff things

  2. shutdown openhab

  3. deleted the file under /userdata/sonoff

  4. started openhab

  5. added the sonoff things

still showing offline on Local only mode.

am i missing a step?

stop openhab.
delete:

  • userdata/tmp
  • userdata/cache

start openhab

or you can do it this way:

@delid4ve
Did as instructed, too time for openhab to start and rebuild the screen but still same result
on Local mode Th16 thing still showing offline.
Any other suggestions?

logs?

2021-03-31 12:15:33.724 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Sonoff.items'
2021-03-31 12:16:10.984 [DEBUG] [nternal.handler.SonoffAccountHandler] - Initialising Sonoff Account: sonoff:account:c9dde247
2021-03-31 12:16:10.984 [DEBUG] [nternal.handler.SonoffAccountHandler] - Initialising Sonoff Account: sonoff:account:c9dde247
2021-03-31 12:16:10.984 [DEBUG] [nternal.handler.SonoffAccountHandler] - Initialising Sonoff Account: sonoff:account:c9dde247
2021-03-31 12:16:10.992 [DEBUG] [nternal.handler.SonoffAccountHandler] - Setting credentials
2021-03-31 12:16:10.996 [DEBUG] [nternal.handler.SonoffAccountHandler] - Clearing current message queue
2021-03-31 12:16:10.999 [DEBUG] [nternal.handler.SonoffAccountHandler] - Loading Device States
2021-03-31 12:16:11.382 [DEBUG] [internal.states.SonoffStateUtilities] - Added new state for device 1000aece9e
2021-03-31 12:16:11.387 [DEBUG] [nternal.handler.SonoffAccountHandler] - Starting the message Queue
2021-03-31 12:16:11.392 [DEBUG] [nternal.handler.SonoffAccountHandler] - Setting Mode Change Listeners
2021-03-31 12:16:11.396 [ERROR] [.connections.SonoffConnectionManager] - connection Manager mode changed to : local
2021-03-31 12:16:11.403 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:16:11.440 [DEBUG] [rnal.connections.SonoffLanConnection] - mDNS service has been started on IP 127.0.0.1
2021-03-31 12:16:11.504 [DEBUG] [rnal.connections.SonoffLanConnection] - mDNS service has been started on IP xxx.xx.xx.xx
2021-03-31 12:16:11.509 [DEBUG] [.connections.SonoffConnectionManager] - Local Mode connected
2021-03-31 12:16:11.523 [DEBUG] [nternal.handler.SonoffAccountHandler] - Creating scheduled taks to run the queue
2021-03-31 12:16:11.529 [DEBUG] [nternal.handler.SonoffAccountHandler] - Creating refresh tasks
2021-03-31 12:16:11.536 [DEBUG] [ernal.messaging.SonoffCommandManager] - Message queue running
2021-03-31 12:16:11.559 [DEBUG] [nternal.handler.SonoffAccountHandler] - Setting an initial status
2021-03-31 12:16:11.795 [DEBUG] [ernal.messaging.SonoffCommandManager] - Lan event received from (here got the sonoff IP)
2021-03-31 12:16:11.817 [DEBUG] [rnal.handler.SonoffBaseDeviceHandler] - Initialising device: sonoff:15:c9dde247:1000aece9e
2021-03-31 12:16:11.817 [DEBUG] [rnal.handler.SonoffBaseDeviceHandler] - Initialising device: sonoff:15:c9dde247:1000aece9e
2021-03-31 12:16:12.494 [DEBUG] [ernal.messaging.SonoffCommandManager] - Forwarded state to 1000aece9e
2021-03-31 12:17:11.543 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:18:11.547 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:19:11.549 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:20:11.551 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:21:11.553 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:22:11.556 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:23:11.559 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:24:11.561 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:25:11.564 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:26:11.568 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:27:11.571 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:28:11.575 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:29:11.577 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:30:11.580 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:31:11.582 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:32:11.585 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:33:11.587 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:34:11.589 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:35:11.591 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:36:11.593 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:37:11.595 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:38:11.597 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:39:11.600 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:40:11.602 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:41:11.604 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:42:11.606 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:43:11.609 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:44:11.612 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:45:11.614 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:46:11.617 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:47:11.619 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:48:11.622 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:49:11.624 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:50:11.626 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:50:21.697 [DEBUG] [ernal.messaging.SonoffCommandManager] - Lan event received from xxx.xxx.xx.x
2021-03-31 12:50:21.710 [DEBUG] [ernal.messaging.SonoffCommandManager] - Forwarded state to 1000aece9e
2021-03-31 12:50:21.902 [DEBUG] [ernal.messaging.SonoffCommandManager] - Lan event received from (here was the right sonoff TH16 IP)
2021-03-31 12:50:21.920 [DEBUG] [ernal.messaging.SonoffCommandManager] - Forwarded state to 1000aece9e
2021-03-31 12:50:26.303 [DEBUG] [ernal.messaging.SonoffCommandManager] - Lan event received from xxx.xxx.xx.x
2021-03-31 12:50:26.318 [DEBUG] [ernal.messaging.SonoffCommandManager] - Forwarded state to 1000aece9e
2021-03-31 12:50:26.800 [DEBUG] [ernal.messaging.SonoffCommandManager] - Lan event received from xxx.xxx.x.x
2021-03-31 12:50:26.811 [DEBUG] [ernal.messaging.SonoffCommandManager] - Forwarded state to 1000aece9e
2021-03-31 12:51:11.628 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:52:11.631 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:53:11.634 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:54:11.637 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:55:11.639 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:56:11.642 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:57:11.644 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:58:11.646 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 12:59:11.648 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:00:11.650 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:01:11.654 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:02:11.656 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:03:11.658 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:04:11.661 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:05:11.664 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:06:11.666 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:07:11.668 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:08:11.670 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:09:11.671 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:10:11.673 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:11:11.675 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:12:11.676 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:13:11.678 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:14:11.680 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 
2021-03-31 13:15:11.683 [DEBUG] [.connections.SonoffConnectionManager] - Connection Check Running for local mode 

There doesn’t seem to be the previous error but in things the TH16 is showing offline and the reading of the temp is returning 0C.

On another note, when I change the Sonoff thing to Cloud and local, looking at the TH16 thing is says “cloud only” hope this helps

I’ll have a look in a bit.
Could you check the following:
In ewelink app for the device is there a LAN control switch like this:

If so is it on or off?

And also what firmware version?

I had checked before in the ewelink app and couldn’t find the setting for LAN control noting before there was an option. I believe in the recent updates of the app they have removed it.
I had checked online and it seems this has been removed but enabled in the back ground by default this way if a user does not choose LAN control and internet goes down, the user would still be able to use the app.
Screen shots for the TH16 settings below.


let me know if you need more info

I have noticed another behavior with the TH16 connected to the cloud only, every minute or 2 minutes it flicks to 0C then gives the proper reading again.
This will be problematic when setting rules for example turn a pump for 10 minutes after 70C is reached, as this will continue to be triggered when changing from 0 to 70 (as an example).
Thoughts?

I’ll be looking at tomorrow see if I can pin it down
If it’s every minute can you look at the api response in the logs and send me the complete log for say 30 mins (pm the actual file)

@espresso I’ve just ordered a TH16 with temp/hum sensor (the si one) so I’ll have one to test in a couple of days if I can’t narrow down.

I’ve also got an rgb-cct (b05) bulb coming to get integrated.

This is great that you’re getting a TH16.
Still need me to send you the logs (30 minutes)?

yeah you can do… might be able to get it fixed sooner as bank holiday weekend so not sure when it will come. do it from initial startup (dropping the jar in), could you change log level to trace as i get more data from the lan connection this way. just need to hash out user/pass in first connection response (keep meaning to do this automatically but slips my mind).

New version (2.4):
3.x: SonoffJars/org.openhab.binding.sonoff-3.1.0-SNAPSHOT_v2.4.jar at main · delid4ve/SonoffJars · GitHub
2.5.x: SonoffJars/org.openhab.binding.sonoff-2.5.13-SNAPSHOT_v2.4.jar at main · delid4ve/SonoffJars · GitHub

  • Stabilized Thing Statuses
  • Added device automatic re-initialization for things already present when cache file is created through discovery
  • Added support for 1 way LAN supported devices
  • Various other bug fixes

@espresso can you try TH16 now. I haven’t set mine up yet but hopefully fixed under bullet 3.

Sorry guys, just noticed a typo in the code causing an error for certain devices. fixed.

2.5.x: SonoffJars/org.openhab.binding.sonoff-2.5.13-SNAPSHOT_v2.4r1.jar at main · delid4ve/SonoffJars · GitHub
3.x: SonoffJars/org.openhab.binding.sonoff-3.1.0-SNAPSHOT_v2.4r1.jar at main · delid4ve/SonoffJars · GitHub

No luck with the updated Binding still showing offline when I choose LAN mode only

Ok ill fire mine up tomorrow.