Sonoff S31 watts not updating unless eWeLink app is open

AlexxIT/SonoffLAN is how I am utilizing my S31s also… I watched a youtube video quite awhile back, and actually made my decision to buy the S31s based on the ease of setup vs the flashing route. I saw the Sonoff integration in Devices and Services and thought I was using some kind of regular integration, but in deed I see it is in HACS now and shows up as AlexxIT/SonoffLAN Custom Component. But I can completely disconnect from the Internet and everything still works (this has been a design goal from the start of my HA journey, because I plan to give the RPi4 away with the sale of my house. That is why I am trying to keep it very simple.), so I have no idea how it is even working now.

I had to use Homekit hashes for a couple other integrations, but other than that I can not recall ever having to provide authentication for the S31s outside of the ewelink app. Once I configured them, I installed the Integration and I believe HA just found them and I added them to a card during the install.

Another odd thing I did not realize is that I do not even know how to find the version number of the integrations I am running, so I have no idea what I am running outside of the basic HA info in About…

Home Assistant 2023.8.4
Supervisor 2023.08.1
Operating System 10.5
Frontend 20230802.1 - latest

I am only running 11 integrations, and I literally have 6 lines of actual config in my configuration.yaml:

# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

my secrets.yaml file is empty with a couple comment lines explaining what the file is. And I created a single script that does a quick run of my sprinkler zones from an automation that fires at sunset if the high temperature was above 90F for 10 minutes at anytime during the day. Everything has been configured from the UI though. I have looked at the yaml from time-to-time and figured out how to customized a few gauge colors, I just don’t use it because I do not know the syntax well enough to trust myself. HA is pretty much a universal remote for my house on an iPad. Pretty much just “Smart Home Ready” eye candy for a buyer when I sell.

I do plan to take some of the devices with me, as well as the knowledge I can learn in the process on to the next house, and I have much bigger plans for the Energy piece then. Right now, I am trying to figure out which appliances I am keeping, and if I can balance my breaker panel across phases better… the S31s are coming in handy for that, so I want the history graphs back. :wink:

I appreciate your sharing though. If you have any other thoughts I am interested. I am going to continue to look through the directory structure when I have time and see if I can glean anything else with my limited knowledge of the underlying system.

Thanks again.

I did some nosing around in the file system and found the manifest.json file for SonoffLAN. Looks like I am running “version”: “3.5.2”, with pycryptodome>=3.6.6 as a dependancy.

I found the firmware version of the S31s in the eWelink app. They are all running 3.5.0 firmware (3.6.0 is available) with LAN control turned on.

I am tempted to upgrade the firmware, but eWelink just upgraded their app, and I do not want to take a chance of the new firmware locking me in to using only their app. I haven’t decided if I want to sacrifice one of my S31s to test, or just buy a couple more. I hesitate to do either though, because I understand I have to delete a file and have it redownload the device info from the cloud, and then restart HA. Plus the devices were not the easiest to even pair with the stupid app as I recall. I don’t have time to read and play right now, but I will try to get a backup of my system sometime this weekend, and maybe I will find some time to play. :crossed_fingers:

@k8gg it is really weird, because I can not find where I am authenticating with anything. How is this working? lol
I have a Shelly 1 that apparently is having an issue since the update too. I just noticed I have a Repair notice… It is complaining about “Push update Failure” even though I have CoIoT set, and that functioned for months without complaining before the update.
I am going to purchase a couple more S31s, and hope they have the new firmware already installed. I am going to backup the SD card tomorrow afternoon, and then see if I can add the new S31s to HA, and see if the firmware makes a difference.

UPDATE:

I added the following to my configuration.yaml:

sonoff:
  username: !secret sonoff_usr
  password: !secret sonoff_pwd
  mode: local
  reload: always  # update device list every time HA starts
  #default_class: light  # (optional) to set the class, default class being switch
  force_update: [power]
  scan_interval: 300  # this is in seconds; so every 5 minutes
  sensors: [power]

and obviously made the additions in my secrets.yaml

2 new smart plugs are using firmware 3.6.0. It was the usual pain to pair them, but they finally do work both in the eWelink app, and in HA. However, they are significantly slower to respond than my 12 original S31s running firmware 3.5.0.

using the eWelink app it takes almost 15 seconds to respond. my original S31s take about 1 second.

HA takes about 2 seconds with the new S31s, but my original S31s are instantaneous (I would say milliseconds). Very disappointing!

AND the same symptoms with the power monitoring. If the eWelink app is not open I just get a flat line of the last state it saw when the app was open. Turning it off and on works, but the amps and watts do not change in developer tools or history.

One thing I noticed is that if I remove all the yaml I added, it now reports 0A 0W when the device is on, and when I turn the device off it will report the last known state. very weird. It happens on old and new S31s. This was not the case prior to adding the yaml. I have not tried to pop the clone I made of my SD card in yet, but the core is now 2 versions back. I keep hoping the newer versions will somehow magically fix the issue. :persevere:

I am in the middle of house repairs, so time is a commodity, but I will play more when I get a chance. Let me know if you have any thoughts.

