Start a new topic

Open API

Best of all would be an open API to the eWeLink cloud. I could write my own application doing exactly what I need it to do, without flashing the Sonoff with custom firmware and without setting up my own cloud services. I would only need to register the device, get the API keys from the cloud and then communicate to my Sonoff devices via cloud. I know that creating such API is a lot of work, but think of all the possibilities!


33 people like this idea

Any feedback from support / ITEAD about exposing some API's for us to use? I believe this would greatly increase the value and freedom of using Sonoff devices. 


1 person likes this
+1 Here.   IFTTT integration does help, but an open API would add so many more possibilities.

 


1 person likes this

My 50 cents for this feature. It would increase Sonoff market share.


3 people like this

+1

I would use this API too

I agree. I am currently trying to jippo the software on a sonoff switch to talk to my local server but an open API would be some usefull. I will buy 10 units if the API was available.

Do this now pls.

Looks like someone has started reverse-engineering the API.
This might help some of you:

https://github.com/gbro115/homebridge-ewelink

+1
Indeed. Imagine the possibilities.

I would totally support the idea!

I just wrote something like this (for a different reason). I have an automatic door opener called an "Autoslide". It has a brand new WiFi interface, and I wanted my home automation to control it. Turns out it’s a Sonoff type board made by Itead. I cant flash it with custom firmware (it’s not a switch or anything), so I wrote a client in python 3.6 to interface to it, and allow me to control the various functions. It’s intended to do this via mqtt, but the client has a bunch of method exposed that you can use as an API (or just use MQTT). I wrapped it up in a demo program, and played with the door. Works great. I then thought, all these other sonoff devices must be similar, so I bought a varied bunch of switches, led bulbs, sensors and so on. Turns out it’s very simple to extend the basic interface to cover all the sonoff devices (the ones I have anyway). So I made it modular. There is a default module that covers all the basic functions (switch on/off, led on/off, timers etc), which you can then use as a base class for any device. You just add the specific commands for that device, and off you go. If you don’t create a class/add the commands, the client will automatically add the default names to the default class, which is usually enough for testing. For example, the Led B1 has 5 channels "channel1-5", this is what they are called by default. If you create an led class (which I did), I call these "white_cool", "white_warm", "red", "green", "blue". Just makes it easier. My base framework includes example classes for the basic switch, POW and S31 switches, TH16 and Led B1. No firmware mods needed, my client connects via the Itead cloud servers, you just use your phone number/email and password to connect. It then stays connected and provides real time two way communications with all the devices in your account. It’s fully asynchronous, so it isn’t blocking and doesn’t need a thread (though it does use asyncio and threading internally). I’ve only tried it with US servers, there is untested code in there for other servers. If anyone is interested I was going to post it to my github in the next few days.
The basic login/APIkey stuff is based on the homelink work, (to give them credit).

+1

Login or Signup to post a comment