-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Sonoff S31 with energy monitoring #1626
Comments
Will be implemented once I receive mine. |
It is ESP8266ex based. Sonoff-Tasmota runs fine on it. I haven't tried getting the "energy monitoring" working yet, so I don't know what sensor it uses. Here's photos to show how to disassemble it; it's not readily apparent when you get it: |
Looking at the board I see the ChipSea 7766 energy monitoring chip. Seems that it sends energy use via uart: It's connected to the ESP8266 UART0 RX pin via R2 on the board. |
Theo do you have any estimate on when you will receive a S31 and start working on the power features? I can also confirm that your current firmware flashes no problem on S31 although no power measurements. |
The S31 is still in the mail. Once received I have to look at integrating the ChipSea 776 functionality... |
Very nice! |
Cool! I had already ordered my own, glad to test when they arrive. |
5.11.1i * Update TasmotaSerial library to 1.1.0 * Rename commands HlwPCal, HlwUCal and HlwICal to PowerCal, VoltageCal and CurrentCal to be used for both Pow and S31 calibration * Rename commands HlwPSet, HlwUSet and HlwISet to PowerSet, VoltageSet and CurrentSet to be used for both Pow and S31 calibration * Add support for Sonoff S31 Smart Socket with Power Consumption Detection (#1626) * Fix IRReceive Data value (#1663) * Fix compiler warnings (#1774)
Thank you Theo! |
Likely it is my error, but I can not get a successful build: I have verified that the files exist in a subfolder /lib/TasmotaSerial 1.1.0/src What am I doing wrong? |
@Sky1980chs - Repeat the steps for "setting up the Arduino IDE environment" from the Wiki. Recently a new library was introduced and you need to copy it from the source tree /lib folder into the libraries/ folder for your Arduino setup. You should probably copy the others while you're at it in case they've been updated since you first set up Sonoff-Tasmota |
Unfortunately, I saw phreakmonkey comments too late, but had a successful build anyways.
|
Hate to say but if I had the possibility to change all replies where people want to change Flash size from 1M (no SPIFFS) to any non supported value I would be very glad... It's in the wiki, it's in the readme, it's in Theo's tips, it's everywhere but hey without a whip I can't force people to stay on the right path... |
Humm.. I tried flashing using 1M (64K SPIFF) and was not having success. The unit returned unresponsive. I tried several times. I thought since the S31 has 4M flash I needed to increase. When I did the S31 worked. Coincidence? |
As you noticed it worked (once). Chances are the next OTA won't work. So stick to 1M (no SPIFFS) and report any problems on that config only. |
Hopefully this thread will help someone else and save you their questions. As always, I really appreciate your work you do for this community!! |
Sky1980chs -
could be a hint to edit your post above to remove the wrong info about setting 4M/1M, since arendst is regretting that he cannot do it. (Thanks for the other tip and for trying to help others, tho). |
Hint accepted and previous erroneous comments removed to avoid confusion. |
5.12.0 20180209 * Change library PubSubClient.h define MQTT_MAX_PACKET_SIZE from 512 to 1000 for Home Assistant support * Change relation of define MESSZ being dependent on PubSubClient.h define MQTT_MAX_PACKET_SIZE * Change command color parameter input checks to less strict for Home Assistant support * Change command Ina219Mode into command Sensor13 * Change commands HlwPCal, HlwUCal and HlwICal to PowerCal, VoltageCal and CurrentCal to be used for both Pow and S31 calibration * Change commands HlwPSet, HlwUSet and HlwISet to PowerSet, VoltageSet and CurrentSet to be used for both Pow and S31 calibration * Change uptime from hour to second resulting in a display of 123T13:45:21 where 123 is days * Change module name Wemos D1 mini into Generic (#1220) * Change HTML from width=100% to style=width:100% supporting HTML5 (#1358) * Change OSWATCH_RESET_TIME (Blocked loop) from 30 to 120 seconds to allow slow networks (#1556) * Change WIFI_MANAGER_SEC into WIFI_CONFIG_SEC (#1616) * Change function pointers code to save code space and memory (#1683) * Change webserver argument processing gaining 5k code space (#1705) * Change weblog memory usage (#1730, #1793, #1819) * Update TasmotaSerial library to 1.1.0 * Update language files Italian (#1594), Dutch (#1723) and Spanish (#1722) * Fix Non-English JSON temperature unit attachement * Fix Arilux RF induced exception by moving interrupt handler to iram on non ESP8266/Arduino lib v2.3.0 * Fix truncated command names and wrong response for DomoticzSwitchIdx (#1571) * Fix %-sign issue as printf escape character in Humidity and Sonoff SC (#1579) * Fix DS18B20 temperature JSON decimal dot (#1561) * Fix Energy JSON message (#1621) * Fix IRSend parameter translation (#1636) * Fix TSL2561 device detection (#1644, #1825) * Fix BME680 teleperiod resistance measuring (#1647) * Fix Energy Monitoring Energy Today and Energy Total reading after restart (#1648) * Fix IRReceive Data value (#1663) * Fix Energy Monitoring Energy Period roll-over (#1688) * Fix compiler warnings (#1774) * Fix command PWM response if no PWM channel is configured (#1783) * Add locale Decimal Separator to Web sensor page * Add ColorTemperature to light status message * Add command PowerOnState option 5 which inverts PulseTime and allows for delayed always on after power on * Add OtaMagic two step Web server OTA upgrade using filename-minimal image if OTA free space is too small * Add support for PMS5003 and PMS7003 particle concentration sensor * Add command SetOption21 1 to allow Energy Monitoring when power is off on Sonoff Pow and Sonoff S31 (#1420) * Add Chinese language file (#1551) * Add French language file (#1561) * Add Spanish language file (#1589) * Add HTTP Allow Cross Origin removed from ESP8266/Arduino lib v2.4.0 (#1572) * Add Home Assistant MQTT Discovery for switch and light to be enabled by command SetOption19 1 (#1534) or define HOME_ASSISTANT_DISCOVERY_ENABLE in user_config.h (#1685) * Add command State to retrieve device state information (same data as teleperiod state and status 11 in slightly different JSON format) * Add optional login to Webserver AP mode (#1587, #1635) * Add command Sensor15 2 to start MHZ19(B) Zero Point Calibration (#1643) * Add support for Sonoff S31 Smart Socket with Power Consumption Detection (#1626) * Add command SetOption20 to allow update of Dimmer/Color/Ct without turning power on (#1719, #1741) * Add NTP sync time slot based on chip id (#1773) * Add cursor pointer to web button (#1836)
First, thank you! It works great! Second I have a quick question on the S31, will a short teleperiod cause any problems? I'm thinking in the range of 30 to 60 seconds. |
No problem at all. You can go down to 10 seconds. |
What tool did you guys use to flash the S31? Can you use Arduino IDE and the same flash settings as the Sonoff Basic? Any instructions would be helpful. |
@arendst - Thank you Theo, this is great addition! Is there a reason no user configurable GPIOs available for S31? Serials are easy to solder to, but are they used for energy monitoring? Wanted to add temp/humidity sensor to this little nice device. Anyone discovered other GPOIs available on-board w/out soldering directly to the chip? |
First, serial is used to communicate with the energy chip. |
Thank you Theo, good point re mains and gnd. |
Well, the S31 that was really acting up just stopped working completely. It powers up and connects to wifi when connected with the serial port, but no wifi or LEDs when under it's own power. Any ideas to try and get it working again? |
@asmugala did you happen to fix it yet? Having the same "warning: espcomm_sync failed" while uploading. |
@gxgani My problem was my pin headers weren't soldered correctly. I removed them and re soldered them and it worked. Make sure you're using pings 1,2 and 5 on the Sonoff. Pins 2 and 3 aren't used. |
@asmugala thanks for getting back. In my case it was the PL2303, was just not able to sync. Then I tried it with CH340G USB TTL, worked like a charm. PS: PL2303 did flash S20 but was not able to flash S31. |
@arendst did you get an EU version of this adapter? Or does the US version work on 220V as well? |
Ok think I found my answer Voltage Input: 90~264V AC, 50/60HZ So probably just need to use US - EU adapter then |
The US version indeed works just fine on 240V using holiday power plugs :-) The new pow R2 uses the same energy monitoring chip as the S31 so I would go for that. |
I still didn't get modules so i can't test it, is energy monitoring implemented? possible to get values through mqtt? |
Ok pow R2 arrived, any suggestions with regards to safety here? Is it ok to build my own socket and wire this thing in? |
I am having trouble flashing at least one Sonoff S31 with the Tasmota 5.13.1 from Arduino IDE.
Now it works. It seems the Sonoff S31 does not like 1M (no SPIFFS) but does flash properly with 4M (1M SPIFFS). I hope this helps someone else. |
S31 needs 1M(no spiffs) fot your next ota upgrade. It also works great on 1M(no spiffs). All you had to do was resetting the settings with command reset 1 to fill a default friendlyname. |
I am looking for information on how to add the power consumption values to Home Assistant. I am new to this, but have my S31 working in HA and I can turn it on and off. I am not sure what yaml commands to use to read the power. Any help? |
Thanks! Got it working now. |
Hi, Seems that your question has been addressed. Closing this issue. Please, reopen if needed. Thanks. |
5.11.1i * Update TasmotaSerial library to 1.1.0 * Rename commands HlwPCal, HlwUCal and HlwICal to PowerCal, VoltageCal and CurrentCal to be used for both Pow and S31 calibration * Rename commands HlwPSet, HlwUSet and HlwISet to PowerSet, VoltageSet and CurrentSet to be used for both Pow and S31 calibration * Add support for Sonoff S31 Smart Socket with Power Consumption Detection (arendst#1626) * Fix IRReceive Data value (arendst#1663) * Fix compiler warnings (arendst#1774)
Hi, I'm not an expert to compile with arduino, so, i can use esptool to upload bin file to Sonoff. So to night, i upload a sonoff.bin files (6.4.1). After that, all works fins but i can't see power information (voltage, current, etc.). Any idea why? |
Forget my last comment. I'm very stupid. I forgot to change Module Type. Now, all works fine. Thanks a lot for all sonoff développement. Richard |
I am reading this thread but more confused. Does this S31 smart switch with energy monitoring have support across dual voltages?
|
It would be great to support the new Sonoff S31 smart plug!
There are a number of cheap wifi controlled outlets for $20 or under, but the S31 is compact (two can fit on one US duplex outlet), supposedly capable of 15A, and most importantly does energy monitoring!
And several sources are offering it for under $17, shipped.
See the last photo on this page: [(https://fccid.io/2AE2J-S31/Internal-Photos/Internal-Photos-3692513)]
I'm guessing that it continues to use the ESP8266 (or ESP8285).
It looks from the FCC registration photo as if there are pads (perhaps thru hole if not filled with solder) for VCC, GND, TX, RX and D_TX, D_RX (whatever the latter are).
The text was updated successfully, but these errors were encountered: