incorrect voltage on a Sonoff S31

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
dbemowsk
Normal user
Posts: 46
Joined: 06 Aug 2017, 22:27

incorrect voltage on a Sonoff S31

#1 Post by dbemowsk » 10 Aug 2023, 23:45

So I just flashed a Sonoff S31 with ESP Easy. When I initally configured the CSE7766 power monitor and was checking the values returned, it was showing around 119 volts. Now the voltage being shown is over 900 volts. Do I have something configured wrong that it is showing that high of a value for voltage??

Image

Image

Let me know if there is any other infformation you need from me to figure this out.

Thanks

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: incorrect voltage on a Sonoff S31

#2 Post by TD-er » 11 Aug 2023, 01:09

Can you clear the U ref, I ref and P ref fields and save?
This will load the calibration values again from the chip.

If the values are still the same, you need to perform a calibration of that unit as the board you have is probably not using the same resistor values as mentioned in the datasheet of the CSE7766.
The calibration values are from the manufacturer of the chip and based on the resistor values mentioned in the datasheet.
Is Sonoff decided to use different values, the readings may be off quite a lot.

What build are you using?
I have spent quite a lot of work on that plugin in the past few weeks, so if you use one of the latest GitHub Actions builds, you will use the latest code for that plugin.

If you need to open up the unit to upload a new version (e.g. when it is using a 1M flash chip), please have a good look at the resistors connected to mains voltage pins, to see if some got damaged and thus offsetting the measured voltages.

dbemowsk
Normal user
Posts: 46
Joined: 06 Aug 2017, 22:27

Re: incorrect voltage on a Sonoff S31

#3 Post by dbemowsk » 11 Aug 2023, 01:48

Ok, so I cleared those values and saved. This is the values it showed immediately after the save.
Image

After I close out to the devices list and go back to editing the device again, the U Ref stays the same, but the I Ref and P Ref change.
Image

This is what I see though after the U, I and P Ref numbers were updated. Not sure how they changed in the first place, because when I first got this configured, it was showing a voltage of 119 volts or there about, which I thought was fairly normal. I diddn't look to see what those values were after the initial install, but they clearly had to have changed.
Image

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: incorrect voltage on a Sonoff S31

#4 Post by TD-er » 11 Aug 2023, 15:06

Those '1950' etc. values are the 'defaults' I use in the plugin.
When the plugin is initialized and it finds the defaults, it will read them from the chip itself.

Maybe it is best to save it once more, now the calibrated values are read from the chip, to make sure it isn't the same as those "default" values.
Then it won't read the calibrated values again.

My theory is that it perhaps did read the wrong values, or values to mixed up with data still in the buffer from the serial port at boot.

dbemowsk
Normal user
Posts: 46
Joined: 06 Aug 2017, 22:27

Re: incorrect voltage on a Sonoff S31

#5 Post by dbemowsk » 12 Aug 2023, 17:24

OK, so it appears that the U Ref value keeps changing every so often. You can see here that it is now a negative number. The other numbers stay constant as the I Ref sand P Ref at 16345 and 5362 respectively have not changed from the last screenshots I sent. Only the U Ref has changed.
Image

You mentioned the 1950 values are ones that you put in initially. When I clear the U Ref value, it reverts to the 1950 value and gives me what looks to be a fairly normal reading. It appears to keep that value for a number of hours. I check it at random times and i'll see that all of a sudden the number has changed. Is there a way for me to do a calibration and write the new values to that chip myself?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: incorrect voltage on a Sonoff S31

#6 Post by TD-er » 12 Aug 2023, 18:12

You can call the calibration command for that plugin.
See: https://espeasy.readthedocs.io/en/lates ... -available

dbemowsk
Normal user
Posts: 46
Joined: 06 Aug 2017, 22:27

Re: incorrect voltage on a Sonoff S31

#7 Post by dbemowsk » 12 Aug 2023, 18:31

Thank you. I will look that over and figure it out. Any ideas on a good resistive load to use?

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: incorrect voltage on a Sonoff S31

#8 Post by TD-er » 12 Aug 2023, 20:05

An old fashioned light bulb as it also lists a power rating.
Otherwise some soldering iron which is working on mains voltage (not one with a transformer)

dbemowsk
Normal user
Posts: 46
Joined: 06 Aug 2017, 22:27

Re: incorrect voltage on a Sonoff S31

#9 Post by dbemowsk » 12 Aug 2023, 23:55

So would I call it like this:

V=voltage
I=current
P=power

http://[IP_of_unit]/control?cmd=secalibrate,V,I,P

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: incorrect voltage on a Sonoff S31

#10 Post by TD-er » 13 Aug 2023, 00:31

But then with the correct order of letters in the command name :)

For 234.5 Volt, 1.5 A:

Code: Select all

csecalibrate,234.5,1.5
N.B. the parameter separator is a comma (,) and the decimal separator is a dot (.)

dbemowsk
Normal user
Posts: 46
Joined: 06 Aug 2017, 22:27

Re: incorrect voltage on a Sonoff S31

#11 Post by dbemowsk » 13 Aug 2023, 05:44

You had asked earlier what build I was running.
Image

User avatar
Ath
Normal user
Posts: 3521
Joined: 10 Jun 2018, 12:06
Location: NL

Re: incorrect voltage on a Sonoff S31

#12 Post by Ath » 13 Aug 2023, 09:47

That is a not so up-to-date build, please get a very recent build from here: (see below)
Or by disconnecting from mains power, and hooking up to USB-serial and flash from Chrome or Edge using the Web-flasher: https://TD-er.nl/ESPEasy/latest

Edit: removed link
Last edited by Ath on 13 Aug 2023, 12:48, edited 1 time in total.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: incorrect voltage on a Sonoff S31

#13 Post by TD-er » 13 Aug 2023, 10:49

With one side note....
In that build, linked by Ton, there was still a bug for exactly this plugin you're using.
So please use this build: https://github.com/letscontrolit/ESPEas ... 5834419140

I will merge that PR and also update the web flasher, but that may take me some time....

Post Reply

Who is online

Users browsing this forum: No registered users and 43 guests