Home Easy Hacking Wiki


I recently discovered that someone has created a useful looking Home Easy Hacking Wiki to pull together what information there currently is about hacking a range or related home automation hardware. Unfortunately it doesn’t yet answer Jerd’s question about the automatic protocol, so if you’ve got something working, it would be fantastic if you could add a few more details to the wiki.

Hoping to get back to finishing off a Freeduino Home Easy controller before too much longer- I didn’t even get as far as unwrapping the transmitter last time! I’m currently wondering if the Finite State Machine library that Mike used in his latest project would be useful to handle transmitting and receiving from the same controller.

If you’ve done anything like this before, any tips would be most welcome!

Update: maybe the Southampton Hack Day (via Benjie) would be a suitable opportunity to work on this. (4 Sept 2009)

Update: Thanks to Paul’s post I’ve just discovered another page documenting various 433 MHz AM signals, including devices using PT2262/PT2272 encoder/decoder chips, which klik-aan klik-uit uses apparently. (24 Sept 2009)

And there’s more:

Must get round to finishing this off myself sometime soon! Here are a couple more people who have Home Easy working with the Arduino:

(29 Oct 2009)

Home Easy page on Arduino Playground


Largely thanks to @barnybug, the Home Easy Arduino hacking has been going really well. Making an LED blink is one thing, but making it blink by pressing a button the other side of the house is quite another! I’ve currently just been receiving signals, but when I’ve got the transmitter going as well, I want to do things like only relaying an on command to the socket if the current energy use isn’t too high. (Would be nice to have that working in time for Home Camp, but no promises.)

Should anyone else want to get going with some Home Easy hacking as well, I’ve created a Home Easy page on the Arduino wiki. So far it’s mostly just the sketches from Barnaby but I’m working on using interrupts instead, with the eventual aim of creating a Home Easy library for the Arduino. (There’s a Google code project for many RF protocols at once, but I just have Home Easy.)

Here’s what I have for receiving a Home Easy message with interupts so far which, with some even messier code, seems to do the trick. I would like to be able to register functions to call for specified controller/device codes, but not looked in to how that would work yet.

ISR(TIMER1_CAPT_vect) {
unsigned int pulse_width = ICR1;

if( !bit_is_set(TCCR1B ,ICES1)) { // falling edge was detected
// start over if the high pulse was out of range
if(pulse_width < min_high_width || pulse_width > max_high_width)
{
pulse_count = 0;
}
// don’t need to do anything with high pulses as long
// as they’re ok; should all be the same width
}
else { // raising edge was detected
// start over if the low pulse was out of range
if(pulse_width < min_low_width || pulse_width > max_low_width)
{
pulse_count = 0;
} else {
if(pulse_count < max_low_pulses) {
rx_wire_bits[pulse_count++] = pulse_width > bit1_low_detect ? 1 : 0;

if(pulse_count == max_low_pulses) {
message_received = receiveMsg();
pulse_count = 0;
}
}
}
}

// reset the counter
TCNT1 = 0;

// toggle bit value to trigger on the other edge
TCCR1B ^= _BV(ICES1);
}

Another Arduino Oscilloscope


On a bit of a tangent from my Home Easy hacking, I’ve been experimenting with an alternative to the poorman’s oscilloscope. The arduino + processing hack is brilliantly simple but it wasn’t much use with the signals I was trying to look at.

Zelscope looks quite interesting but it’s a trial download, plus I wanted to keep the arduino end of the poorman’s oscilloscope hack the same if possible. The Universal Real-Time Software Oscilloscope GUI DLL Library didn’t initially look as interesting since I was hoping not to have to write any code. On closer inspection, it does have a test .exe which will import data, which only needed a tiny change to the arduino sketch from the original hack:

Serial.print( val );
Serial.print(“\t0.0000000000\t0.0000000000\n\r”);

So just get the data from the serial port, into a file and import it… either I’m missing something or getting data from a serial port on Windows is a bit of a pain. I ended up using PowerShell to do the job, starting with some instructions for reading from a serial port on the PowerShell blog. Unfortunately that doesn’t seem to work, but getting rid of the add_DataReceived line and using ReadLine() did the job:

[string]$str = $port.ReadLine()
Add-Content “C:\Temp\Data.txt” $str

I do wonder if I could use the oscilloscope GUI DLL library directly from PowerShell. I get the impression that might be possible- I expect Dale will know the answer! For now, here are the results importing a file:

