For some time I have been using The smart plug with light sensor, but I wanted to have a version that uses sunrise/sunset time values for the plug output to go ON .
An easy way to do this would be to use a smart plug with the nice open source Tasmota software with timers to use local sunrise / sunset data as trigger points for plug ON/OFF. BUT the Tasmota software requires the wifi connection to stay active for timers to work, and I wanted a version that triggers even if the wifi connection is gone.
I went for the Eightree ET28 plug , that has got the more powerful ESP32-C3 CPU as well as the nice open source Tasmota software. The Eigthree smart plug has the BL0937 power metering chip that provides an signal frequency proportional with the power consumed at the connected load. The ESP32-C3 CPU is pretty much faster CPU than the ESP8266 used in the Sonoff S26 smart plug, and it is needed to cope with large data set array in my home brewed software.
The flash procedure goes on as for the version C of the Smart power strip day timer. My Arduino software solution looks like this: Sunrise-sunset_smart_plug . The smart plug has this small webpage for the configuration:
The plug output can be configured to turn ON between sunrise and sunset ( daytime ) or to turn ON between sunset and sunrise ( nighttime ). The active ON period can extended ( to include more or less of dawn and dusk ) by the “Add ON time” option.
Note, that the values for sunrise/sunset are specially for the geo location ( longitude and latitude ) for our home in Southern Denmark , thus the hard-coded array “sunrise_sunset” in the code must changed to use a specific geo location. I used the webpage https://aa.usno.navy.mil/data/RS_OneYear to get the values for 2024. For the leap years, the sunrise/sunset times are the same, and for the years in between two leap years, the differences are just a few minutes per day. So I am using the values for 2024 only.!