I ended up sending the new S31s back. I am wondering if I received counterfeit units… the MAC addresses had a totally different prefix and even with the firmware update I could not resolve the lag in HA or the eWelink app. Oddly, the power readings started working again in HA, until I removed the units I sent back, and reloaded the integration. :persevere:

After doing some research I found this issues post, and it looks like there is a v2 API that maybe the culprit: https://github.com/AlexxIT/SonoffLAN/issues/1219#issuecomment-1705530160 and if this issue persists, it is likely there is a fix, but it appears it may require a reinstall with a new API Key or at least copying the new files and editing the YAML.

ADDITIONAL UPDATE: After the last Core Update, and subsequent HACS update, I noticed the original S31s are reporting Amps, Watts, and Voltage again. I have not intentionally changed anything with the SonoffLAN Integration, so I am not sure what made it start working again, but it has been working since the 2023.9.3 update. :crossed_fingers:

I think I have similar issue with S31. I have to open the eWeLink to get power and current updates. However, I found it was resolve after I restart my HA. I want to get everything from LAN. so I select local in sonoff LAN then it cannot be updated again. Do you have any solutions?

Fought this battle for some time. Gave up and flashed all my Sonoffs with ESPHome. Never looked back! :slight_smile:

omg this is my issue also what the hell happened on this past updates now it wont even update… sometimes it does sometimes it doesnt

1 Like

In case this helps anyone: I’ve just run into this and it’s been driving me crazy for over a week. Every time I open the eWeLink integration and refresh a plug, it updates, but just that one time. I have a number of automations based on current consumption, so this has been frustrating, to say the least. Someone on this thread said something about opening the eWeLink app, which I haven’t done in quite a while. So I did. I was greeted with a message that my session had expired. I re-logged in, and now everything is working normally again. I suggest opening the eWeLink app, logging out, then logging in again.
Good luck!
*Update: that didn’t last.
Uninstalled the Sonoff Add-On and deleted all plugs from HA.
Installed Sonoff LAN via HACS, as suggested above.
Restared HA, and Sonoff LAN immediately discovered all plugs on the network. No Add-On required.
Reconfigured and renamed all entities to what they were before and everything is back to normal.
Hope this helps someone.

Anyone experiencing that issue lately? I have like 20 POWs R2 and 5 of them stopped updating themselves yesterday. Opening ewelink on phone refreshes them as long as app is running. I close it and within 30 seconds power reading for those 5 freezes again. Other 15 works like a charm. Restarted HA and whole network, didnt help.

Same here.

How do you guys (I mean Gutek and porfka1) connect the S31 to HA? I am connecting to S31 locally as mentioned above, and (after setting it up) block the S31 completely from internet, and didn’t see the issue (yet).

Trying to see whether I should be concerned that mine would stop updating.

Edit:
My HACS “Sonoff LAN” integration is at version 3.9.3
My S31 is at stock firmware 3.5.0

Hmm… any one know of the change logs of the S31 firmware between versions? From the link below (thanks loadwizzard) I can tell 3.7.0 firmware is for DST config, but what else? What about 3.6.0?

I’m on firmware version 3.7.0 for my S31s. My HACS Sonoff Integration is version 3.9.2 currently. I’m not see issues current. I do have the eWeLink addon loaded and running version 1.4.6 no auto update. Maybe update the firmware on the S31 to 3.7.0 you can always revert back if needed.

version 3.7.0 has the fix for DST transition too

Looks like the S31 now have 3.7.1 firmware available, trying to find out what changes are in it.

Updated all my s31’s to 3.7.1 via the eWeLink addon. Then reloaded the HACs SonoffLAN to pickup the new version software to confirm 3.7.1 wait for the power Energy to respond to the eWeLink cloud for the power reading. All good so far.

Also started having this problem. Seems like it started right when I upgraded to 2026.1.1. I haven’t tried downgrading back to 2026.1.0, but it seemed to be working fine then.

I JUST now updated to 2026.1.2…will see if that makes any difference, though I don’t see anything in the release notes that would be related.

Also wanted to note that I was on firmware 3.7.0 when the issue started happening. Updating to 3.7.1 has not helped.

I would suggest DO NOT UPDATE to FW 3.7.X AT ALL!!!
My current and power are not reporting till the plug cycles to off. Those plugs that are left on for just monitoring consumption do not report at all.

Looks like either flashing (hoping to find one that doesn’t use MQTT which is a FPIA, wasted 2 days on eWeLink new addon which requires MQTT and got no where with setting up devices or moving to another smart plug vendor like Shelly

Mine had been working great for many months on 3.7.0, so I’m not sure that’s related.

Where is it working great? SonoffLAN by AlexIT problem without of sync data or no data, eWeLink phone app? There is no problem there. The old eWeLink HA addon? No problem there. New eWeLink addon, can’t tell beause I’ve wasted 2 days with not even to be able to get devices to add correctly, stay available or report or turn on/off.

Mine had been working great for years with SonoffLAN off of HACS.

Same issue observed with Sonoff POWR3, not updating anything until I open ewelink app or web page.
Tried everything, uninstall, reinstall, logout/login, etc.
I have some automations based on consumption and this issue maker everithing useless…

There is a big thread on github regarding this issue, for me what it worked it is this solution (I understand that it is reccomended for test only.