Sonoff S20 WiFi Smart Socket

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: Sonoff S20 WiFi Smart Socket

Post by kevinkk525 » Sat Dec 07, 2019 2:06 pm

Looks good!
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

jedie
Posts: 252
Joined: Fri Jan 29, 2016 12:32 pm
Contact:

Re: Sonoff S20 WiFi Smart Socket

Post by jedie » Sat Dec 07, 2019 8:17 pm

Now i add a new feature: checkboxes for each day of the week where timers are active
Screenshot_2019-12-07 Sonoff S20.png
Screenshot_2019-12-07 Sonoff S20.png (8.1 KiB) Viewed 6548 times
But currently i store the selected days only in RTC RAM... (The timers stored as a json file in filesystem)
So next thing is to store the days in filesystem, too.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Sonoff S20 WiFi Smart Socket

Post by pythoncoder » Sun Dec 08, 2019 7:24 am

Very nice work.

Sonoff products seem finally to have come of age. I spent a lot of time on the Sonoff Basic in-line switch. This has gone through three hardware redesigns. Unlike the R1 and R2 units, the new R3 units actually work reliably with decent wireless range. I gather from @kevinkk525 that the S20 is good, too. These things have a lot of potential MicroPython applications and are very hacker-friendly.
Peter Hinch
Index to my micropython libraries.

jedie
Posts: 252
Joined: Fri Jan 29, 2016 12:32 pm
Contact:

Re: Sonoff S20 WiFi Smart Socket

Post by jedie » Sat Dec 14, 2019 11:02 am

v0.8.1 is out...

New:
  • handles time zones: User can set his timezone via web page (pre filled via JavaScript). All times are converted from UTC to his local time.
  • A Device name can be saved via web page, and will be displayed on every page. Helpfull if you have more than one device. In the screenshots the same saved to test-esp8233
  • many bug fixes
Current screenshots:

Image


Image


Image


Image


Image

jedie
Posts: 252
Joined: Fri Jan 29, 2016 12:32 pm
Contact:

Re: Sonoff S20 WiFi Smart Socket

Post by jedie » Mon Dec 16, 2019 5:00 pm

v0.9.0 is available :D

I've refactor the timer schedule. This makes the functionality much more robust and reliable.

From the README:
The Device always tries to turn the power ON/OFF based on the current timer. Even after a power failure. However, this only works correctly if the current time is set correctly by the RTC. The current time is automatically retrieved from the Internet via NTP sync. At boot and also repeated after start. Of course, this can only work if the device is connected to the Internet via WiFi ;)

You can "overwrite" the current timer at any time by pressing the button on the device. This overwrite will stay until the next timer. After a power failure the "overwrite" information is deleted and the timer regulates the power again.
However, it is still the situation that now and then the RAM is not sufficient. But I already have an idea what I can optimize.

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: Sonoff S20 WiFi Smart Socket

Post by kevinkk525 » Mon Dec 16, 2019 10:03 pm

Are you already using littlefs? That would free 4kb of RAM
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: Sonoff S20 WiFi Smart Socket

Post by mattyt » Tue Dec 17, 2019 3:31 am

MicroPython v1.12 is expected to be released within a few days and it'll have littlefs built-in...



Post Reply