Temperature Control and Monitoring using

Raspberry Pi and TpLink HS110 Smart Plugs and two 3kW Fan Heaters

If you have any queries or comments please email rpi@torrens.xyz

[This week (November 12th) added some logic to only use one heater after a time set in the config.csv file so as to reduce the risk of breakers tripping on overload.   This is now in use as you will see if you look at the log files.  I can send this code on request but I doubt anyione else would need it, we only need it because of the limited nature of our power supply].

The Raspberry Pi Python 3 code used in this project has the following features:

Every Cycle all "three wire" temperature sensors are scanned and data logged from them, if new sensors are connected then they will automatically be included.  (Currentlly five sensors are connected in parallel but it is possible to use far more).
A CSV file is generated with sensor codes, names, locations etc which can be edited for the next program run so that sensor names can be added.

A CSV file, config.csv is used to set up program parameters.

FTP is used to send files to this website.

Every Cycle the following filles are generated:

An HTML File To display status on web site (See Below)
An HTML File showing Recent Program Status (Status.html) linked to from page below.
An HTML File showing all recent Logged data, (log.html) linked to from page below

Every few ccycles a CSV file is updated with logged data also linked to from the page below.  Thus shows all data logged since program started.
This CSV file can be opened by Excel so that data can be anaysed.

Each cycle two TPLink type HS110 Smartplugs are commanded on or off based on current target temperature and their status and power use logged.

After a power failure the software is restarted automatically by editing "rc.local" in "/etc" and using a command that uses "tmux"


This system is controling the heating in the Whitchurch Shed. ( www.whitchurchmeninsheds.uk ).

Fan Heaters are controled by TPLink Smart Plugs which in turn are ontrolled over Wi Fi by the R Pi (Raspberry Pi)

Full proven software listing (Python 3) will be published here once the updates to this years version have been completed. Meanwhil here is a zip file with the current set of files, there is some redaction to conceel items such as FTP passwords.  version17.zip

A combination of www.dataplicity.com and "tmux" (  github.com/tmux/tmux/wiki ) and "cloudcmd" ( is used to allow the Python 3 to be monitored stopped, started and edited from anywhere. (docs.dataplicity.com/docs/share-files-with-wormhole ) [ see also My Cheat Sheet


If you have any queries or comments please email rpi@torrens.xyz .