Sonoff /eWeLink component for original firmware

I also have problems with Sonoff POW R2 after upgrade to firmware 3.3.0.

But I don’t think that this is only connected to home assistant. So what I have noticed:

  • Sonoff POW R2 no longer report Voltage when turned off
  • reporting Power and Current is wierldy slow (in standar Ewelink app), many times, when I turn on with device connected power is no, Voltage showse proper value, but Power and Current values are 0 (it can take couple minutes to show proper values)
  • in home assistant (using your component) state changes even slower, it takes even more then 20 minutes to change state. But not always. It varies.

I need to find a way to downgrade firmware, because now it is unusable in term of sensors (and thats why I wanted to have POW not standare Sonoff basic) :frowning:

@rmilani try to use a 2nd account and share specific devices to be able to test/use HA + ewelink app in the same time (it’s described on project’s page)

@pawelmb as far as i know you cannot downgrade unless you previously dumped and saved a particular firmware of a device. i dabbled above in the thread with the idea that that there might be a possibility to restore a device with a current firmware available (for example if you did tasmota on it) but i’m not aware of a downgrade/download of an older fw (please let me know if you find something about it, i’m interested!)

i would like to throw a theory in the wild, that I (aka the component) might be responsible for this possible change in update reporting :sweat_smile:.
just imagine, the websockets were supposed to be open only by the mobile apps, and while there are 1mil+ of installs/usages I hardly believe someone kept an app open more than 5min (maaaaybe 10 mins) and now there are probably a few thousands of component installs or forked versions that are using the websockets and are online 24/7. this might’ve create a real problem on their servers and they probably started to “sacrifice” what was not completely essential => they might store/capture the data but they are not broadcasting it back on websocket, instead they opted for a polling style update on the app (again, just a hunch based on above reporting).
i’m unable to test it right now, so i guess we’ll just have to wait and see.

ps: truth be told I’m really surprised they didn’t block the non-app logins yet, i guess someone there had a huge :man_facepalming: when they realized it’s bad practice to hard code an API key in the app

Peter! :sunglasses:
Sharing Sonoff components to a secondary login used by HA works without troubles: all original switches / sensors activable / readable without lags!

However, it’s necessary to keep eWeLink app as background task on mobile phone (avoiding logout) to make HA able to receive sensor change states.
So, you again are in right!
Seems that Sonoff implemented a check to see if a their app is really connected, otherwise don’t shares event change status! (and reasons of that are clear (AWS costs)!).

Now I left eWeLink app in background on my phone and I’ll check in next hours if HA will continue to receive change status events (as I think).

Thank you! :smiley:
(Hope this talk will be useful for HA & Sonoff users)

1 Like

Hi,

I can confirm that with firmware 3.3.0 some problem occurs. The state on/off is no more available for my pow R2 but at least voltage, amperage et power are here.

Ok everything is fine now … I had to manually activate the buttons on the appz to be available after in HA

I did a new check of “all things”…

  1. After eWeLink app new release installation, each POW R2 switch is automatically set in “LAN mode”
  2. Sharing switches and sensors to other accont and using this one inside HA seems an apparent “good job”, but after app (app use original Sonoff account, HA using sharing account) is closed on my phone, all stops and no more frequently refreshed change state events will come

So:
I start with disable on each switch the “LAN mode” and keep eWeLink app with original account on an old phone.
I aware it’s a work around.

Now I’m going to monitor HA change state events keeping eWeLink app closed (in an half of hour I’ll be able to give a response to that).

I’ll find out if the issue is the “LAN mode” applied on switches within new firmware release (3.3.0), otherwise some other unpredicted changes occurred about Sonoff devices exchange infos with AWS service.

— INTEGRATION —
Bad news:
(more than 25 minutes occured) eWeLink app needs to be open to receive change status events inside HA! :frowning_face:
So, really, seems Sonoff sensors (POW R2 with 3.3.0 firmware) doesn’t send change status events to AWS service unless eWeLink app is open… (POW and TH16 works as expected, instead)

@peterbuga Your theory seems possible. From my observation it could be as follows: they have noticed much bigger traffic and costs, they have decided to limit trafiic with new firmware (3.3.0) and unfortunately they have done it poorly - even to standard app, update of values seems to have troubles, not only me.
I’ve found the same on official forum, like:
https://support.itead.cc/support/discussions/topics/11000027580
or
https://support.itead.cc/support/discussions/topics/11000027570
all connected with standard official app, so it seams that there is a bug in new firmware.

For now, only thing that I’ve found on downgrading is:


but it requires [FTDI USB To TTL 3.3V & 5.5V Serial Adapter + Cable] which I don’t have. So still looking for some OTA way to do this.

Maybe if I find time, I’ll try to skip ewelink servers and try it locally:

