SMS controlled heating control

Using a Raspberry Pi and a UMTS stick I control the heating in my part-time flat by text messages.

Similar projects worth following
I work regularly in a city (Munich, Germany) different from where I live with my family. So I've rented a small flat there. Since my mobile internet access is good enough for me during these working days I do not pay for a landline internet access in this flat. However, the heating of this flat has a drawback. It's a night storage heater*. So if I arrive there in the evening I cannot use the heating to warm it before the next morning. I used to leave the heating on on a lower scale when I was absent which worked kind of. However, the wheel to set the desired level is well-hidden and it's not easy to read its position. So once it happened : instead of turning the heating of before I left for my christmas holiday, I accidentally turned it on full power. When I came back almost two weeks later I had a sauna (kind of) in my flat and the next bill was enormous.

It was clear: I needed a remote control.

* For more about the heating system -> see details.

The heating is a night-storage system (German: Nachtspeicherheizung) is a bit of a nuisance. It's from the 1960s or 1970s and the idea was/is to use excess electricity during night time for heating. So the system gets power only between 22:00 and 06:00 o'clock. This is fixed and cannot be changed. Simply turning the heating on during day time does not work. During night time, electric heaters heat some stones which radiate the heat to the room during the following day. The control is just a wheel to set how much power is used to heat during the night. There is no thermostat. You have to think in advance if you want to have it warm or not. This is quite uncomfortable if you're not permanently in the flat.

This weird heating system is the main reason for my hack. The other one is that I didn't want to spend several hundert euros per year for an internet landline which I hardly use.

I had a Raspberry Pi (one of the earlier generations) and a UMTS stick lying around. So I came up with the idea of building a remote control using text messages (SMS) since this did not require a permanent internet connection. After searching around, I found the gammu project which was what I needed.

As for the driving of the heating control I used a stepper motor (28BYJ-48) and a belt drive.

For the temperature acquisition I use a DS 1820 temperature sensor.

Building was then relatively straight forward. I use python scripts to read the temperature , to drive the stepper motor and to process incoming and outgoing text messages. Details can be found on github (in German).

The OS is Debian 8 and I use also a rather old version of gammu. It is some time ago that I build the system and I never updated anything any more (no connection to the internet anyway).

The system collects the temperature data based on cron jobs. The day before I typically set off for work I get a SMS on my phone which looks like this:

fri min 24.5 max 26.4 avg 25.1
sat min 24.5 max 26.1 avg 25.2
sun min 24.7 max 26.4 avg 25.4
now 25.1 r: 53 s: 0

This includes temperature information about the past days, how many text messages can still be sent (r) and the setting of the heating (s).

A can also send various commands by text message to the system, e.g. to get a status report which looks like this:

Fr 21. Jun 07:30:07 CEST 2019
07:30:07 up 35 days, 8:15, 0 users, load average: 0,01, 0,02, 0,00
now 24.6 r: 63 s: 0

All incoming messages which the (very simple) parser does not understand are relayed to my phone. In this way I get all messages which my provider sends automatically, too.

Text commands for the system include commands to set the heating, pull status information, set a new number of remaining text messages (after I have put money to the prepaid SIM card) and to reboot the system.

The system has been running now for almost two years without any trouble.

The whole system could also run on a simple microcontroller like an arduino and a GSM modem. However, since I had a Raspi and a surf stick lying around this was the cheapest solution for me.

  • 1 × Raspberry Pi B (but a Zero should also be ok)
  • 1 × UMTS Stick ZTE MF 110
  • 1 × Housing for Raspi
  • 1 × some pieces of wood to mount everything
  • 1 × Tooth belt and wheel (e.g.

View all 12 components

  • Udgrade to Pi Zero

    MaBe4203/10/2024 at 09:21 0 comments

    After some years I had a SD card failure. The card I had used was already much used and old.

    I used this occasion to give the whole system an upgrade. Debian now version 10 (which was the current version at that time), a raspi zero W instead of the B+ and a printed custom housing.

    Of course, the software I used had also undergone some upgrades in the meantime (in particular gammu). Therefore, I had to amend the config file, too.

    Since then I has been running without any big problems. Except that gammu seems to hang every now and then. Therefore I restart gammu once a week and to be on the complete safe side I restart the system once a month. This seemed to solve all troubles.

    The whole software including the config files and crontab entries of both root and the user can be found on codeberg together with a translation of how it works into English.

View project log

  • 1
    Step 1

View all instructions

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates