michael94
Posts: 3
Joined: Mon Nov 05, 2018 7:50 pm

Controlling an RF thermostat

Mon Nov 05, 2018 9:38 pm

Hey guys,

I'm new to the forum but have been a Pi user for quite a few years now. Most of my uses have been for programming in Python and in general to gain a better understanding of Linux. So the reason for this post is that I have a few questions/ideas about controlling my RF thermostat with my Pi.

I thought the best way to go about this would be to get an RF transceiver (868 MHz is what my thermostat uses) to sniff the signals from my thermostat controller and then emulate those using the transceiver. I do have one question with this approach if anybody could answer, would the heating go out of sync if I set it to 15 on the controller, but then use the Pi to set it to 20 for example? What would happen if the controller then tried to set the temp? The controller I have is this one and only has up/down buttons to change temp:

Image
https://salus-controls.com/files/RT500RF-Manual-006.pdf

My backup plan was to use a 433 MHz transmitter and receiver kit (since these are much cheaper and more commonly available) and wire the receiver outputs to emulate the button presses on the actual controller itself, then send my own 433 MHz signals to activate these from the Pi.

Does anyone have any experience with this kind of thing? Am I heading in the right direction?

Thanks, all help is greatly appreciated :)

stevend
Posts: 210
Joined: Fri Oct 11, 2013 12:28 pm

Re: Controlling an RF thermostat

Tue Nov 06, 2018 1:47 pm

michael94 wrote:
Mon Nov 05, 2018 9:38 pm
I thought the best way to go about this would be to get an RF transceiver (868 MHz is what my thermostat uses) to sniff the signals from my thermostat controller and then emulate those using the transceiver. I do have one question with this approach if anybody could answer, would the heating go out of sync if I set it to 15 on the controller, but then use the Pi to set it to 20 for example? What would happen if the controller then tried to set the temp? The controller I have is this one and only has up/down buttons to change temp:
I think things would get very confused! Depends on the controller, but most likely the last command sent (regardless of the source) would "win".

Probably the thermostat is making the decisions, and sending a simple "Heat" or "No Heat" command to the receiver, and the receiver is just acting as a remote controlled switch. So add another switch (wired or wireless) which is controlled by the Pi, and work out how you are going to select which switch is used. It could be as simple as adjusting the wiring; in my setup I've got a separate selector switch which determines whether the electronics or the old thermostat is in control. (Its always good to have a fallback once relatively complex software and hardware is involved).

Bear in mind that the thermostat is likely to be switching mains voltages, and take appropriate precautions (or get someone else to do that bit!)

pfletch101
Posts: 484
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Controlling an RF thermostat

Tue Nov 06, 2018 4:12 pm

stevend wrote:
Tue Nov 06, 2018 1:47 pm
michael94 wrote:
Mon Nov 05, 2018 9:38 pm
I thought the best way to go about this would be to get an RF transceiver (868 MHz is what my thermostat uses) to sniff the signals from my thermostat controller and then emulate those using the transceiver. I do have one question with this approach if anybody could answer, would the heating go out of sync if I set it to 15 on the controller, but then use the Pi to set it to 20 for example? What would happen if the controller then tried to set the temp? The controller I have is this one and only has up/down buttons to change temp:
I think things would get very confused! Depends on the controller, but most likely the last command sent (regardless of the source) would "win".

Probably the thermostat is making the decisions, and sending a simple "Heat" or "No Heat" command to the receiver, and the receiver is just acting as a remote controlled switch. So add another switch (wired or wireless) which is controlled by the Pi, and work out how you are going to select which switch is used. It could be as simple as adjusting the wiring; in my setup I've got a separate selector switch which determines whether the electronics or the old thermostat is in control. (Its always good to have a fallback once relatively complex software and hardware is involved).