@rmilani pow R2 with 3.3.0 is working flawlessly for you? For me it sometimes works and sometimes not updating Power and Current values :frowning:

@peterbuga I’m even not sure if now orginal app is showing real data of voltage. Here is history of couple last days of voltage, logged from home assistant, but you can see, that:

1 Like

As you can see in the image, before and after I left eWeLink app open on an old iPhone 4S.

I’m monitoring home energy consumption (in kWh) by an integration sensor, so I need a refresh rate of POW R2 power level lower than a minute to avoid seriously underestimated values.

I will do so until better solutions are found.

@peterbuga I found:
sonoff-lan-mode-homeassistant
and
Control Sonoff devices running original firmware, in LAN mode

But:
a) Seems that only 192.168.0.0/24 network are enabled (however I think this is a minor problem: configuration will enable for instance a 10.0.0.0/24 network)
b) No implementation concerns sensors, but only switches (more problematic, I suppose)

Do you think in future is possible to extend “LAN mode” concepts inside your “HASS-sonoff-ewelink component”?

— INTEGRATION —
I’m sad… :frowning_face:
My “work around” doesn’t works for long time… After about an hour (sometime less), eWeLink app on my phone, tells “no connection found” and needs to be refreshed to switch in “online mode”.

@rmilani thanks for the results, it is indeed a :poop: situation. i am aware of the sonoff lan mode options (and i keep a close eye on the updates) but as I already mentioned here it’s not going to happen anytime soon.

also, judging by the forum support links posted by @pawelmb looks like this might be an extended problem and i’ll wait it out and see if they fix something anytime soon before I jump the gun and start finding workarounds (it’s not like I have an option anyway, no further updates on the component till at least end of August)

FWIW, I’m also seeing the same issues with my Sonoff POW R2 with the new 3.3 update.

I am not seeing the data update correctly within the eWeLink app, like rmilani mentioned, so I would agree with peterbuga to hold tight to see if a new update comes down soon.

fingers crossed.

The master branch quit working with my sonoff minis. They would only stay available for a few seconds after power up using Hassio. I switched to the websocket branch which works well. The sonoffs are not showing in the entity registry though. They can be controlled from states or when added to the UI.

Thank you, Peter! :slightly_smiling_face:
Ok! No problem if HASS-sonoff-ewelink updates needs time! :wink:
May be Sonoff remedies soon the disservice (many users are complaining) :sweat_smile:

Finally same here … no more power,voltage,current updates for my pow R2 :frowning: …why I flashed to 3.3 … :frowning: :frowning: :frowning:

Hi!!!
Finally I made what you asked me to do and I posted on github.

Just to refresh, my first post:
"First of all, sorry about my english (ain’t my native language).
I bought a generic (aliexpress) dimmer switch. It works perfectly on ewelink app.

On HA (hassio), just shows on off (switch) without dimmer, at least I couldn’t find these entities. In “services” just appear the switch’s entity (switch.sonoff_xxxxxxxxx).

Did you find any advanced user to follow you up on this question (I’m a newbie one)? How can I make my self useful to this task? I promiss that I’ll respond ASAP.

Running:
RPI 3B
Hassio HassOS 1.13
HA 0.94.4"

Original message on the github site:

Hi! I made a persistant notification debug and the results are these:

Steps that I did:
1 - ewelink app turn on switch (brightness 50 by default)
2 - ewelink app set brightness to 20 (not exactly this value)
3 - ewelink app set brightness to 0
4 - ewelink app set brightness to 30 (not exactly this value)
5 - ewelink app set brightness to 60 (not exactly this value)
6 - ewelink app set brightness to 90 (not exactly this value)
7 - ewelink app set brightness to 100
8 - ewelink app set brightness to 50 (not exactly this value)
9 - one touch on physical button (I think it was the lower brightness button)
10 - one touch on physical button (I think it was the bigger brightness button)
11 - three fast touches on physical button (I think it was lower button)
12 - three fast touches on physical button (I think it was bigger button)

OBS: There are some sonoffs, the dimmer is switch.sonoff_1000437aef.

That’s the debug persistant notification:

------------COPY-FROM-HERE--------------

2019-08-07 20:38:14.016 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "params": {"bright": 30}, "sequence": "1565221235087", "tempRec": "1000437aef", "ts": 0, "userAgent": "app"}

2019-08-07 20:38:14.703 [s] {"entity_id": "switch.sonoff_1000437aef", "outlet": null, "state": "on"}

2019-08-07 20:38:14.704 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "from": "device", "params": {"bright": 30, "switch": "on"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:38:31.013 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "params": {"bright": 10}, "sequence": "1565221252110", "tempRec": "1000437aef", "ts": 0, "userAgent": "app"}

2019-08-07 20:38:31.702 [s] {"entity_id": "switch.sonoff_1000437aef", "outlet": null, "state": "on"}

