Ewelink / Sonoff Binding - New binding without flashing

Correct but I believe that device already works anyhow :+1:

Also look on eBay
 that’s far cheaper on there, also do a 2 and 4 way one

Basically anything that can be added to ewelink will work (I may have to add).

L1 / L1 lite (rgb led strip) should be fully integrated tomorrow too

Hi Dave,

You are writing:
The DW2 is cloud only I’m afraid so unfortunately has to go through the ewelink servers

But what does this mean, is this only initially or is this permanently connected to the chinese servers?
What is required from these chinese servers, is these only login data or what else are you grabbing for OH to work?

The binding logs in to the Api and then the Websocket on startup. (credentials sent via https and wss so both are secure)
This is repeated every 12 hours (at present but I am testing longer intervals) to refresh the access tokens or when the connection drops out (lose internet, open ewelink app etc)

The websocket is a permanent open secure connection in order to receive instant updates. Since the DW2 doesnt have LAN functionality this is the only way to get the data (no different to the app on your phone)

This is amazing!
Thank you delid4ve.
I have followed your instructions. I am on Openhab 2.5.x
Have a Sonoff TH16.
I am able to read the temperature correctly.
Works like a charm

You’re a life saver and made my day.

Hi again,
I have an observation with regards to the TH16 behavior to confirm that it is working as intended.
When I added the TH as an thing, i got a proper temperature reading. Having checked after, the temperature did not change. When I logged in to the Ewelink app and refreshed, the temp reading got updated (I see the logic in this case that it is connected to the cloud, though it would defeat the purpose that I have to open the Ewelink app for it to refresh rendering it unusable).
I tried setting in the the Sonoff thing to work only in LAN mode, the TH16 went offline (that is seems to only communicate via cloud).

Question this is how it is meant to be?

I mean the TH16 only works online and will refresh only when refreshing from the app.

Any feedback is appreciated.
Thank you

@espresso can you enable debug logging for me and send me the logs over a period of time. Also check if you have any websocket errors in your current logs.

The thing status has some bugs atm which i’m in the process of sorting out but the status should update regardless.

Will monitor it for a few days see the behavior better as I only installed it today and will surely report back

I’m not sure what the change difference has to be for the web socket to get an update on the TH16 either as i dont own, it may be 1 degree, it may be 0.1 degree. it should still get updated every 60 seconds regardless though when the api is called.

@espresso think i found what was wrong. can you try whatever one is applicable. Will propably have to restart openhab and maybe clear cache on this.

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

3.x: SonoffJars/org.openhab.binding.sonoff-3.1.0-SNAPSHOT_v2.3r2.jar at main · delid4ve/SonoffJars · GitHub

sonoff L1/L1 lite added in this version guys.

@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