Boiler control using URF
I don't know if this will be useful to anyone else but I have for some time been interested in using the HAH to control my central heating boiler via a Drayton Digistat RF2 wireless boiler thermostat. I hope to be able to more closely control gas usage by doing so.
I posted a question about using URF to send the boiler on and off codes some time ago and Brett gave a tutorial on the procedure for encoding the pulses into the URF output. Unfortunately I could never get it to work and was uncertain whether I would be able to achieve what was required.
The problem, it turns out, was that I was not using the right code because the Digistat transmitters have different ID's and I had gleaned the code from a source on the internet. Not being the possessor of such a thing as an osilloscope I was at a loss as to how to find the codes from my own transmitter. The solution which I reached was to buy a cheap 433 mhz receiver which I linked to an audio cable with a couple of 10k resistors in the lines. I was then able to grab the output of the receiver using the audio manipulation software "Audacity" (available as a free download) by connecting the audio cable to the line-in socket of my computer. The RF bursts are then able to be viewed as "osilloscope-like" traces and the pulse lengths measured for translation into the URF helper.
Happily by following Brett's tutorial I now have my central heating boiler under the control of the HAH using a simple lua script to sample temperatures and send the appropriate signals to the boiler. Another triumph for the HAH!
If anyone is interested I can post the Digistat codes (bearing in mind that the may be different on your system) and the lua script (which is fairly simple).
Unfortunately due to a massive C*ck up by my telephone provider I have been without phone or broadband for a couple of weeks now. It's not looking good for an early resolution Grrrrrrrrrrrr!
I would be very interested to see your script and codes. I have had it in mind to tackle this for sometime now but have struggled to find a way to see the codes from the thermostat. Looked at using a germanium crystal receiver connected to the parallel port of an old laptop but could never get it to work properly.
So some help would be very encouraging.
Thanks
Mike
Alan,
Thanks for this write up on how to use audacity to hack RF codes, this will no doubt help others to open up the RF capability, myself included.
For info, I also control my heating with HAH but I dont have a fancy drayton controller so have "made" one using a butchered RF socket (I know! its a bodge job but it works :) )
However, I have approached to LUA control aspect a little differently and thought I would share as it might give some ideas that may make your system more "programmable".
I modified the AliasApplet.lua script of Brett's to acceot two more alias messages, these are "Thermostat X" and "Heating" where X is the thermostat value required in degrees c.
If a "thermostat x" alias message is sent (ie thermostat 18) then the value 18 is writen to a file on the HAH.
if a "heating" alias message is sent, then the script first checks current house temp is below the thermostat value stored in the file and then checks current heating condition. If boiler is off and temp too low then the heating comes on.
Once temp if above thermostat value the heating goes off.
To glue this together I use the cron scheduler to send heating alias messages every minute during the required heating times. Cron also sends alias messages throughout the day to change the thermostat values for morning, day, evening and night settings.
the benefit of this approach is that this can all be programmed via Cron file (which can be done remotely) and in addition, one off adjustments can be made easily using google cal to send the required alias message or if you have an APP such as mote, your smartphone can send the alias messages to change thermostat or boost the heating for an hour etc.
Like I say its just another way to approach this.
I am away from home now so cant send code snippets, but if people are interested in this approach I will post up later this week.
Cheers,
Garry
When my new boiler was fitted, I specified that a Drayton RF be used. I like the idea of having the HAH control the boiler ... but SWMBO won't be wanting to give up her nice Drayton thermostat.
As I understand it, the drayton receiver must be paired with the Thermostat. This give us the worry that if I pair the HAH with the Drayton receiver, the original thermostat will become redundant (and as a result, SWMBO is not happy).
I had a cunning plan to capture the actual RF Transmission from the (already paired) Drayton setup and program the HAH to emulate this. Clearly, dual control of this sort is only good as an 'override'.
So, the question is ... did you have to 'pair' the HAH to the Drayton receiver to get it workign in the 1st place (or does the one receiver pair with/respond to a number of thermostats)?
Derek
p.s. Nice to see good work on decoding more 'stuff'.
/etc/init.d/xap restart plugboard
Cheers Garry
I have 2 433 MHz things i want to "decode" my new watchman on my oil tank and a hurstman thermostat.
so what cheap 433MHz receiver did you use?
could i use my ham rig do you reckon? but are the receivers not fairly cheap? sub £5
dean
what do you all think of following idea.
decode a standard TX (status) then use the decode on the HAH so you could use either std remote or hah to switch lights on/off so "if" HAH fails yuo can still switch lights on/off
SWMBO stays happy ish
what do others think (is it a goer???)
bring myself to use a £500 rig to decode a 433MHz signal.
for £5 i can set up a dedicated system. why did you use an arduino to just power the receiver why not a 7805?
I use the older lidl sockets with the wiki codes and can still use the remote. You're right though Dean, it does keep SHMBO happy(ish!)
not wanting to post a 'me too' but maybe this will be helpful.
I combined a usb sound card (£1.40) with microphone in. plus a 433 mhz rx £3.99 drove the receiver off the 5v usb, the rf has 12v max. so <£10 receiver.
A couple or resistors & capacitors a spare box it seems to work. Have put a changeover switch so I can add IR receiver as well.
circuit from here:
http://wiki.nethome.nu/doku.php/analyzer/hardware
seems to work so far. Nice self contained and doesn't require line in on your PC.
used the analyzer software doesn't work too well on 64bit you have to find the 64 bit libraries.
still playing with it but might help.
Thanks Guys, i've knocked up a quick decoder circuit using the suggestions here and can see the pulses being received in Audacity and the protocol analyser downloaded from wiki.nethome.nu but I am getting ALOT of noise making it difficult to see where the code starts and noise ends.
Do you guys have this problem?? I also am powering the receiver of batteries, could this be the cause?
sorry for my ignorant questions but my electronics is not great but I'm enjoying playing!!.
cheers for any advice
Garry
Garry,
It's normal to see a good deal of noise. The receivers seem to hunt for most anything that they can grab onto. However, when a decent signal is found, you should see a definite pattern appear.
Battery powered is fine. Just keep the receiver away from PCs/lappys/screens. An external antenna (like the ones in the shop) make this easier. Also, if you have other sources of 433MHz transmissions, try to temporarily disable these.
I do prefer to put a 'scope on the Tx pin of whatever is sending the signal ... but the 'general purpose receiver' technique is definately workable ... with a bit of experimenting ... trial and error.
My wireless stat was always a bit poor at controlling the boiler. It is supposed to have a range of 30metres but struggles to control the boiler from 5m away :) I think I have lead lined walls in this house.
Since setting up the HAH the wireless stat doesn't work at all so looks like I will going down this route too :)
Thanks for the write up
I am not exactly sure whether my attempts to create this Audiacity listener have worked .. if so, could someone explain how I get the data from these files? I have attach a link to one of my attempts.
EDIT: deleted it .. just realised, now that Allan suggested listening to one of his, that mine was just recording me and not the Arduino .. oops
Thanks
p.s. would love to take control of my boiler *this* winter!
Woops, yes .. that was correct .. I thought those small spikes were the signals .. seems it was me playing with the remote ..
Will have another try soon! Also, interested in knowing where Brett's tutorial is for encoding the pulses into the URF output?
Thanks
Fantastic solution! Well done, I love Audacity and use it regularly, I read of something like this on Hackaday, and it's great to see such a solution being used to solve a problem like this. Thanks for sharing.