Bear in mind that the thermostat is likely to be switching mains voltages, and take appropriate precautions (or get someone else to do that bit!)
Since the thermostat appears to be a very simple one (notwithstanding that it has a remote control), I would assume that it would, indeed, obey the last command that it received, but its user manual should tell you that. If it is programmable (the OP doesn't say), then commands from 'outside' it may only be effective until the next programmed change.

Most thermostats operate on 24V AC supplied by the HVAC system, and only reasonable care in wiring them is necessary - mains thermostats do exist but are becoming increasingly rare. You should turn off the HVAC system at the furnace/circulator before working on the thermostat, but this is more to avoid blown low voltage fuses and/or damage to the circuitry than for personal safety.

michael94
Posts: 3
Joined: Mon Nov 05, 2018 7:50 pm

Re: Controlling an RF thermostat

Tue Nov 06, 2018 5:56 pm

Thanks for the replies. I can confirm that the thermostat is programmable, though I've never used those features.

In terms of touching the mains receiver which is next to my boiler, I don't plan on going near this as I've only just got started with basic electronics over the past couple of months.

Has anybody used any kind of 868 MHz transceivers/transmitter & receiver pair before with the Pi?
I did find this pair of transmitter/receiver modules very cheap:
https://www.rfsolutions.co.uk/radio-mod ... ckage-p651
https://www.rfsolutions.co.uk/radio-mod ... ckage-p652

Or this transceiver:
https://www.rfsolutions.co.uk/radio-mod ... hz-so-p641

Any thoughts on which would be easiest for a electronics beginner?

Thanks!

pfletch101
Posts: 484
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Controlling an RF thermostat

Tue Nov 06, 2018 7:53 pm

I had not noticed that your initial post included a link to the manual for your thermostat. This bears careful study! I now gather that the device you pictured is actually a battery-powered wireless controller for what amounts to a radio-controlled (and mains powered) relay that is located near the furnace. I have a WiFi-connected programmable thermostat which is hard-wired to my HVAC system (using 24V power and most of the control lines supported by advanced thermostats), and I use various sensors, mostly with either USB or 433 MHz wireless connections to a Pi, to inform an application running on my main Windows system which communicates with and 'fine tunes' the thermostat. The programmability of the thermostat does most of the 'heavy lifting' of optimizing my environmental control and power use.

There are a couple of things to note in the manual for your device: the first is that the controller apparently sends out a command sequence every 10 minutes corresponding to the state (on or off) that it 'thinks' the heating system should be in. A single command sequence sent out on the same 'channel' by another device will, therefore, be effective for no more than 10 minutes, unless it, too, is repeated. The system does support multiple controllers (though how their commands are coordinated is not made explicit), but each one has to be set to a different ID code by means of a DIP switch. It is likely that you will need to "sniff" the controller's output with at least two different DIP switch settings so that you can simulate this setup, but my guess is (as I said, the manual is not clear on this) that the heating system will turn on if either 'channel' calls for heat - you will not be able to turn it off if the 'real' controller is calling for heat.

PhatFil
Posts: 1314
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Controlling an RF thermostat

Tue Nov 06, 2018 7:55 pm

How expensive was the transmitter/control box? do you feel brave enough to crack its case?

If so how about effecting the change you want programmatically and remotely via your Pi and perhaps other devices accessing services hosted on your pi by hacking the existing transmitter box. But instead of employing its RF controller and protocols if you can find a roadmap to decode and replicate? (U-tubes by Andreas Spiess might help?)

You could use a small basic soc with wifi support to ground the devices button contacts. small as it is a pi-0 board is a monster compared to most of the esp8266 and esp32 dev boards available a wemos d1 board with ample gpio exposed is less than 1/2 the size of a pi-0

a multimeter should provide you with the logic voltage level used on the pcb/buttons, if 3v3 you could hook up a 3v3 esp8266 or similar directly or if under 12v you should be able to find a cheap n cheerful logic level shifter pcb to handle any voltage difference and protect the soc. and hook up the relevant button contact and then send up or down increments via wifi and mqtt from your pi??

that way your Pi based status would not be in conflict with the controller status.

stevend
Posts: 210
Joined: Fri Oct 11, 2013 12:28 pm

Re: Controlling an RF thermostat

Tue Nov 06, 2018 8:04 pm

pfletch101 wrote:
Tue Nov 06, 2018 4:12 pm
Most thermostats operate on 24V AC supplied by the HVAC system, and only reasonable care in wiring them is necessary - mains thermostats do exist but are becoming increasingly rare. You should turn off the HVAC system at the furnace/circulator before working on the thermostat, but this is more to avoid blown low voltage fuses and/or damage to the circuitry than for personal safety.
Depends on the country, I think. In the UK I've only come across mains-operated thermostats in domestic situations, although 24V a.c. is common in more extensive installations.

pfletch101
Posts: 484
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Controlling an RF thermostat

Tue Nov 06, 2018 8:22 pm

stevend wrote:
Tue Nov 06, 2018 8:04 pm
pfletch101 wrote:
Tue Nov 06, 2018 4:12 pm
Most thermostats operate on 24V AC supplied by the HVAC system, and only reasonable care in wiring them is necessary - mains thermostats do exist but are becoming increasingly rare. You should turn off the HVAC system at the furnace/circulator before working on the thermostat, but this is more to avoid blown low voltage fuses and/or damage to the circuitry than for personal safety.
Depends on the country, I think. In the UK I've only come across mains-operated thermostats in domestic situations, although 24V a.c. is common in more extensive installations.
You may well be right. I was speaking from US experience, though I think that the thermostat in my house when I lived in the UK was indeed directly mains-operated.

stevend
Posts: 210
Joined: Fri Oct 11, 2013 12:28 pm

Re: Controlling an RF thermostat

Tue Nov 06, 2018 10:47 pm

michael94 wrote:
Tue Nov 06, 2018 5:56 pm
Has anybody used any kind of 868 MHz transceivers/transmitter & receiver pair before with the Pi?
I did find this pair of transmitter/receiver modules very cheap:
https://www.rfsolutions.co.uk/radio-mod ... ckage-p651
https://www.rfsolutions.co.uk/radio-mod ... ckage-p652

Or this transceiver:
https://www.rfsolutions.co.uk/radio-mod ... hz-so-p641

Any thoughts on which would be easiest for a electronics beginner?
The transceiver definitely won't do; it's intended for sending digital data. And I'm not convinced the others are OK, either

I found this useful article, which gives you a lot of the basics. The RFM02 is probably available; if not, the article gives help on the RF settings needed. (I've used the RFM12, which also has an SPI interface, and there's a lot more you can set up there. If you end up with an RFM12, the Energenie control board for the Pi uses one - costs about £20. A popular module with a number of software examples).

michael94
Posts: 3
Joined: Mon Nov 05, 2018 7:50 pm

Re: Controlling an RF thermostat

Wed Nov 07, 2018 4:42 pm

Thanks for the help guys, it's given me a lot of food for thought. I think at my level of current electronics knowledge, emulating RF signals is out of reach for me.
PhatFil wrote: How expensive was the transmitter/control box? do you feel brave enough to crack its case?

If so how about effecting the change you want programmatically and remotely via your Pi and perhaps other devices accessing services hosted on your pi by hacking the existing transmitter box. But instead of employing its RF controller and protocols if you can find a roadmap to decode and replicate? (U-tubes by Andreas Spiess might help?)

You could use a small basic soc with wifi support to ground the devices button contacts. small as it is a pi-0 board is a monster compared to most of the esp8266 and esp32 dev boards available a wemos d1 board with ample gpio exposed is less than 1/2 the size of a pi-0

a multimeter should provide you with the logic voltage level used on the pcb/buttons, if 3v3 you could hook up a 3v3 esp8266 or similar directly or if under 12v you should be able to find a cheap n cheerful logic level shifter pcb to handle any voltage difference and protect the soc. and hook up the relevant button contact and then send up or down increments via wifi and mqtt from your pi??

that way your Pi based status would not be in conflict with the controller status.
The Salus unit itself is very cheap, I think new ones with the receiver cost about £40, looking on eBay I can see some good condition pre-owned ones for about £20. I think your solution is definitely my preferred one, but just to clarify is this what you mean:

- Wire a WiFi board such as ESP8266 onto the circuit board of the RF controller
- Hook up so that the ESP can then control the buttons as if they were being pressed manually
- Write script to allow the Pi to control the ESP board

If so, I think with my current knowledge levels this is more achievable, I've watched quite a few videos from Andreas (thanks for the recommendation, great channel!) and others on ESP8266 in general.

PhatFil
Posts: 1314
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Controlling an RF thermostat

Wed Nov 07, 2018 6:15 pm

yes, just watch the voltage difference between the controller/transmitter box and whatever soc you wire up.. if the controller runs on 5vdc, 12vdc or higher or even a/c you could fry the dev board you attach before you get started. So an additional pcb/circuit like a logic level shifter or voltage divider could be necessary.

rather than raid example sketches for the wifi config and mqtt subscription and publishing for you esp soc check out the tasmota firmware https://github.com/arendst/Sonoff-Tasmota/wiki/ may look daunting on first glance but its fully featured and flexible..

Alex Konshin
Posts: 41
Joined: Sun Jan 29, 2017 10:02 pm
Location: Boston MA, USA

Re: Controlling an RF thermostat

Sun Nov 18, 2018 11:34 pm

Do you have any idea about the protocol and modulation used by this controller? Actually this is the most important question for your project. Hacking of RF protocols requires a lot of experience and some times good luck.
You can look at my project where I was able to implement receiving and decoding of data from several types of sensors.
viewtopic.php?t=173023
https://github.com/alex-konshin/f007th-rpi
I could find information about these protocols on the Internet. But I also know that some protocols are impossible to implement on Raspberry Pi using available receivers.

Alex Konshin
Posts: 41
Joined: Sun Jan 29, 2017 10:02 pm
Location: Boston MA, USA

Re: Controlling an RF thermostat

Sun Nov 18, 2018 11:43 pm

One more thought. Controlling of HVAC unit directly is not a rocket science. Actually it is pretty simple.
See this article: https://xtronics.com/wiki/Thermostat_si ... iring.html

User avatar
tony1tf
Posts: 53
Joined: Tue Jul 03, 2012 12:33 pm

Re: Controlling an RF thermostat

Mon May 06, 2019 6:14 pm

A bit late to this thread, but .. I have a Salus wireless thermostat and have used lots of RPIs over the years. I found this article with links to github etc on the Salus protocols.

https://the.cyclingengineer.co.uk/2013/ ... a-jeelink/

Tony

Alex Konshin
Posts: 41
Joined: Sun Jan 29, 2017 10:02 pm
Location: Boston MA, USA

Re: Controlling an RF thermostat

Thu Jul 04, 2019 7:45 pm

BTW, some relatively old WI-FI capable thermostats support simple REST-like API that can be easily used from any application via HTTP requests.
For example, I bought thermostat in my house more than 7 years ago and it supports this API. I think that any of thermostats with trademark "Radio Thermostat" has this feature.
https://lowpowerlab.com/downloads/Radio ... I_V1.3.pdf

pfletch101
Posts: 484
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Controlling an RF thermostat

Thu Jul 04, 2019 9:07 pm

Alex Konshin wrote:
Thu Jul 04, 2019 7:45 pm
BTW, some relatively old WI-FI capable thermostats support simple REST-like API that can be easily used from any application via HTTP requests.
For example, I bought thermostat in my house more than 7 years ago and it supports this API. I think that any of thermostats with trademark "Radio Thermostat" has this feature.
https://lowpowerlab.com/downloads/Radio ... I_V1.3.pdf
Your link does not work for me [EDIT: ….in Edge - it does in Firefox].

I have a CT80 (your CT50's 'big brother'), and I do access it (read and control) from a VB.Net program running on my main Windows system, which also gets data from a PI monitoring various aspects of my environment. Unfortunately, the latest documentation for the API that I have been able to find is not totally consistent with what experiment reveals about how it works. In particular the commands that are supposed to reprogram the device for sequences of time and temperature do not seem to work at all (no error is reported but nothing changes), and the documented commands for reading and controlling an external dehumidifier do not work. Simpler data acquisition and control commands (e.g set one-off temperature) do work as advertised, however. I raised the inconsistencies with the device's tech support people, and they claimed to know nothing about the API - this is apparently only used (as far as they are concerned) for a cloud-based monitoring and control application run by a third party.

Return to “Automation, sensing and robotics”