I got inspired by all those great Nintendo Wii projects on the internet. I used my Wiimote to control my curtains. Read below how I did that.

Let’s start with a video of the end-result:

Curtain Controller
The curtain control system is an existing system from Goelst and is called “G-Rail 6200″. Normally it is controlled by infrared or wallswitches. However, it can also be controlled with a CAN bus. I used this CAN bus to interface with an old PC.

Bluetooth Dongle
On the PC I attached a cheap USB Bluetooth dongle that I bought in China. It comes with a free version of the Blue Soleil bluetooth stack.

I paired my Wiimote with my PC. This is done by holding down the 1 and 2 button on the Wiimote (leds will flash) and use the bluetooth software to set op a connection with a HID device.

There are several free programs on the internet that make it possible to interface your Wiimote with PC applications. I used a program called GlovePIE. It takes some time to understand the functions of the program because the documentation seems to be written for people that already know GlovePIE. Also the copyright disclaimer is really strange. But after investing some time to learn the functions of the programm and going through many examples and forums on the internet I found it one of the best solutions currently available. Actually real good solutions do not yet exists.

GlovePIE has no function to send messages to a CAN bus. So I started up my good old visual basic and made a little program that handles the CAN messaging. In the first version I used the keypressed event. I made a GlovePIE script that sends out keyboard keys when the Wiimote has a certain orientation and voila… L is for left, R is for Right and S is for Stop.

This is the first version of my script:

ExitScript = HeldDown(Wiimote.Home, 3s) // a safety break

if window.title == “G-rail control” then
//only do this when grail control software is active

key.RepeatFakeKeys = false

// read values from Wiimote
var.x = wiimote1.gx
var.y = wiimote1.gy
var.z = wiimote1.gz

// now control the curtains
if var.x > 0.8 then

var.debug = ‘L’
key.R = false
key.S = false
key.L = true

elseif var.x < -0.8 then

var.debug = ‘R’
key.S = false
key.L = false
key.R = true

elseif var.y > 0.9 then

var.debug = ‘S’
key.R = false
key.L = false
key.S = true


var.debug = ”
key.R = false
key.L = false
key.S = false


debug = var.x + ‘ ‘ + var.y + ‘ ‘ + var.z + ‘ ‘ + var.debug

debug = window.title

So the GlovePIE script sends keystrokes to a visual basic program that sends CAN messages to the curtain controllers.

Next version
After the basic version I demanded more. I wanted forcefeedback when curtains are already on their maximum position. I also wanted speech feedback and even speech control as a backup for Wiimote control. Most is basic GlovePIE functionality but getting feedback from the CAN to GlovePIE was real tricky. I ended up using the OSC (Open Sound Control) function to send messages to and from my Visual Basic program. Basically this is an UDP package on localhost. So with that I could tell GlovePIE that the curtains are on their end position and give force and audio feedback. I will soon add the technical details to this website.

9 Responses to “WIIndow curtain control”

  • Arjan says:

    Nice ideas. I own a Wii as well and right now I’m starting to wonder what else is possible with these controls! :-)
    Thanks for the light up!


  • nelson says:

    felicitaciones por su proyecto.favor envie pagina web. donde aparezca proyecto detallado .gracias

Leave a Reply