I know there have been several posts about integrating Sonoff devices into OpenHAB using tasmota and re-flashing these devices, but I was wondering whether anyone is working on a binding for EWeLink now given that they offer API access.
Yes, I could write some scripts to do this but before I embark down this route (as I don’t want to re-flash my devices, been there and had to replace a couple due to some failed upgrades) just wondering if anyone is planning anything ?
yes, i’m really interested in that. i don’t want to flash my devices too. it would be great if someone (you) are willing to code something. i would be really a alpha tester for that.
Hi, it’s gone on the back-burner for a while for me…I had it working a treat and then everything just stopped due to changes implemented by Itead on their cloud platform and could not work out what was wrong, so gave up…
Because of these changes and because there is limited integration out there, IFTT would be the best way to go.
Guys can you add jar, fill in username and password and region (eu /us/cc/cn) for your ewelink account. run discovery and send me the log for Discover Devices Response (info level). mask apikey/at/rt/username/password but dont remove them from json
i only have powr2 - which by the way you can use (cloud only atm and not running long enough to check if token refreshes correctly (should do but…).
let me know what devices they are (model) as the api just says POW for the R2 so want to be clear.
need to get the json for other devices. do have some but wanna try and get most integrated in one hit.
For others this is how I got it to work.
Dowloaded and copied the .jar.txt file above to the addons directory in openHAB and removed .txt extension
On my RasPi changed the ownership of the .jar
cd /usr/share/openhab2/addons
sudo chown openhab:openhab org.openhab.binding.sonoff-2.5.2-SNAPSHOT.jar
sudo shutdown
After shutdown cycled power and started Log Viewer and opened the Paper UI. In the paper UI I selected ‘inbox’ and the ‘+’ symbol, scrolled down the list and clicked ‘Sonoff Binding’ then clicked ’ Sonoff Account Thing’ and entered my account information.
In the log viewer I go some messages like:
2021-01-17 18:14:07.331 [hingStatusInfoChangedEvent] - 'sonoff:account:xxxxxxxx' changed from UNINITIALIZED to INITIALIZING
2021-01-17 18:14:12.372 [WARN ] [core.thing.internal.ThingManagerImpl] - Initializing handler for thing 'sonoff:account:b5d80086' takes more than 5000ms.
2021-01-17 18:14:15.532 [INFO ] [ding.sonoff.internal.connections.Api] - Get WebSocket Server Response Raw:{"port":8080,"IP":"35.157.208.224","reason":"ok","domain":"eu-pconnect2.coolkit.cc","error":0}
2021-01-17 18:14:16.221 [WARN ] [noff.internal.handler.AccountHandler] - Sonoff - Websocket Logged In
2021-01-17 18:14:15.559 [hingStatusInfoChangedEvent] - 'sonoff:account:xxxxxxxx' changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING): Waiting for api to log in
2021-01-17 18:14:16.222 [hingStatusInfoChangedEvent] - 'sonoff:account:xxxxxxxx' changed from OFFLINE (CONFIGURATION_PENDING): Waiting for api to log in to ONLINE
Back in Paper UI , select ‘Things’ and the ‘+’ button then select ’ sonoff Binding’
The JSON message is then in the log viewer after the response.
2021-01-17 18:20:59.340 [INFO ] [ding.sonoff.internal.connections.Api] - Get Devices Response:
Not far off now guys so will have a beta version up very soon. Been a learning curve in communications and encryption and learning the packages available (only ever used http and never AES security)
At present I have the following implemented:
Remote Api
initial discovery to get encryption keys etc
sending commands to the device
Remote websocket
streaming data for updates
Local mDns/Zeroconf
streaming data for updates
sending commands to the device
Just got to clean up my code, add supported devices in and it’ll be ready to go.
Hello!
I want my TH10 temperature goes to openhab.
I took the “org.openhab.binding.sonoff-3.4.0-SNAPSHOT_R1.jar” in addons and want to add the thing in OH.
But nothing appears.
How it goes? I have read the whole reply, but they doesn’t helps me, because i didn’t understand what you say!
Sorry for my english, but this is the only community, that might helps me. I didn’t find a german community.
And: i’m a beginner in OH3.