Sonoff /eWeLink component for original firmware

Hope the websocket thing works out. Somehow the app on my phone updates instantly when I turn on/off switch using google home.
HA basically updates every 10 seconds.

For you and for anyone else willing to help (themselves) I created this little script that can provide me useful data on the details of various devices. Please read the description carefully :slight_smile:

. HASS-sonoff-ewelink/sonoff-debug at master · peterbuga/HASS-sonoff-ewelink · GitHub

1 Like

Awesome. Will give it a try tomorrow. Will add other devices to the shared account as well

For the naming part, I used the customize.yaml and so far all is working well:

switch.sonoff_10004d43f8:
  friendly_name: Sonoff Soggiorno
switch.sonoff_10004dd3da:
  friendly_name: Sonoff Cucina

Cattura

I have two sonoffs and they are working as expected.

For you and for anyone else willing to help (themselves) I created this little script that can provide me useful data on the details of various devices.

As I said I’m on Hass.io, I logged on the terminal but it seems that I don’t have a python command to work with, sorry :sweat:

i see it’s pretty common to have a hassio install so i’ll guess this seems to fit the bill for my request above

i would like to mention that the script can be ran from anywhere be it a linux/macos/windows command line (as long as the highly common dependencies are met), it’s totally independent from HA install.

thanks for trying it out :wink:

Yup doing the same right now.
Just wanted to be get my hands dirty with coding myself. :stuck_out_tongue:

Check out the GitHub repo.
Added JSON dumps.

Adding Sonoff 4Ch pro to account currently breaks the platform/component. (Error added on GitHub)

Let me know if I can be of any other help.

Any setting need in Charles in order to catch the login from ewelink app on iphone?

I have installed Charles on my notebook and share the wifi hotspot, my iphone can connect and use internet share from the notebook. However there is no any display in Charles. I noticed that the ip address received to my iphone is in different subnet mask. I also try to change it manually to the same subnet mask but if do so I can connect to wifi hotspot but cannot use internet and cannot login to ewelink app.

OMG!!! I got it working now. Thank you so much. Too good to be true.

Glad you’ve got it working :wink:

Regarding Charles, (for future reference) what I usually/easily do is to connect the laptop/iphone (or android) to the same wifi, point phone’s proxy settings to Charles/laptop local ip, install the certificate and enjoy. (do notice that this doesn’t work all the time, especially if you have apps using certificate pinning, for this you need to globally disable SSL on the phone :upside_down_face: google it).

PS: In the current state the component logs in automatically so no need to mess up with charles anymore. Also, keep an eye on the project I’m still tweaking it and the next update will (hopefully) add support for a wider range of devices with multiple switches.

2 Likes

Also confirm that works with original firmware that already updated. I have v1.6 and 2.6 both ori version works great and can be seen and used in HA.

1 Like

Yup have been using with Sonoff Basic, works great.
Eagerly waiting for the update that adds support for multiple channel devices. :slight_smile:
Wish I knew python, still messing around to see if I can be useful. :slight_smile:

The man @peterbuga deserves a beer!
Why not set up a Patreon page for yourself or something man?

Just added a generic 3-gang touch switch as well, works perfectly.
Will update with the device name as soon as I find out. :slight_smile:

1 Like

Excuse me for my ignorance and the OT question, but what is Charles?

Charles is the app that listen and log your internet access which will show the api host and bearer token when you login with ewelink app. Now don’t need it anymore because of sonoff.py

Charles is basically an app to read http traffic going in and out of the computer.

You won’t require it for this to work.
This was required for the other implementations of ewelink on nodejs

@peterbuga did a great job making that process really easy

Further request for this. Hope it support Sonoff S31 soon and also possible to add these switches to homekit component.
Thank you very much.

With update to new sonoff.py there is showing this in info

Sun Dec 02 2018 16:32:26 GMT+0700 (Indochina Time)

found new region: >>> `as` <<< (you should change api_region option to this value in configuration.yaml)4:32 PM custom_components/sonoff.py (WARNING)

My setting is

sonoff:
  email: myemail
  password: mypassword
  scan_interval: 60
  grace_period: 600

Got the answer now.
I found already. There is new login api region for asia is ‘as’ instead of ‘cn’

feel free to follow these quick steps :wink:

regarding the log message, read the project’s description regarding api_region setting. strangely, there’s no mention anywhere of as value in the eWelink source code app. do you live in Australia?