Ewelink / Sonoff Binding - New binding without flashing

Hi @delid4ve,

firstly thank you for this binding as its almost impossible for me to get to these units to reflash them with Tasmota, so this makes perfect sense.

I’ve been trying to add my Things via the Account Binding however I can not select of enter in the required details.

System: OpenHabian version for openHAB 3.0.2
Addon: org.openhab.binding.sonoff-3.0.3-SNAPSHOT_2.5r6.jar

The Binding adds without issue and I can work my way through all of the selections, however as you can see from the output below in the logs, I can not add the individual Things per device via the Bridge.

I’ve noticed your README states you enter these additional details: countryCode, ipaddress, accessmode & initialize - which I’m unable to as the selection only requests email & password

I have tried to run the Discovery or Initialise however without success.

Any ideas what I’m doing wrong?
I’ve not even added the device 1000c049d2 and the errors start as per below. When I add device 1000c049d2 it reports I should “This device has not been initilized, please run discovery”

Log output:
2021-06-24 21:11:30.140 [ERROR] [unication.SonoffCommunicationManager] - The device 1000c049d2 doesnt exist, unable to set state 2021-06-24 21:11:30.753 [ERROR] [unication.SonoffCommunicationManager] - The device 1000c049d2 doesnt exist, unable to set state 2021-06-24 21:11:31.056 [ERROR] [unication.SonoffCommunicationManager] - The device 1000c049d2 doesnt exist, unable to set state ==> /var/log/openhab/events.log <== 2021-06-24 21:21:27.091 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'sonoff:1:e906500754:bfb0f03501' changed from UNINITIALIZED to INITIALIZING 2021-06-24 21:21:27.169 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'sonoff:1:e906500754:bfb0f03501' changed from INITIALIZING to OFFLINE (CONFIGURATION_ERROR): This device has not been initilized, please run discovery ==> /var/log/openhab/openhab.log <== 2021-06-24 21:21:51.099 [ERROR] [unication.SonoffCommunicationManager] - The device 1000c049d2 doesnt exist, unable to set state 2021-06-24 21:21:58.811 [ERROR] [unication.SonoffCommunicationManager] - The device 1000c049d2 doesnt exist, unable to set state 2021-06-24 21:21:59.543 [ERROR] [unication.SonoffCommunicationManager] - The device 1000c049d2 doesnt exist, unable to set state 2021-06-24 21:21:59.937 [ERROR] [unication.SonoffCommunicationManager] - The device 1000c049d2 doesnt exist, unable to set state ==> /var/log/openhab/events.log <== 2021-06-24 21:22:42.410 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'sonoff:14:e906500754:f90caeb8da' changed from UNINITIALIZED to INITIALIZING 2021-06-24 21:22:42.488 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'sonoff:14:e906500754:f90caeb8da' changed from INITIALIZING to OFFLINE (CONFIGURATION_ERROR): This device has not been initilized, please run discovery

PS: @delid4ve helped me out on this:
Quote: “You should just be able to go to Settings → Things-> add (bottom right plus symbol) → sonoff → scan, to discover the devices. This should create files under userdata/sonoff for each device. If these files are not present you need to run discovery as per the above. Let me know how it goes.”

Winner on both accounts. I can’t believe I missed the LARGE BLUE scan button here.
PS: if you have multiple ‘Homes’ you actually have to switch between them on the APP (on your phone) to see them on the import.
PS: all devices pulled in successfully. Much appreciated for your binding and help.

@kurtopenhab should have time tomorrow afternoon, apologies, crazily busy atm.

@kurtopenhab I’ve had a look and cant see how this is happening. The ‘key’ part of the json you posted should update the scene channel. 0 = short press, 1 = double click, 2 = long press.

There is nothing present in the code that can manipulate this key. Maybe a rule? Maybe a ewelink automation?

