Announcement

Collapse
No announcement yet.

io-homecontrol

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    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.
    Attached Files

    Comment


      #17
      only just seen this post, thanks for all the info!

      we you controlling a window or window blinds?

      Comment


        #18
        Originally posted by codey View Post
        only just seen this post, thanks for all the info!

        we you controlling a window or window blinds?
        I'm actually controlling a Velux external solar energy powered blind.
        But it could be anything controllable by the ioHomecontrol remote, like a window motorization.

        In fact, this pinciple can be applied to anything based on special or private protocol remote systems.
        The nice bonus is that you actually add a web interface you can control from anywhere in the world from your smartphone or PC, to anything that can be controlled with a button either locally or via a remote. You actually don't need Homeseer or any HA system, as each interface has it's own web server an IP address in your LAN.
        Le'ts say for instance that you are hours away from home and HS went belly-up... You can still close you blinds in case of storm. Even better, you can simply use such Arduino module to drive a relay in serie with your HS server, so wen it crashes (mine does at least once a year), you just power-cycle it from where you are.
        Much, much cheaper than a PDU rail with lan remote. It's endless and that's wy I use them everywhere.

        But obviously I don't use the Arduino UNO for that, it would be too expensive, these are experimentation platforms, but the Arduino Ethernet version is neat when I need wired LAN conectivity (generaly with POE). Most of the time, I use a stripped down version like the Arduino Pro Mini or clone which is much smaller and cheaper (about 15€) and Wifly modules
        Last edited by Mac Gyver; August 17, 2012, 02:46 PM.

        Comment


          #19
          Originally posted by Mac Gyver View Post
          Yes indeed.
          I just removed the plastic film sticked to the PCB, which inherently removes the metallic domes of the buttons with it.
          You then just have to solder 3 wires + 2 power wires to existing holes in the PCB (all buttons have a disk area on the PCB under the dome you removed and there are bridge holes between the two layers in these disks)

          It's then just a matter of soldering the wires to the prototyping board. These wires are just pieces of resistor wires cuts (I always keep them to use as jumpers). The wires are enough to support the remote's board physicaly as well, no need for screws.
          No need to connect the remote to the arduino - it can learn the IR signals and send them on its own. I had an arduino learn the signals for Nikobus and have a webserver running on the arduino listening to http requests to switch lights on and off. I use that one instead of usb-uirt as that one does not support running as a service.

          This got me started: http://www.arcfn.com/2009/09/arduino...ecord-and.html

          On the other hand - no need to fix it if it works...

          Jhh

          Comment


            #20
            Originally posted by Jhhbe View Post
            No need to connect the remote to the arduino - it can learn the IR signals and send them on its own.
            Hi Jhh,

            I guess you didn't read the thread from the start.
            IO-Homecontrol is RF, not IR.
            Quoting myself from my last post, resumes the context:
            The point I wanted to make in the first place is that it is sometime easier and probably quicker as well to simply "emulate your fingers on a proprietary remote" than to try to figure out the protocol or source the special chips needed.
            With IR remotes, a small blaster can simply learn the codes for each function, so IR is the easiest to emulate, no need for all this trickery, but when the remote is RF based, then things get complicated...
            Of course if you know of any IO-Homecontrol IR to RF gateway, I'll eat my hat, but even then I doubt it would be competitive with this hack.

            Regards.

            Comment


              #21
              hi fellow country man,

              I stand corrected - I was looking for info on Arduino as HS webclient - read only half the text and jumped to the wrong conclusion...

              But then again I was only one letter off

              Jhh

              Comment


                #22
                Originally posted by Mac Gyver View Post


                A few pictures of what it looks like (also have some pics of the cheap solution I use for detecting when the blind is open or close as well as the window itself, for anyone interested):
                I'm interested by your solution.

                Comment


                  #23
                  Originally posted by Endymion View Post
                  I'm interested by your solution.
                  Ok, then here it is:

                  I simply used a DS10 for detection of window position with the DS10 on the top of the frame and the magnet on the window.
                  Then, as the DS10 has a second sensor available by replacing the jumper on the internal terminals by a cable to the second sensor, I used this to hook a wire along the frame to a Reed sensor glued to the end of the blind guide.
                  I glued the magnet to the end of the blind itself.

                  That way, the main sensor of the DS10 give the status of the Velux window and the secondary sensor the status of the blind.

                  Regards,

                  Yves.
                  Attached Files

                  Comment


                    #24
                    This is great. I'm looking to do something similar. It is a bummer about having to cannibalize an entire velux remote though.

                    Here are two options for io-homecontrol transceivers:
                    - ADF7022
                    - SX1232

                    Sadly, there are no io-homecontrol related programming guides - they say you have to be an "io-homecontrol member" to get the information, whatever that means. Has anybody tried contacting io-homecontrol, Analog Devices, or Semtech about this information?

                    Comment


                      #25
                      Also - Mac Gyver - you clearly know a lot more about EE that me. I have a question about your connection to the board from the remote control.

                      I get what you're describing with using the NPN transistor in open collector to do the voltage conversion from the 5v arduino output to the 3.3V remote buttons. How come you didn't put a pull-up resistor between the button connection and the collector? Is it because this just happens to be stable enough as is, or is there some way to know ahead of time that it wouldn't be needed in a circuit like this?

                      Sorry for the sorta newb question.

                      Comment


                        #26
                        Originally posted by pmikesell View Post
                        This is great. I'm looking to do something similar. It is a bummer about having to cannibalize an entire velux remote though.
                        Well, yes of course, I don't remember the price I paid for this additional remote as I had it included in the quote from the blind, but it sure didn't break the bank.

                        Sadly, there are no io-homecontrol related programming guides - they say you have to be an "io-homecontrol member" to get the information, whatever that means. Has anybody tried contacting io-homecontrol, Analog Devices, or Semtech about this information?
                        When I saw this back when I designed this hack, I didn't even try to contact them because I knew already by experience that you have either a membership fee or you have to buy at least 1000 chips to start with. Large companies do have a "free engineering sample" policy though.
                        Besides, this project took me a few hours an was up and running the same week-end I had the opportunity to start it, so I guess you have to factor that against the weeks or months it would take to get the documents, the chips, and develop the code to drive them.
                        As a 50+ person I learned to have a pragmatic approach to these things

                        Comment


                          #27
                          Originally posted by pmikesell View Post
                          Also - Mac Gyver - you clearly know a lot more about EE that me. I have a question about your connection to the board from the remote control.

                          I get what you're describing with using the NPN transistor in open collector to do the voltage conversion from the 5v arduino output to the 3.3V remote buttons. How come you didn't put a pull-up resistor between the button connection and the collector? Is it because this just happens to be stable enough as is, or is there some way to know ahead of time that it wouldn't be needed in a circuit like this?

                          Sorry for the sorta newb question.
                          To the contrary, its a very legitimate question.
                          But you are asking this because you see it at a pure electronic level.
                          In that case, indeed a pull-up resistor would be needed to insure that an inherently high-z input would remain at high level and low-z to avoid noise triggering.
                          But remember we are dealing with a remote control here where we are merely replacing the physical buttons switches by transistors.
                          So we can obviously assume that the manufacturer of the remote has already taken care of that because an open switch is definitely even higher-z than an unbiased transistor, so we don't need to do it twice.
                          Pull-up can be done several ways, either by adding an external resistor, or by using the internal pull-up most micro-controllers are providing these days.
                          It is just a matter of setting the appropriate bit in the i/o configuration register to tell the micro-controller to add default pull-up or not.
                          That's why, on many circuits you'll come across, you may be fooled in believing that the designer forgot to care about pull-ups and that it could result in instable behavior, where in fact everything is being taken care of inside the chip.
                          The only case where you might be inclined to use external resistors (which I sometimes do) is when the internal pull-ups tend to add to much current drain for coin battery operated designs. In these cases you try to select the highest value possible before loosing stability and RF noise immunity.

                          Hope this helps,

                          Yves.

                          Comment


                            #28
                            Type of remote

                            Very nice job Mac Gyver!
                            Just for this I joined this forum and maybe will become a homeseer user

                            One question though: do you know what model/type the remote is? I can't imagine it is the same as I received with my CVP roof window. Mine has a LCD and I think more buttons than yours. For buying a donor I'm looking for the cheapest one available.

                            Groeten uit Nederland

                            Comment


                              #29
                              Attached Files

                              Comment


                                #30
                                Sorry for reactivating an old thread, but this would appear to be the solution to a problem I have been trying to solve for some time. I have two Velux blinds that use the same io-homecontrol protocol and have the same remote. I would like to use your solution and am about to order all the parts. But first, I have a couple of questions....

                                1. As I have two blinds, would it be possible to use one Arduino Ethernet to connect to the two remote controllers?
                                2. The Arduino Ethernet with POE is out of stock and seems to have been replaced by the Ethernet-Shield R3 with POE Module. Will this work OK?

                                Thanks,
                                Pat Rooney

                                Comment

                                Working...
                                X