Ok, now that we have our hardware described, this post deals with the software side.
Because we deal with an Arduino, I'll assume that the IDE is installed and running.
An Arduino tutorial is beyond the scope of this post.
In this project, I've used 3 libraries: the SPI, the Ethernet wich both are part of the standard distribution and the Webduino library available on github.
You just need to install the library in the libraries folder of the Arduino installation.
Next is to open the attached sketch and try to compile it.
If everything is correctly installed, it should compile OK.
You need now to edit the sketch to enter the correct MAC address. Since a while now, every Ethernet shield or Arduino Ethernet comes with a sticker underneath with a unique MAC address, just copy that over the default MAC in the sketch.
To be able to use the interface, you need to connect the ethernet port to your router/switch.
After compiling and bootloading this sketch, the arduino will start and begin it's initialization phase.
To be able to follow this phase and see if everything goes well, I've added serial logging, so open the serial terminal in the IDE at 115200 baud.
During init, the Ethernet library will attempt to get an IP and a gateway adrress as well as a subnet mask from an available DHCP server on your network (usualy your router)
We can follow this process on the terminal and eventually note the received address.
Now, this address being dynamically assigned, there is no garantee that the Arduino will always be assigned the same, so it is up to you to configure a static lease in your router with the prefered address. At that point, the terminal won't be necessary anymore as the IP will be known and garanteed.
During this phase, the led will go off steadily during the aquisition then flash rapidly when an IP is assigned and the web server has succefully started at this address.
If DHCP negociation fails, after a timeout of about 60s, the led will flash slowly and the process will wait for 5min before trying again.
This 5min cycle is designed so that in case of general power failure or brownout, when the power comes up again, the Arduino will wait until your router has finished it's booting process and is able to deliver an address again. Without that, the Arduino would be locked after the first unsuccefull try.
Now, it is time to connect with a web browser on the aquired address. You should see a simplistic web page with 3 buttons that emulates the Velux blind remote.
You can already control the blind by just clicking on these buttons (provided the remote has been matched with the blind's controller, obviously).
If this works, we can go to the Homeseer control.
In Homeseer, you just need to create events for each command. Usualy "UP" and "DOWN" are enough.
In the action of each event, you need to add: &hs.geturl("http://"+Velux_Ip,"/UP",true,80) for the "UP" command or &hs.geturl("http://"+Velux_Ip,"/DOWN",true,80) for the "DOWN" command. Velux_Ip is the address you staticaly assigned in the router.
This is the simplest way, but you can also make a script to create a virtual device, complete with buttons to directly have an interface in Homeseer and this is the way I generaly do with my projects.
Ok, I think that wraps up the software part.
Enjoy!
Yves.
Because we deal with an Arduino, I'll assume that the IDE is installed and running.
An Arduino tutorial is beyond the scope of this post.
In this project, I've used 3 libraries: the SPI, the Ethernet wich both are part of the standard distribution and the Webduino library available on github.
You just need to install the library in the libraries folder of the Arduino installation.
Next is to open the attached sketch and try to compile it.
If everything is correctly installed, it should compile OK.
You need now to edit the sketch to enter the correct MAC address. Since a while now, every Ethernet shield or Arduino Ethernet comes with a sticker underneath with a unique MAC address, just copy that over the default MAC in the sketch.
To be able to use the interface, you need to connect the ethernet port to your router/switch.
After compiling and bootloading this sketch, the arduino will start and begin it's initialization phase.
To be able to follow this phase and see if everything goes well, I've added serial logging, so open the serial terminal in the IDE at 115200 baud.
During init, the Ethernet library will attempt to get an IP and a gateway adrress as well as a subnet mask from an available DHCP server on your network (usualy your router)
We can follow this process on the terminal and eventually note the received address.
Now, this address being dynamically assigned, there is no garantee that the Arduino will always be assigned the same, so it is up to you to configure a static lease in your router with the prefered address. At that point, the terminal won't be necessary anymore as the IP will be known and garanteed.
During this phase, the led will go off steadily during the aquisition then flash rapidly when an IP is assigned and the web server has succefully started at this address.
If DHCP negociation fails, after a timeout of about 60s, the led will flash slowly and the process will wait for 5min before trying again.
This 5min cycle is designed so that in case of general power failure or brownout, when the power comes up again, the Arduino will wait until your router has finished it's booting process and is able to deliver an address again. Without that, the Arduino would be locked after the first unsuccefull try.
Now, it is time to connect with a web browser on the aquired address. You should see a simplistic web page with 3 buttons that emulates the Velux blind remote.
You can already control the blind by just clicking on these buttons (provided the remote has been matched with the blind's controller, obviously).
If this works, we can go to the Homeseer control.
In Homeseer, you just need to create events for each command. Usualy "UP" and "DOWN" are enough.
In the action of each event, you need to add: &hs.geturl("http://"+Velux_Ip,"/UP",true,80) for the "UP" command or &hs.geturl("http://"+Velux_Ip,"/DOWN",true,80) for the "DOWN" command. Velux_Ip is the address you staticaly assigned in the router.
This is the simplest way, but you can also make a script to create a virtual device, complete with buttons to directly have an interface in Homeseer and this is the way I generaly do with my projects.
Ok, I think that wraps up the software part.
Enjoy!
Yves.
Comment