Results 1 to 10 of 10

Thread: .NET programming for CM11A

  1. #1
    Automated Home Lurker
    Join Date
    Apr 2008
    Posts
    6

    Question .NET programming for CM11A

    Hi,

    Firstly I would like to say a quick hello to everyone at this forum. I have been interested in home automation for quite a few years now, but I suppose like everyone I have been on a tight budget where time and money are concerned.

    I work as a software developer so I am lucky in that I have a good level of knowledge where coding is concerned. Until last December I have never applied this to home automation. I bought a Harmony bundle from simply automate for a mess around. It came with a CM11A controller, 2 light dimmers and a device controller. I installed the Harmony OS and had a play with it. I managed to use Harmony to assign addresses to my X10 devices and from there turned them on and off via Harmony the UI.

    Although it was fun I really want to write my own code to a similar thing without the limitations of things such as Harmony. I managed to write a small application to dim lights etc which worked well. But I did need Harmony in as much as setting the X10 addresses in the first place.

    What I would like to be able to do is write some code that sets X10 addresses from a friendly user interface if you know what I mean?

    Any help with this matter would be most appreciated.

    Thanks, Dave.

  2. #2
    Automated Home Jr Member
    Join Date
    Apr 2004
    Location
    London, UK
    Posts
    22

    Default

    I assume you meant CM11U (aka CM12U) as CM11A is the USA model. If you wish to interface directly with the CM12U via the serial (or USB) port, there are plenty of sample programming examples on the Internet. Just do a search on CM11A protocol should turn up many examples. The CM11A is functionally equivalent to the CM12U. There is now a newer CM15Pro available which combines the ActiveHome and Transceiver Module functionality into one unit. If you have trouble finding the Cm11A protocol, drop me an e-mail directly and I'll forward you the information together with an example Visual Basic application for communicating with the CM12U.
    Kwong Li
    Laser Business Systems Ltd.
    http://www.laser.com
    http://www.cbus-shop.com

  3. #3
    Moderator toscal's Avatar
    Join Date
    Oct 2005
    Location
    Near Alicante Spain
    Posts
    2,010

    Default

    Have a look here http://www.home-automation.org/Softw...ndows_and_DOS/
    Some of the links don't work but you can still find a wealth of info.

  4. #4
    Automated Home Lurker
    Join Date
    Apr 2008
    Posts
    6

    Default

    Hi,

    @CBusShop I sent you a private message with my email on if you can send me as much code and links as you can that would be great.

    @toscal I read a few of the links I will read in more detail over the weekend, many thanks for sharing!

  5. #5
    Automated Home Lurker
    Join Date
    Apr 2008
    Posts
    6

    Default

    I have spent hours Googling and had no luck really.

    All I am trying to find is a .NET code sample of how to programmatically assign house codes to X10 module.

    I know that some X10 modules have 2 dials on them and you physically assign them using these dials, but mine don't.

    When I first got them I also bought Harmony and used it's UI to set assign the addresses. Now I want to acheive this through code, I don't want some 3rd part software to acheive assigning addresses.

    Please help if you can?

  6. #6
    Automated Home Sr Member jaffab's Avatar
    Join Date
    Dec 2008
    Posts
    94

    Default

    Quote Originally Posted by Davearia View Post
    I have spent hours Googling and had no luck really.

    All I am trying to find is a .NET code sample of how to programmatically assign house codes to X10 module.

    I know that some X10 modules have 2 dials on them and you physically assign them using these dials, but mine don't.

    When I first got them I also bought Harmony and used it's UI to set assign the addresses. Now I want to acheive this through code, I don't want some 3rd part software to acheive assigning addresses.

    Please help if you can?

    If you are still about and are checing this post, Google for "CM11A.ocx" or "hsax37.zip". This is an ocx driver which will work with VB6 and .NET (I use it in my own VB.NET Vs2005 app) for sending x10 commands and polling for X10 status changes (via a timer control). It really does not get any easier than this.

    If you cant find the driver, let me know and I will email it to you.

    Saves all that messing around trying to manually code all the X10 logic. Its a simple call to "x10_send(device,command)". So to program a device code, set the device into program mode (normally a case of switching it on and off 4 or 5 times quickly", then use the above, and it will be reprogrammed with the device code you send.

    Jaffa

  7. #7
    Automated Home Lurker
    Join Date
    Apr 2008
    Posts
    6

    Thumbs up

    Hi jaffab,

    Forgotton about this post until I got the email.

    I will take your advice and let you know how I go.

    Thanks you for your help it is appreciated.

  8. #8
    Automated Home Lurker
    Join Date
    Oct 2009
    Posts
    4

    Default

    Hi all. I read this thread with interest. I am thinking of getting into X10, possibly with the CM15Pro controller. Has anyone managed to control this through .net? Will CM11A.ocx work with this?

  9. #9
    Moderator toscal's Avatar
    Join Date
    Oct 2005
    Location
    Near Alicante Spain
    Posts
    2,010

    Default

    I think it will work but only on a basic level. The RF side of things won't.
    Have a look here http://forums.x10.com/index.php?topic=8484.0
    IF YOU CAN'T FIX IT WITH A HAMMER, YOU'VE GOT AN ELECTRICAL PROBLEM.
    www.casatech.eu Renovation Spain Blog

  10. #10
    Automated Home Sr Member jaffab's Avatar
    Join Date
    Dec 2008
    Posts
    94

    Default

    Just want to add to this (yes, I know its an old post, but this may be useful). I went through a process over the last 2 weeks of nearly tearing my hear out and giving up on the CM11A and switching to the CM15 - but now, glad I stuck with the CM11A. A fw changes to the app and CM11A config, and it is much, much, much more reliable.

    Ok, first of all, I have already done the 'drilling the holes in the case' thing - if you are new to this, there are threads about this. But in a nutshell, take the PCB and transformer out of the white plastic case, take the batteries out - and use a drill with a large drill size to drill as many holes in the box as you can - heat kills the response of the CM11A, so doing this for me (4 or 5 months back), cured 50% of my wowes.

    Next, there is the heartbeat. As reported elsewhere, it may be possible for the CM11A to fall alseep. So in your app, using the CM11A interface, I would suggest that every 20 minutes, get your app to send (via the x10Comm.waitexec) an x10 command out to a device which does not exist - it means that it will keep the CM11A awake - this sorted out another 25% of the CM11A issues.

    Finally, and this was the week I took a day off and sorted the last of the problems, do not use the documented GETEVENT (x10Comm.getevent) to read in the inputs from the x10 device. This works about 98% of the time - but can produce odd results. Sometimes the commands are wrong (e.g. receives "ALL LIGHTS OFF" instead of device "OFF") and sometimes the commands do not come in at all. i spent a day doing different tests, and out of 1,000 inputs, 72 were not recorded or were wrong. Those 72 may be the difference between stumeling around in the dark, and having lights on.

    So, if going along using the CM11.ocx or similar route, process the X10 in commands using the event (double click on the X10 icon on the VB6 or .NET app X10 control) x10comm_X10event. This event passes in the device (which includes the house code (e.g. "A10"), housecode ("A") and numeric command received. Making this switch was all the difference - 1000 commands processed, 1000 were spot on.

    Finally, it works. I post this, in the hope that anybody googling a solution to the CM11A control through a PC using the CM11A.ocx, who finds inbound commands are wrong or a bit off, will save the hair that I have pulled out over the last couple of months.
    __________________________________________________ _______________________
    My life is Home Automation, and my PS3 clan friends at http://www.ps3crowd.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •