ByeByeStandBye Plugs and the Raspberry Pi and why pilight is awesome

 

The story

I bought a set of BBSB (Bye Bye StandBye) plugs just to make my life easier, basically they are plugs/sockets with a remote control so you can turn them on and off without having to furtle behind the shelving to find the mains plug to turn everything off. They were quite nifty but the remote annoyed me as I either put it down somewhere and forgot or it managed to elope with a group of plectrums, hair bands and that pen you were just using not to be found for another week. I did a quick bit of research and discovered you can buy a controller that you can connect to your computer to manage them! Hurrah I thought, wait, how much? There also seems to be a whole range of compatibility issue between different brands and controller versions so I decided to not bother.

A bit later I came back to it and saw a post somewhere about controlling a similar device with a Raspberry Pi, now if there is one thing I have around the place it is Raspberry Pi machines… Next stop is a 433MHz transmitter / receiver pair. I bought one of these : http://www.amazon.co.uk/gp/product/B00E9OGFLQ less than £1.50 delivered (from China so may take a couple of weeks). It arrived and I connected it up using female to female jump wires and tried and utterly failed to get it working.

This weekend I had another push and after messing around with various bits of code and generally failing I can now control my switches using the Pi and found a lovely bit of software to help manage it and even put a snazzy web front end on it.

 

How I got it working!

If you are going to attempt this then everything is at your own risk, I don’t accept liability or responsibility for anything!

Standing on the shoulders of giants!

I messed around for ages with bits of code and information from various sites,  unhelpfully quite a few (specifically relating to the Bye Bye Standby products) referred to the forum (which I was assured had all the info) sadly this was broken and Google cache and Archive.org were not any help.

To wire it up I followed the diagram here:

http://www.homautomation.org/2013/10/09/how-to-control-di-o-devices-with-a-raspberry/

I didn’t bother hooking up an aerial to the receiver as I only used it to capture the remote settings, the transmitter just has a jump wire connected to it as an aerial.

As the software we are going to use is going to leverage the awesome WiringPi then you will need that too.

Now this is important, because we are using WiringPi all the software is going to refer to the WiringPi pin numbers NOT the physical pin numbers on the GPIO connector on the Pi.

If you have other things connected to your Pi then don’t worry,  providing you hook the 5v to a 5v pin and a ground to a ground and the data to a GPIO data pin (make note of the number as per WiringPi) then you will be fine.

To do all the hard work we are going to use the fantastic pilight.  (In an earlier version I mistakenly put capitals in it,  please note it should always be spelt lower case 🙂 )  pilight can do a heck of a lot and we are only just scratching the surface here,  it has a nice web interface and can hook into a lot of things but for now we are aiming for the lofty goal of turning a single socket on and off 🙂

Next up install pilight from here.

Then you will need to edit the /etc/pilight/hardware.json file to make sure the data pins on your transmitter and receiver are correct,  remember this is the wiringpi pin numbers not the physical ones!

After you have done that then on the pi as root (hint sudo -s) then you run :

/usr/local/bin/pilight-receive

Then hold your BBSB remote near the receiver and press the button :

You should get something like this :

{
        "code": {
                "id": 0,
                "unit": 0,
                "state": "on"
        },
        "origin": "receiver",
        "protocol": "arctech_switches_old",
        "uuid": "0000-00-00-a3-94eb2d",
        "repeats": 1
}

Once you get data hit CTRL+C to get back to the prompt. Ok this was for button one “on” on my remote. Now the info we are really interested in is “id” and “unit” also “protocol”. For my BBSB plugs they show up as “archtech_switches_old” after this failed in the send command a quick google suggested I try kaku_switch_old as the protocol. You now shoud have all the info to turn switches on and off from the command line, the -i flag is the ID of the plug, in my setup I discovered that button one was ID 0 button two was ID 1, button three was ID 2 and button 4 was ID3. So running :

pilight-send -p kaku_switch_old  -i 1 -u 0 -t

Should turn socket 2 on ( -t = on and -f = off ) so then :

pilight-send -p kaku_switch_old  -i 1 -u 0 -f

Should turn it off again.

Next post will be pilight config,  I just want to get that bit up online while it is fresh in my mind 🙂

2 thoughts on “ByeByeStandBye Plugs and the Raspberry Pi and why pilight is awesome

  1. Thanks for sharing this information! I will add the ByeByeStandBye to the supported list. One question though. Can you please refer to pilight without capitals? Thanks! If you have any question, feel free to ask them on our forum.

Comments are closed.