Do some more testing and monitor the logs for each type of button press, see if you can decipher exactly why it happens. Are there multiple modes the button can be put into within ewelink? Does it return to a set scene number after a certain amount of time every time? (there was 1min 20 seconds between your logs, is this every single time?)

If you can work it out then I can add some logic in to combat it.

Hi binding worked on 3.0.1 updated / clean install 3.1.0
now I tend to get this - could not resolve -

2021-07-11 16:10:14.435 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/C:/openHAB/addons/org.openhab.binding.sonoff-3.1.0-SNAPSHOT_v2.4r2.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sonoff [240]
Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:440) ~[org.eclipse.osgi-3.16.200.jar:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) [bundleFile:3.6.8]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) [bundleFile:3.6.8]

2021-07-11 16:13:05.265 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Measurement system set to ‘SI’.

Yes I have set measurement to metric… in conf
Any advice gladly taken
thanks M
PS it is on a win 10 system

Use the 3.0.3 jar in the GitHub repo :+1:

Cheers Dave
tried 2.5.4 2.5.6 no luck… pls note blank install just one bridge IAMMETER nothing else…

!SESSION 2021-07-14 17:10:08.202 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.11
java.vendor=Azul Systems, Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US

!ENTRY org.openhab.binding.sonoff 4 0 2021-07-14 17:10:08.202
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sonoff [29]
Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

at org.eclipse.osgi.container.Module.start(Module.java:463)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1845)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1838)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1743)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1665)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)

SOrry tried zulu-8 more problems … be aware i am on 3.2.0 by now

I’ll build a new version Friday for 3.2.0, something probably changed.

I know you have tried binding release versions but you need the openhab revision which I’m not sure you have… (3.0.3 when javax changed)

Hi Dave
thanks for your patience.
Tried 3.0.3 2.5.6 no luck - I noticed that the install I have uses javax.annotations.api /1.2 1.3 and there is some mentioning that osi jdk may not show all dependencies - but I am a novice in this one I am from the time of big systems small programs not vice versa.
Cheers M
2021-07-15 17:00:06.273 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/C:/openHAB/addons/org.openhab.binding.sonoff-3.0.3-SNAPSHOT_2.5r6.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sonoff [29]
Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

Hi,

I am getting this error after i upgraded from Ubuntu 20.10 desktop to 21.04. Do you have any idea what can be the problem. I am getting this error after created “account thing” in sonoff binding

22:02:21.807 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.initialize()’ on ‘org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler@771c5941’: Index 2 out of bounds for length 2
java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) ~[?:?]
at java.util.Objects.checkIndex(Objects.java:372) ~[?:?]
at java.util.ArrayList.get(ArrayList.java:459) ~[?:?]
at com.google.gson.JsonArray.get(JsonArray.java:194) ~[bundleFile:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.setParameters(SonoffDeviceState.java:109) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.updateState(SonoffDeviceState.java:77) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.(SonoffDeviceState.java:61) ~[?:?]
at org.openhab.binding.sonoff.internal.SonoffCacheProvider.getStates(SonoffCacheProvider.java:157) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.restoreStates(SonoffAccountHandler.java:293) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.initialize(SonoffAccountHandler.java:100) ~[?:?]
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:829) [?:?]
22:02:21.816 [ERROR] [.core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing ‘sonoff:account:87d16cffb9’: Index 2 out of bounds for length 2
java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) ~[?:?]
at java.util.Objects.checkIndex(Objects.java:372) ~[?:?]
at java.util.ArrayList.get(ArrayList.java:459) ~[?:?]
at com.google.gson.JsonArray.get(JsonArray.java:194) ~[bundleFile:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.setParameters(SonoffDeviceState.java:109) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.updateState(SonoffDeviceState.java:77) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.(SonoffDeviceState.java:61) ~[?:?]
at org.openhab.binding.sonoff.internal.SonoffCacheProvider.getStates(SonoffCacheProvider.java:157) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.restoreStates(SonoffAccountHandler.java:293) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.initialize(SonoffAccountHandler.java:100) ~[?:?]
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:829) [?:?]
22:02:21.817 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing ‘sonoff:account:87d16cffb9’ changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): Index 2 out of bounds for length 2

