Keeping warm (enough) with PRTG

 Originally published on February 15, 2023 by Simon Bell
Last updated on January 23, 2024 • 8 minute read

I often joke with my international colleagues that here in the UK, we measure the passing of the seasons by the temperature of the rain. Thanks to some research done by a local utility company, I recently found out that the area I live in is officially the “coldest, wettest and windiest” place in North Wales – I’m not sure if I should be proud or plan to relocate!

A couple of winters ago, we had a prolonged period of cold weather that resulted in the condensate waste pipe from our heating system, which runs along the outside of the house, freezing solid. This took the heating offline, which is not what you need when the temperature is double digits below freezing.

To make sure this didn’t happen again, I decided to install a Trace Heating system – electrical tape, wrapped around the pipe and insulated, to prevent freezing. Last winter was very mild and we had no need to use the trace heating. However, this year we had a cold snap, in mid-December, with temperatures predicted to go well below freezing. Time to turn on the pipe heater.

Unfortunately, when I planned the system, I didn’t think about how to control it efficiently. This meant having to remember to turn it on in the evening, when temperatures were heading downwards, and off again in the morning, to save energy. Something had to be done.

Follow The Monitoring Experts podcast

In previous articles, I’ve already written about the weather station I monitor with PRTG and Sonoff smart switches that integrate with PRTG using MQTT. Sonoff also produces a smart socket called the S20, which can be controlled over Wi-Fi. The S20 is available in several different pin configurations to match different country’s socket designs. All of these can be flashed with Tasmota firmare that enhances their capabilities. See the previous articles for details of how to do this and take special note of the safety information.

With the hardware in place, all that was left to be done was get everything talking to PRTG. I already have all the weather data, including external temperature feeding into a REST Custom V2 Sensor:

trace-heat-1

To keep the trace heating control independent from the main weather data, I used a Sensor Factory Sensor to “break out” the external temperature channel into a separate sensor:

trace-heat-2

I dropped the polling interval to 15 minutes to avoid any risk of the heating state sensor “flip flopping”

I also added a Lower Error Limit of -2 °C which would change the sensor state when the temperature dropped below -2, which seemed a sensible trade off between running the heating unnecessarily and running the risk of the condensate line freezing. Time will tell if the threshold needs adjusting. All that remained to do was setup a notification to turn on the smart switch should the temperature drop below the set limit.

The Tasmota firmware running on the S20 supports a number of messaging protocols. One of the previous articles explains how to use MQTT, but this time, I decided to use HTTP for the task. I created two notifications, one to turn the system on and one to turn it off. The payload for the HTTP Action simply sends the appropriate string to the switch. This includes the IP address, credentials, and the on / off command:

trace-heat-3

Finally, I setup Notification Triggers to turn the switch on and off according to the threshold temperature. It waits for two polling cycles (30 mins) before changing state:

trace-heat-4

The S20 has a handy status indicator on the front, so it's easy to visually check the on / off state of the switch, and so far, everything seems to be behaving properly, with the activations corresponding to the sensor status in PRTG:

trace-heat-5

In many parts of the world, energy prices are seeing unprecedented levels of volatility. One of the ways we can all make sure our energy use is efficient and cost effective is to use smart devices to monitor and control our heating and (unless you live in North Wales) cooling systems. PRTG, in conjunction with some cheap smart devices can make this easy.

As always, we’d love to hear about any unusual use cases you have for PRTG. Watch out for a forthcoming article that explains how one PRTG enthusiast in Australia is monitoring his solar and Tesla Powerwall installations.