Computer Inteface CM12

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • kevinwilson
    Automated Home Lurker
    • Apr 2007
    • 9

    #31
    Originally posted by jaffab View Post
    My control software is homebrew - not homeseer.
    Off-topic, I know, but out of curiosity how did you go about putting together your control software - did you write your own based on an existing library? Or from scratch? I'm hoping to put to together a solution that does only what I need, and avoid the complexity of Homeseer.

    Thanks,
    Kevin

    Comment

    • jaffab
      Automated Home Sr Member
      • Dec 2008
      • 94

      #32
      Originally posted by kevinwilson View Post
      Off-topic, I know, but out of curiosity how did you go about putting together your control software - did you write your own based on an existing library? Or from scratch? I'm hoping to put to together a solution that does only what I need, and avoid the complexity of Homeseer.
      Thanks,
      Kevin
      Hi. I wrote a fairly simple control program using the homeseer CM11A.ocx (you dont need homeseer running or in place to use the OCX, but I use it as it saves manually having to code the X10 commands).

      Part of my homebrew solution is a VB app which has two timer controls. One timer polls my CurrentCost device for power use and office temp (then picks up kitchen, bedroom, outside and lounge temperatures from seperate temp readers on a connected com port). The other timer control runs my x10, using hard coded X10 rules, using the CM11A.OCX to pick up changes, and send out new X10 commands.

      As an example, this is the code extract which detects movement in the lounge, and if the lights are off, turns on the lights, in-wall PC, and power to TV (if its past 9pm and nobody is in the lounge, everything gets turned off, but if you then walk back in, it all switches on)....

      '
      ' Get update from system
      '
      thisupdate = x10Comm.GetEvent(1) ' Wait a max of 1 second for any changes
      if this update = "" then exit sub

      processparts = split(thisupdate,":")
      deviceid = processparts(0)
      commandin = processparts(1)

      '
      ' Deal with lounge sensor
      '
      if deviceid = "A3" then
      if command = "ON" then
      secondspastnine = datediff("s",cdate(format(now,"dd/MM/yy") & " 21:00:00),now)
      if secondspastnine > 0 and secondspastnine < (60 * 59 * 3) then ' on only between 9pm and midnight
      if x10_Getstatus("A1") = "OFF" then
      call x10Comm.Exec("A","1",2,0,0,0) ' 2 = ON, 1 = OFF, 3 = DIM etc
      call X10_Audit("A1","ON","Out") ' audit the status change
      end if
      end if
      end if
      end if



      This is one part of the hundred of so lines of X10 commands. I thought about soft coding things through parameters, but then, I am going to change things so rarely, doing it in code is faster (in terms of response (about 15 times faster than homeseer dealt with it) and for me to code/test/complete).

      If you need any more information, let me know.
      __________________________________________________ _______________________
      My life is Home Automation, and my PS3 clan friends at http://www.ps3crowd.com

      Comment

      • kevinwilson
        Automated Home Lurker
        • Apr 2007
        • 9

        #33
        Hi jaffab,

        Thanks for your detailed reply. I had originally looked at the Homeseer CM11A.ocx, but thought it might be too difficult to implement. However, having been inspired by your code, I have now got a working VB program up and running using it.

        I say "working", but in fact it is very often missing incoming X10 commands, or they are being received incorrectly. For example, I send the command A1 ON from an infrared remote, and device A1 turns on, but the CM11 reports seeing something like F4 ON. I'm hoping this is just because I'm using a USB adapter with my CM11 - I'm going to try it with an ordinary serial cable. Outgoing commands are working perfectly.

        Anyway, thanks again for your help. With any luck I might have something fully working soon!

        Regards,
        Kevin

        Comment

        • jaffab
          Automated Home Sr Member
          • Dec 2008
          • 94

          #34
          Originally posted by kevinwilson View Post
          Hi jaffab,

          Thanks for your detailed reply. I had originally looked at the Homeseer CM11A.ocx, but thought it might be too difficult to implement. However, having been inspired by your code, I have now got a working VB program up and running using it.

          I say "working", but in fact it is very often missing incoming X10 commands, or they are being received incorrectly. For example, I send the command A1 ON from an infrared remote, and device A1 turns on, but the CM11 reports seeing something like F4 ON. I'm hoping this is just because I'm using a USB adapter with my CM11 - I'm going to try it with an ordinary serial cable. Outgoing commands are working perfectly.

          Anyway, thanks again for your help. With any luck I might have something fully working soon!

          Regards,
          Kevin

          That could be down to the device. A lot of devices have control on one code, and send out replies on another. Take a movement/light sensor - these can have 2 or 3 codes, 1 which takes a X10 in, and 1 or 2 which are X10 out, which can have completly different codes.
          __________________________________________________ _______________________
          My life is Home Automation, and my PS3 clan friends at http://www.ps3crowd.com

          Comment

          Working...
          X