Thanks

Hi @fisker
Sorry work still really busy so haven’t had much time to get on, what jar are you using?

@Martin_B_Goetz-Jablo ill compile new as soon as possible but short on time atm

Hi all
Latest Jars uploaded
2.5.13 updated also as I’ve had to roll back due to http stability issues so updates will be published for now on this branch.

2.5.13 - openhab-sonoff-compiled/org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r6.jar at main · delid4ve/openhab-sonoff-compiled · GitHub

3.2.0 - openhab-sonoff-compiled/org.openhab.binding.sonoff-3.2.0-SNAPSHOT_2.5r6.jar at main · delid4ve/openhab-sonoff-compiled · GitHub

If you are running an old 3.x release (before javax change at 3.0.2/3.1M4) then you will need the following jar still: openhab-sonoff-compiled/org.openhab.binding.sonoff-3.1.0-SNAPSHOT_2.5r6.jar at main · delid4ve/openhab-sonoff-compiled · GitHub

Hi and thank you

@delid4ve i am using org.openhab.binding.sonoff-3.1.0-SNAPSHOT_2.5r6.jar
Openhab version 3.1.0

i have installed also new org.openhab.binding.sonoff-3.2.0-SNAPSHOT_2.5r6.jar and i get error as well after i create “account”, see below

20:55:39.348 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing ‘sonoff:account:8e514b99c5’ changed from UNINITIALIZED to INITIALIZING
20:55:39.366 [INFO ] [internal.handler.SonoffAccountHandler] - Sonoff Access Mode set to: mixed
20:55:39.430 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.initialize()’ on ‘org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler@40705b3b’: Index 2 out of bounds for length 2
java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) ~[?:?]
at java.util.Objects.checkIndex(Objects.java:372) ~[?:?]
at java.util.ArrayList.get(ArrayList.java:459) ~[?:?]
at com.google.gson.JsonArray.get(JsonArray.java:194) ~[bundleFile:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.setParameters(SonoffDeviceState.java:109) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.updateState(SonoffDeviceState.java:77) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.(SonoffDeviceState.java:61) ~[?:?]
at org.openhab.binding.sonoff.internal.SonoffCacheProvider.getStates(SonoffCacheProvider.java:157) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.restoreStates(SonoffAccountHandler.java:293) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.initialize(SonoffAccountHandler.java:100) ~[?:?]
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:829) [?:?]
20:55:39.449 [ERROR] [.core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing ‘sonoff:account:8e514b99c5’: Index 2 out of bounds for length 2
java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?]
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?]
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248) ~[?:?]
at java.util.Objects.checkIndex(Objects.java:372) ~[?:?]
at java.util.ArrayList.get(ArrayList.java:459) ~[?:?]
at com.google.gson.JsonArray.get(JsonArray.java:194) ~[bundleFile:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.setParameters(SonoffDeviceState.java:109) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.updateState(SonoffDeviceState.java:77) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffDeviceState.(SonoffDeviceState.java:61) ~[?:?]
at org.openhab.binding.sonoff.internal.SonoffCacheProvider.getStates(SonoffCacheProvider.java:157) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.restoreStates(SonoffAccountHandler.java:293) ~[?:?]
at org.openhab.binding.sonoff.internal.handler.SonoffAccountHandler.initialize(SonoffAccountHandler.java:100) ~[?:?]
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:829) [?:?]
20:55:39.451 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing ‘sonoff:account:8e514b99c5’ changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): Index 2 out of bounds for length 2

Please note that i have reinstalled openhab and first time it worked then after reboot it started not to work again. What should i do?

