2020-03-18 15:16:11 -04:00
2020-03-01 16:53:37 -05:00
2020-03-01 16:56:07 -05:00
2020-04-01 13:43:35 -04:00
2020-03-19 10:39:59 -04:00
2020-03-19 10:39:59 -04:00
2020-03-19 10:42:25 -04:00
2020-03-01 22:37:02 -05:00
2020-03-07 11:21:30 -05:00

Sonoff Smart Plug (S31) Heater Controller [Or exhaust fan controller.]

This sketch is used on a Sonoff S31 Smart Plug connected to a "dumb" heater with a mechanical thermostat. Using this will allow electronic temperature control without having to modify the heater itself. The mechanical thermostat remains functioning and can be set higher that the desired range to act as a sort of safety.

As off version 2, an inverse mode has been added. This allows controlling the switch when the temperature (or humidity) is above the set desired value. (This is untested as I do not currently have no need of this feature.)

Warning

As this deals with a heater, there are still certain dangers. By using this software, you are taking full responsibility and liability for anything that goes wrong. Any damage, injury, or death are solely you responsibility and I take none. You must feel confident in your hardware and software before using this. I would recommend only using your heater on a low setting below 75% of the smart switches capacity.

Requirements

As you can not install sensors onto the S31 (which wouldn't be in a good position for temperature anyway) you must use an external device to send the temperature to the switch. This can be any device with a sensor that is also connected to the Blynk server. The temperature information is sent via the Bridge feature in Blynk.

Features

  • Temperature Control (Duh)
  • Temperature Offset: Allows the temperature to drop a set amount before turning on.
  • Anti Short Cycle: Require a minimum "cooldown" before restarting the heater.
  • Overide Control; The ability to control the relay directly.
  • Amperage, Wattage, and Voltage Display

To Do

  • Fix KwH display to show the correct amount.
  • Add a way to save historical KwH usage.
  • Find a use case for the hardware button.
  • Possibly add MQTT support.

Credits

The code reading the power monitoring chip and other functions is from the below link and authored by James Eli.
https://ucexperiment.wordpress.com/2019/01/20/using-a-sonoff-s31-with-blynk/
I used it as a base and added in the features that I needed.

Blynk App

Override is purposefully misspelled to fit the button width.
S
Description
Sonoff S31 Heater Controller
Readme
1.1 MiB
Languages
C 69.7%
C++ 30.3%