Ewelink / Sonoff Binding - New binding without flashing

@jateros openhab-sonoff-compiled/org.openhab.binding.sonoff-3.1.0-SNAPSHOT_2.5r2.jar at main · delid4ve/openhab-sonoff-compiled · GitHub

Also added 2.5x version to repo.
Additional fix added:
Zigbee temp wasn’t getting decimal places

Should fix it :+1:

All is working now, you are the best… :clap: :clap: :clap: :clap:

Thank you Dave. :+1:

1 Like

Good stuff.
Rf gear supports local mode, unfortunately your dimmer doesn’t.

The two different channels are so you can see when the actual rf remote activated or openhab did :+1:

1 Like

Hi Dave,

Nice work !!
My first Sonoff model 4CHPRO 4-gang WIFI Smart Switch with RF Control.
Discover is ok on OH 3 latest stable.
Don’t know the syntaxe for items ;»).
here is the userdata/Sonoff.100109cfe3.txt (1.5 KB) .

I am available if you need more info

Gilles

@GillesA That should already work, look in the Readme top post if you want to use items files, or just add from ui under the thing then channels

Thanks for support.
Found it ! i use {channel=“sonoff:4:uniqueName:4CHPRO:switch1”}

If you don’t mind, why not introduice your binding in OH addons?

regards
Gilles

Eventually. Its still in its infancy at present and I need to get some more devices added first. Developing it without the constraints of anyone/anything is far easier than if it was merged.

It works no different though, you just add the jar rather than install it from the ui (other than it not showing up under bindings in 3.x)

Hi all
Tried yesterday evening 3 hours installing the binding. Have put it in the correct directory of my openhab 3.0.2 installation on raspberry, chowned it to openhab but it never appears in the things list. The Plugin is named 3.1, may this be a problem because I run 3.0.2? Installed several other jar files from github archive and tried it, no success? Anyone with a great idea what I could try next?

Thanks a lot in advance.

Not sure where your expecting to see it…
It won’t show up under bindings.
Need to go to ‘Things’ → Add → Sonoff Account

Exactly, but nothing is there under things. When I click the add button, sonoff doesn’t appear. So 3.0.2 should not be the problem, correct?

Correct.
I have the binding running on 3.0.2 and also tested on 3.1.0-SNAPSHOT.

Does it show up in the console if you list the bundles?

Just out of curiosity, are you using the latest from my git repo? Not sure if I’ve updated the top post from memory, haven’t worked on it for a bit

Ignore that I have - should be openhab-sonoff-compiled/org.openhab.binding.sonoff-3.1.0-SNAPSHOT_2.5r3.jar at main · delid4ve/openhab-sonoff-compiled · GitHub

I’ll double check from a fresh install tomorrow. What platform is your openhab running on?
When you drop the jar in what do the logs say, anything? (Also try setting to debug first)

You could also in the meantime try some of the versions in the archive folder of the repo, let me know if any work and the highest version that does

Hi @delid4ve , Thanks for making the binding, it’s awesome for what I’ve got working so far! I just tried to add the Zigbee door & Window sensor and it’s showing as “error while creating thing: Conflict” and the error log shows this:

==> /var/log/openhab/openhab.log <==
2021-05-11 04:00:16.814 [ERROR] [nhab.core.thing.binding.ThingFactory] - Thing factory (class org.openhab.binding.sonoff.internal.SonoffHandlerFactory) returned null on create thing when it reports to support the thing type (sonoff:zcontact).
2021-05-11 04:00:16.819 [WARN ] [g.discovery.internal.PersistentInbox] - Cannot create thing. No binding found that supports creating a thing of type sonoff:zcontact.

The txt file created of that device ID is as follows:

{"name":"Balcony door","deviceid":"a44000515d","apikey":"30e2af62-fde7-43e9-910b-fc1a5e513a38","extra":{"mac":"7c2fff22004b1200","apmac":"00:00:00:00:00:00","model":"NON-OTA-GL","description":"ZIGBEE_DOOR_AND_WINDOW_SENSOR","modelInfo":"5d37fb6bec04d0383c5121d6","manufacturer":"深圳松诺技术有限公司","brandId":"59e0dbc25c1af3a660cc1ac0","uiid":3026,"ui":"zigbee门窗传感器"},"brandName":"coolkit","brandLogo":"","showBrand":false,"productModel":"ZIGBEE_DOOR_AND_WINDOW_SENSOR","devConfig":{},"family":{"familyid":"6084edef533e5c0008ad4691","index":-2,"roomid":"6084edef533e5c0008ad4690"},"shareTo":[],"devicekey":"ca5863a4-1939-4c2d-b949-2c98e01ed0a9","online":true,"params":{"bindInfos":{"gaction":["30e2af62-fde7-43e9-910b-fc1a5e513a38_ewelinkGoogleHome"]},"subDevId":"7c2fff22004b1200","parentid":"10011a161d","lock":1,"trigTime":"1620643395344","battery":100}}

I’m not sure if I’m doing something wrong or if it just isn’t supported by the binding, I’m really new to openhab so let me know if I’ve sent the wrong details

Can you pm me the files under userdata/sonoff for the device that doesn’t work - that file above is for the bridge itself (uiid66).

1 Like

could be tired, could be user error, I can’t find how to send a DM :sweat_smile:

I’ve updated my original post with the correct text file

@kurtopenhab added your sensor below - you’ll need to remove the thing and recreate

@Alekos_Avgoustatos try this also - compiled against 3.0.3 instead of 3.1.0.

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

2 Likes

Dear Dave
Thanks a lot for all your help. I think, I’m dumb. I always copied the wrong link in the overview of your archives, that’s the reason why it didn’t work. Sorry sorry sorry! Now it works, I can see it in the inbox… Also your latest version compiled with 3.1… again, thanks for your help…

@delid4ve thank you so much! Got it all added in.
Is there a possibility for a channel for something along the lines of “door status”?

Does ewelink provide this?
The only other parameter I see was ‘lock’ which was set to 1 in your post above, what is this?

It’s shown in ewelink app as “open” or “closed” , will it update in the text document if it’s updated, or is there a way I can check the current status?

If I re-add the device it updates the text document, seems to be ‘lock’ 0 is closed, and ‘lock’ 1 is open.

I’ll get it added today.

@kurtopenhab openhab-sonoff-compiled/org.openhab.binding.sonoff-3.0.3-SNAPSHOT_2.5r5.jar at main · delid4ve/openhab-sonoff-compiled · GitHub

Will need to remove/readd thing to discover new channel (status) of type ‘Contact’ - Will show OPEN / CLOSED

Let me know it works ok :+1:

1 Like