Can you try r4 in the archive folder as I seem to have issues with the current release, haven’t got time to check right away though

Hi @delid4ve i cannot find r4 in the archive, i have tried r3, error below:
Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.sonoff-3.1.0-SNAPSHOT_2.5r3.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sonoff [255]
Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

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

Thanks a lot

Try this one:
3.0.3 - openhab-sonoff-compiled/org.openhab.binding.sonoff-3.0.3-SNAPSHOT_2.5r4.jar at main · delid4ve/openhab-sonoff-compiled · GitHub

(3.0.3 will work on 3.1 - it’s for after javax got changed in milestone 5 release)

Work should be calming down (:crossed_fingers:) by middle to end of next week so will have time to bug fix current release then

Hi @delid4ve,

Thanks for replying and hope work will be calming down.
I have tried same error:

Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.sonoff-3.0.3-SNAPSHOT_2.5r4.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.sonoff [259]
Unresolved requirement: Import-Package: javax.measure; version="[1.0.0,2.0.0)"

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

I will test the other one after you have free time to fix.
Thanks a lot.

Hi Dave,
same problem here no time…
BUT now
OH 3.2.0 Zeus 11 under Windows latest 64 bit and your latest jar (3.2 -2.5.6) works fine !!
Thanks for that.

I cleaned cache tmp logs and restarted OH at least twice (slow internet) added your jar restarted.
Your bridge showed up after finding my pw for ewe scanned found all devices …

Now I have Iammeter giving excess power and a small test script to switch on / off non essential loads like towell heater(s) underfloor warmer etc.

Again thanks and enjoy the weekend
M

Hi Dave

I have been testing your Sonoff binding and have found it to be working quite well, thanks for the hard work.

I have come across something that I wanted to run past you as I am not sure if it’s a binding issue, OpenHab or me.

Here is the scenario

I have two light switch T3US3C (3 touch buttons) and I am using a rule to keep these two in sync.

For example when button 0 is press on one switch it turns on button 0 on the other, the rule does this for buttons 1 and 2 as well, in a nut shell one light switch with three buttons mirrors the other with 3 buttons.

Now above works perfectly fine with my rule, no problem, however there seems to be a race condition if you press a second button to quickly after the first.

Scenario, press button 0 quickly followed by button 1 (or 2, same result) it seems if you do this before the rule has turned on button 0 on the second light switch then the system gets confused and both switches start flicking on and off, it enters an infinite loop.

Because the lights are touch, you tend to run your finger down the light switch to turn all the lights on, this causes the described issue, if you wait a second in between each press then it works as expected.

I have multiple light switches mirrored to others in other areas and they all have this issue.

I have tried many different rules from the forum but still have this issue.

I will post my rule below for your info.

Let me know your thoughts.

Appreciate your time and understand it is limited.

I am using OH 3.1 and Binding 3.1.0 and also tried 3.2.0

rule “sync lights chalet 0”

when

Item Chalet1_Switch0 changed or 

Item Chalet2_Switch0 changed 

then

if(Chalet1_Switch0.state != newState) Chalet1_Switch0.sendCommand(newState.toString) 

if(Chalet2_Switch0.state != newState) Chalet2_Switch0.sendCommand(newState.toString) 

end

rule “sync lights chalet 1”

when

Item Chalet1_Switch1 changed or 

Item Chalet2_Switch1 changed 

then

if(Chalet1_Switch1.state != newState) Chalet1_Switch1.sendCommand(newState.toString) 

if(Chalet2_Switch1.state != newState) Chalet2_Switch1.sendCommand(newState.toString) 

end

rule “sync lights chalet 2”

when

Item Chalet1_Switch2 changed or 

Item Chalet2_Switch2 changed 

then

if(Chalet1_Switch2.state != newState) Chalet1_Switch2.sendCommand(newState.toString) 

if(Chalet2_Switch2.state != newState) Chalet2_Switch2.sendCommand(newState.toString) 

end