arduinoscope

Not bad, although I’ve yet to see if it makes finding the signal I want any easier. Next week I’ll be at my mum’s house trying to find an actual oscilloscope which I used to have!

Home Easy -duino


So I’ve done a bit of playing with the Freeduino and I can see why people like Arduinos so much: they really are simple to get working. It might only start with a blinking LED but it’s nice to feel you’ve achieved something so quickly. I wish more software was like that!

The reason for getting an arduino was to experiment with some more home automation, so I’ve ordered 433MHz AM transmitter and receiver modules which look (to the untrained eye) like they should work with my Home Easy sockets. Hopefully they’ll also be simple to wire up to the arduino as well! I’ve found a couple of projects which look like they might help get me started with the code:

In fact, combining infrared with Home Easy, to turn off a couple of sockets when putting the TV on standbye for example, might be interesting. The first thing I want to try (assuming I get it working at all!) is forwarding commands via the arduino. So, for example, the arduino could relay an on command to the living room lamp, but only if the CurrentCost reading is low enough (i.e. the kitchen lights aren’t still on)!

I’ve been using the simple oscilloscope hack to do some prototyping while I wait for the AM modules to arrive, and I’ve managed to ‘send’ a sample signal that looks about right. I’m not so sure about how good the timing is going to be though, and I’m still pondering about receiving Home Easy commands. Any suggestions about the best way to do this kind of thing would be most welcome!

Freeduino SB


I recently gave in to the temptation to get an arduino. I managed to put off buying one long enough for tinker.it to run out of the useful looking starter kits so I decided go for a bit of variety and ordered a Freeduino SB instead. It arrived ahead of schedule today and it looks like a really nice part assembled kit- I dug out my soldering iron at the weekend, and I’ve got a fresh reel of solder, so I’m all set to put it together as soon as I get a chance:

freeduinosb

Assuming it works when I’ve finished with it, and I can get an LED to flash, I’m hoping to try and get it communicating with my Home Easy sockets (getting an LED to come on using the Home Easy transmitter might be the first step).

Being a complete arduino novice, I think I’m going to need some help to get that working! My plan so far is to get a 433MHz AM transmitter and receiver module (there’s an RS Trade Counter near me) and try getting the arduino to understand the Domia Lite specification. So that’s more of a vague idea than an actual plan really! If you can help, either with what not to do when connecting an arduino to those modules, or how to program the darn thing, that’d be great- please leave a comment below!

Update: Just soldered the last few parts on the freeduino, and it blinks! (27 Jan 2009)

freeduinoblink

(I’m going to stop watching the blue flashing light any minute now…)

Update: now with spinning green thing! (28 Jan 2009)

freeduinospin

What next? Something useful?!

Home very easy


Since Graham posted about the Home Easy range I’ve been wondering whether to give it a try. Well, okay, it was always more like a question of when not if, so when we were in the vicinity of the Home Easy shelf in B&Q (just the next aisle or so over… the other side of the store) I had a quick look. To have a better look, I bought a pack to take home!

My first purchase wasn’t all that successful. I had been seduced by the wiz-bang timer remote control pack, which comes with two dimable sockets. Unfortunately, while the pack says you can switch on and off as well as dim, it lies; the sockets are not dimable, they only dim. Fortunately one of the great things about B&Q is their customer service, so I took my first attempt back and got a refund.

I played it safe with my second attempt and got the simple controller and three socket pack from the on-off part of the range. It’s probably better value, even though I currently only need two of the three sockets. Pairing the remote and sockets is pleasingly simple and the group function is very nice; you get the everything off function even without buying the switch that Graham did. (Not that I’ve ruled out extra bits in the future of course!)

Jo and I discovered an extra use for the remote control yesterday when she wasn’t feeling well: instead of yelling downstairs to ask me to do anything, she could just flash the lamp on and off! I might regret suggesting that idea!

Definitely very happy with my delayed impulse buy but there are one or two niggles…

Pros:

  • Very easy to use
  • The basic pack is pretty good value
  • Really very easy to use

Cons:

  • Doesn’t do exactly what it says on the tin (box); check what you’re buying will do what you want it to
  • There’s no way to switch a socket on or off without using the remote. I guess the excuse is to keep costs down, but slightly bigger button could easily do press on/off and hold to pair
  • The dimable sockets can’t do simple on/off as well. Actually the dimming is fairly naff all round: press on, wait until it dims to the right level and press on again