Ewelink / Sonoff Binding - New binding without flashing

Did you try removing the binding and re-adding…

No, went for the search, which is still running BTW. You want me to remove and re-add ?

yes do that

leave the account thing in place though.

BTW I put the same device ID in them all to try to get it to work on at least 1 of them thats the 1000e2428e ID

This bit.
Use code fences for things like this, 3 x ` (backticks, top left on a keyboard before 1)

you can delete all then code posts now, looks ugly on the thread :slight_smile:

Just going to have dinner and then will look at implementing. will let you know when done.

Cheers

I am back after solving the problem. :slight_smile:
i have read that someone else also have the problem that the binding want come up - so maybe it helps:

Here was my solution for the Problem with the rightmanagement:
After:
sudo chown openhab org.openhab.binding.sonoff-3.0.0-SNAPSHOT.jar
sudo systemctl stop openhab.service
sudo systemctl start openhab.service

the binding has worked. After configuring the ewelink login and password the things has gone online.

but
i can do the lights on, but i cant get the lights off.
In the logs:
2021-02-03 21:31:28.914 [WARN ] [fig.discovery.DiscoveryResultBuilder] - Representation property ‘10008734c6’ of discovery result for thing ‘sonoff:1:8f7381d113:10008734c6’ is missing in properties map. It has to be fixed by the bindings developer.
at java.base/java.lang.Thread.getStackTrace(Thread.java:1607)
at org.openhab.core.config.discovery.DiscoveryResultBuilder$1.run(DiscoveryResultBuilder.java:181)
at org.openhab.core.config.discovery.DiscoveryResultBuilder$1.run(DiscoveryResultBuilder.java:1)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.openhab.core.config.discovery.DiscoveryResultBuilder.getStackTrace(DiscoveryResultBuilder.java:178)
at org.openhab.core.config.discovery.DiscoveryResultBuilder.build(DiscoveryResultBuilder.java:157)
at org.openhab.binding.sonoff.internal.sonoffDiscoveryService.discover(sonoffDiscoveryService.java:119)
at org.openhab.binding.sonoff.internal.sonoffDiscoveryService.lambda$0(sonoffDiscoveryService.java:80)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-02-03 21:37:18.640 [INFO ] [onoff.internal.handler.SwitchHandler] - Cannot send command, all connections are offline

i have to switch it off from the ewelink android app. The i can switch it on from openhab again but i cant switch it off.

Tomorrow i dont have time for this, but on friday hopefully i can go on.

Can you let me know what device number it is (uuid under properties) so I can narrow it down.

Hi, I am trying to get the new sonoff binding to work, I have copied the file from github to the / usr / share / openhab2 / addons folder
then you can already look for things and items in the PaperUI inbox, my sonoff device has gone out at the moment, when I put my account data in the bridge, this comes out
“HANDLER_INITIALIZING_ERROR” in both.

In a second test I tried to create the manual bridge as explained above and this is the result


in the sonoff app the lan mode is activated, and my version of OH 2 is 2.5.11

greetings and a great work

Enable debug logging

this?
2021-02-03 23:15:13.916 [hingStatusInfoChangedEvent] - ‘sonoff:1:1000618bea’ changed from UNINITIALIZED (HANDLER_INITIALIZING_ERROR) to UNINITIALIZED (HANDLER_MISSING_ERROR)

2021-02-03 23:15:13.923 [hingStatusInfoChangedEvent] - ‘sonoff:1:1000618bea’ changed from UNINITIALIZED (HANDLER_INITIALIZING_ERROR) to UNINITIALIZED (BRIDGE_UNINITIALIZED)

That’s when you have removed the binding. I need the part from adding the binding. Hash out username and pass word.

And please use code fences as it’s completely unreadable otherwise

New version in each of the branches above.
Added a lot of error handling.
Added RF Bridge for testing
Fixed websocket disconnects when no messages received/sent

Breaking Change
‘region’ in the account configuration has been replaced with ‘countryCode’. This is the country code of your phone number preceded by a plus sign, i.e.: +44, +00.
The account thing will need to be deleted and recreated, with your devices configuration changed to the new bridge.
This allows for the binding to automatically discover the region your account is held.

@sam070266 could you please install the new version and add your devices through discovery. Your relays should work from the off. Once you have added the RFBridge, could you send some commands from the remote and then PM me the log so that I can finish the integration. (it wont do anything in openhab at the moment)

Hi Dave, downloaded from the links at the start of this post ? Its still not picking up anything in the scan.

‘’'2021-02-04 13:50:27.104 [DEBUG] [noff.internal.sonoffDiscoveryService] - Sonoff - Start Discovery

2021-02-04 13:50:44.495 [DEBUG] [noff.internal.sonoffDiscoveryService] - Sonoff - Start Discovery

2021-02-04 13:54:08.182 [DEBUG] [noff.internal.sonoffDiscoveryService] - Sonoff - Start Discovery

2021-02-04 14:07:56.392 [DEBUG] [noff.internal.handler.AccountHandler] - Sonoff - Running dispose()

2021-02-04 14:07:56.412 [DEBUG] [noff.internal.sonoffDiscoveryService] - Deactivate Background discovery

2021-02-04 14:07:56.449 [DEBUG] [noff.internal.sonoffDiscoveryService] - Deactivate Background discovery

2021-02-04 14:07:56.372 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘sonoff:account:87ab8e32b3’ changed from UNINITIALIZED (HANDLER_CONFIGURATION_PENDING) to UNINITIALIZED

2021-02-04 14:07:56.426 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘sonoff:account:87ab8e32b3’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

2021-02-04 14:08:28.065 [DEBUG] [noff.internal.sonoffDiscoveryService] - Activate Background Discovery

2021-02-04 14:08:28.067 [DEBUG] [noff.internal.sonoffDiscoveryService] - Start Background Discovery

2021-02-04 14:08:28.070 [DEBUG] [noff.internal.sonoffDiscoveryService] - Sonoff - Start Discovery

2021-02-04 14:08:28.224 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing ‘sonoff:account:87ab8e32b3’ changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to UNINITIALIZED (HANDLER_CONFIGURATION_PENDING)

2021-02-04 14:09:04.624 [DEBUG] [noff.internal.sonoffDiscoveryService] - Sonoff - Start Discovery

Ignore this, my account thing had gone offline as the eu had been removed for some reason. Things have all added, will test now. Cheers

It’s the received messages for the deviceId of your bridge I need. Just got mine though… can’t believe how small they are

Just tried the new version with country code, both S26 and basic work fine under OH3.
Great Work !
Thanks !!!

I also integrated the Binding in OH3.0.1.

I created a Sonoff Account Thing, set country code +49, IP adress and Access Mode local Only.
This thing is online and also the discovery of my SONOFF switch in my office was successful.
The Switch thing (TX1C) is online and looks good.

But the switching does not work.
Can somebody help me out here?

2021-02-04 21:49:49.076 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.handleCommand()’ on ‘org.openhab.binding.sonoff.internal.handler.SwitchHandler@936e3f5’: null

java.lang.NullPointerException: null

at org.openhab.binding.sonoff.internal.handler.SwitchHandler.sendUpdate(SwitchHandler.java:170) ~[?:?]

at org.openhab.binding.sonoff.internal.handler.SwitchHandler.handleCommand(SwitchHandler.java:207) ~[?:?]

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

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

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

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

at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]

at org.openhab.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]

at com.sun.proxy.$Proxy290.handleCommand(Unknown Source) [?:?]

at org.openhab.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:80) [bundleFile:?]

at org.openhab.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]

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

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

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

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

at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]

at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]

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

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

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

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

could you pm the full debug log please.

I would like to.
Could you give me some advice how to do so?

I am using openhabian on a rpi4 and I am a basic linux user.