2019-08-07 20:38:31.703 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "from": "device", "params": {"bright": 10, "switch": "on"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:38:53.895 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "params": {"bright": 38}, "sequence": "1565221275070", "tempRec": "1000437aef", "ts": 0, "userAgent": "app"}

2019-08-07 20:38:54.607 [s] {"entity_id": "switch.sonoff_1000437aef", "outlet": null, "state": "on"}

2019-08-07 20:38:54.609 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "from": "device", "params": {"bright": 38, "switch": "on"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:39:12.013 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "params": {"bright": 67}, "sequence": "1565221293126", "tempRec": "1000437aef", "ts": 0, "userAgent": "app"}

2019-08-07 20:39:12.708 [s] {"entity_id": "switch.sonoff_1000437aef", "outlet": null, "state": "on"}

2019-08-07 20:39:12.710 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "from": "device", "params": {"bright": 67, "switch": "on"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:39:27.410 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "params": {"bright": 85}, "sequence": "1565221308684", "tempRec": "1000437aef", "ts": 0, "userAgent": "app"}

2019-08-07 20:39:28.957 [s] {"entity_id": "switch.sonoff_1000437aef", "outlet": null, "state": "on"}

2019-08-07 20:39:28.958 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "from": "device", "params": {"bright": 85, "switch": "on"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:39:30.207 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "from": "device", "params": {"fwVersion": "2.0.2", "rssi": -58, "staMac": "xx:xx:xx:xx:xx:xx"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:39:50.714 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "params": {"bright": 100}, "sequence": "1565221331828", "tempRec": "1000437aef", "ts": 0, "userAgent": "app"}

2019-08-07 20:39:51.409 [s] {"entity_id": "switch.sonoff_1000437aef", "outlet": null, "state": "on"}

2019-08-07 20:39:51.411 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "from": "device", "params": {"bright": 100, "switch": "on"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:40:03.135 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000236d45", "from": "device", "params": {"rssi": -39}, "ts": 0, "userAgent": "device"}

2019-08-07 20:40:07.917 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "params": {"bright": 56}, "sequence": "1565221349082", "tempRec": "1000437aef", "ts": 0, "userAgent": "app"}

2019-08-07 20:40:08.622 [s] {"entity_id": "switch.sonoff_1000437aef", "outlet": null, "state": "on"}

2019-08-07 20:40:08.624 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "from": "device", "params": {"bright": 56, "switch": "on"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:41:40.934 [S] {"entity_id": "1000437aef", "new_state": "off", "outlet": null}

2019-08-07 20:41:41.603 [W] {"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "error": 0, "sequence": "1565221300927625"}

2019-08-07 20:41:42.334 [s] {"entity_id": "switch.sonoff_1000437aef", "outlet": null, "state": "off"}

2019-08-07 20:41:42.335 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000437aef", "from": "device", "params": {"bright": 56, "switch": "off"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:41:47.934 [s] {"entity_id": "switch.sonoff_1000236d45", "outlet": null, "state": "off"}

2019-08-07 20:41:47.935 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000236d45", "from": "device", "params": {"switch": "off"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:42:53.424 [s] {"entity_id": "switch.sonoff_1000236d45", "outlet": null, "state": "on"}

2019-08-07 20:42:53.425 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000236d45", "from": "device", "params": {"switch": "on"}, "ts": 0, "userAgent": "device"}

2019-08-07 20:43:03.145 [W] {"action": "update", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "deviceid": "1000236d45", "from": "device", "params": {"rssi": -42}, "ts": 0, "userAgent": "device"}

---------------END-OF-COPY----------------

Thank you!

I have problem with 0.97.1 custom component is not good can anyone help me?

Hi @peterbuga
about Sonoff POW R2 , even if you downgrade to ver 2.8.0 like I did it will not work .
how-to-backup-restore-official-firmware-on-any-espressif-esp8266-esp32
I think they are keeping our information on the server { Country, ID 1000643xxx, Name, Pass…}
The only way I found to let it work was by using a fake location GPS (mobile rooted), and changing my Country plus a New subscription .

Not with that level of information. See How to help us help you - or How to ask a good question

as far as i know ewelink doesn’t require any location services (i do all my debugging on ios) and one can easily change the so-called originating country simply by using a proxy. i think what you’re mentioning is the server-side stored data on various chunks on their side, the problems above we’re related to the instant reporting part that’s not working anymore as it has been mentioned.
please give more details of what you achieved, i’m in the same boat as @nickrout

@Fernando_Donan thanks for dumps, very useful!

nickrout was replying to @Hdjweb .

I am using Android and to Register you must enter your Country .
after that to add your first Sonoff device they ask you to turn on your GPS .

they are trying to do like NOKIA did before, you can only upgrade but not downgrade FW.


if you remember our old discussion

waiting for someone who can crack there FW.