Access Keys:
Skip to content (Access Key - 0)
 

CM15A, CM19A, and mochad

mmauka

On Apr 24, 2011 08:40

mochad is a Linux TCP gateway for the X10 CM15A and CM19A controllers. The Marmitek CM15Pro reportedly works with mochad as well. See http://sf.net/projects/mochad for details.

The controller with one change is able to send commands via a TCP socket to control an X10 lamp module. mochad wants '\n' at the end of the commands, not '\r'. Controller_2_0_0_Alpha11_telnet/src/org/openremote/controller/protocol/socket/TCPSocketCommand.java line 149. I can send a diff if someone tells me how to prevent this wiki from mangling pre-formatted text. It would be nice if the end-of-line character could be made a configuration option.

mochad commands are defined in Designer like this:
Name: b3on Protocol: TCP/IP IP Address: 192.168.1.254 (mochad host) Port: 1099 Command: pl b3 on
Name: b3off ... Command: pl b3 off
Name: b3dim ... Command: pl b3 dim
Name: b3bright ... Command: pl b3 bright

If you are using a CM19A instead of a CM15A change "pl" to "rf" in every command box.

Next create four buttons on a panel, one for each of the above commands. This has been tested on the Android SDK emulator. I currently do not own an iPhone or Android device so am interested in hearing if this works on a real device. It appears the command box can hold more than one mochad command. For example: Command: "pl b3|pl b4|pl b on". This should turn b3 and b4 on at the same time with a single button press.

It is not clear how to make the controller trigger a macro from a mochad event. The controller would have to open a TCP socket and read lines from mochad. For example, mochad reports events from DS10A door/window sensors so turning lights on (or turning a powerhorn on) based on DS10A events would be very useful. Or would some helper/bridge program have to listen for events from mochad then inform the controller via http/xml?

Thanks,
mmauka

 
Labels: , ,
Participants: Administrator , Tommi Pääkkö , Juha Lindfors , mmauka , Marcus Redeker , Juan Gutierrez
  1. Apr 24, 2011

    mmauka says:

    I was able to create a slider to control lamp brightness but it requires a dummy...

    I was able to create a slider to control lamp brightness but it requires a dummy sensor. The X10 lamp module is a receive-only device so there is no way to get its currently brightness level. Therefore, a polling sensor serves no purpose. However, the slider min/max values are bound to a sensor. Is there a way to eliminate the polling sensor but keep the min/max range for the slider?

    New command: Name: b3slidercmd Protocol: TCP/IP IP Address: 192.168.1.254 (mochad) Port: 1099 Command: pl b3 xdim ${param}
    New command: Name: b3intensitycmd ... Command: pl
    New sensor : Name: b3intensity Command: b3intensitycmd Type: range Min: 0 Max 63
    New slider : Name: b3slider Sensor: b3intensity setValue: b3slidercmd
    
    1. Apr 25, 2011

      Administrator says:

      May not be possible at the moment. Is there an issue with using a dummy, no-op ...

      May not be possible at the moment.

      Is there an issue with using a dummy, no-op sensor or are you looking to get rid of it purely for aesthetic reasons / simplify configuration ?

      1. Apr 25, 2011

        mmauka says:

        Nothing urgent about these issues. I will probably change mochad so it accepts l...

        Nothing urgent about these issues. I will probably change mochad so it accepts lines terminated with '\r' as well as '\n'. I should have thought of this before changing the controller source code.

        A dummy no-op sensor is a good solution. It was confusing at first but a howto did indicate a slider requires a sensor.

        Perhaps a similar dummy no-op sensor should be available when creating a switch widget. X10 appliance modules do not report on/off status.

        Thanks,
        mmauka

        1. May 10, 2011

          Juha Lindfors says:

          Hey, mochad does look like an interesting project – please do keep us up-...

          Hey,

          mochad does look like an interesting project – please do keep us up-to-date what happens there. Would be interesting to see if there are more areas where we can inter-operate.

          1. May 11, 2011

            mmauka says:

            I am working on a Chumby widget at the moment but will be back to make mochad wo...

            I am working on a Chumby widget at the moment but will be back to make mochad work better with OR. A few more changes to mochad are needed to report RF sensor data, on/off status, etc. X10 devices cannot be polled but mochad could track device state and report whatever it knows.

            1. May 22, 2011

              mmauka says:

              Using the X10 CM15A controller with OpenRemote 2.0 mochad, a Linux USB device d...

              Using the X10 CM15A controller with OpenRemote 2.0

              mochad, a Linux USB device driver for the CM15A (and the CM15Pro but not tested), has been updated to work with OpenRemote 2.0. See the following for details including screen shots of creating a brightness slider, an on/off
              switch, and an RF window/door contact sensor.

              http://sourceforge.net/apps/mediawiki/mochad/index.php?title=OpenRemote

              To get mochad source code see the following.

              http://sourceforge.net/projects/mochad/

              Moving the brightness slider on OR panel updates the position of the slider with the same X10 house/unit code on all other OR panels.

              Turning a lamp on using an X10 RF remote control updates the on/off status on all OR panels.

              Turning a lamp off using a Chumby updates the on/off status on all OR panels and vice versa.

              1. May 31, 2011

                mmauka says:

                Please be sure to use mochad 0.1.11. Using the XDIM (extended dim) command for t...

                Please be sure to use mochad 0.1.11. Using the XDIM (extended dim) command for the brightness slider uncovered a number of problems in this command that have been fixed in 0.1.11.

                http://mochad.sf.net

              2. May 28, 2011

                Juha Lindfors says:

                Thank you for these updates! If you prefer, you can add a CM15A section with mo...

                Thank you for these updates!

                If you prefer, you can add a CM15A section with mochad in the X10 How-to – this way the information can be a little easier to find than from forum comments.

                If you do and have issues with access rights, just let me know.

              3. May 29, 2011

                Juha Lindfors says:

                Ok, Pierce pointed me to the wiki documentation you already created here: http:/...

                Ok, Pierce pointed me to the wiki documentation you already created here: http://sourceforge.net/apps/mediawiki/mochad/index.php?title=OpenRemote

                Let me know if you'd be interested in maintaining one for the OR wiki in the How-to link I posted

                1. May 31, 2011

                  mmauka says:

                  I updated the X10 How-to as suggested. Let me know if this is OK or not.

                  I updated the X10 How-to as suggested. Let me know if this is OK or not.

                  1. Jun 01, 2011

                    Juha Lindfors says:

                    Yes, it's fine. If you want to bring the full how-to with screenshots and all t...

                    Yes, it's fine.

                    If you want to bring the full how-to with screenshots and all to this site, just let me know. Can make a space for it.

  2. Jun 18, 2011

    Tommi Pääkkö says:

    Hi Just wanted to pop in and confirm that CM15Pro does work quite good with moc...

    Hi

    Just wanted to pop in and confirm that CM15Pro does work quite good with mochad and OpenRemote. Currently I have very basic setup, only two lamp modules.

    Thanks to both OpenRemote and Mochad team for such a great work.

    1. Jun 28, 2011

      Juha Lindfors says:

      Thanks for confirming CM15Pro is working. Any additional material on how to set...

      Thanks for confirming CM15Pro is working.

      Any additional material on how to set things up, what hardware to buy, blog your experiences, or even a video that just shows how stuff is working are welcome. We can find space on the website for all of that.

      1. Jun 30, 2011

        Tommi Pääkkö says:

        Within a month I'll be moving to a new apartment which has about 20 X10 modules....

        Within a month I'll be moving to a new apartment which has about 20 X10 modules. I'll try to gather some details and write them down as soon as I get things working there. Those modules are mainly dimmer modules but there are some switches too.

        1. Jul 03, 2011

          Juan Gutierrez says:

          Hello, I have installed the mochad in Ubuntu an it works very good with CM15 Pr...

          Hello,

          I have installed the mochad in Ubuntu an it works very good with CM15 Pro! But using netcat... I can not install the controller in Ubuntu because a problem with the port 8080. Anybody could help me how to install the controller?? The only information that I could find is here at the botton of the page: http://www.openremote.org/display/docs/OpenRemote+2.0+How+To+-+Controller+Installation.

          Thanks a lot in advance.

          Juan

  3. Oct 03, 2011

    Tommi Pääkkö says:

    Hi Not sure where I should ask this, so I'm asking here. Some background first...

    Hi

    Not sure where I should ask this, so I'm asking here.

    Some background first. I've moved in to my new (old) house couple of months ago and been using X10 since. Few weeks ago I managed to get some time to setup Openremote for iPhone. Now my setup runs quite smoothly. Setup consists of some 15 modules currently, dimmers (LD11), appliance modules (AD10) and one motion sensor (MS13).

    Now I'm starting to experiment with scenes. If I have figured it out correctly I can create scenes with macros in Openremote. So here's the question. And I know it's partly mochad oriented. Is there a way for me to listen and interrupt the motion sensor signals based on the scene?

    Example: MS is located in my dressing room. Normally it switches dressing room lamp on and off based on... well motion. Works good. But I wan't to have a scene. Let's call it Sauna. In this scene I don't want the MS to act on motion. No control over light. When I switch Sauna scene off, everything returns to normal.

    I can configure the MS to send the commands to "empty" device eg. C1 (housecode A is for light, B is for wall sockets in my setup). I'm not sure if or how OR/mochad work together in such scenes. Does OR listen anything? Can it respond or act based on external command from mochad? Can mochad command OR? Is this kind of scene setup best done in OR? What kind of logic can mochad handle?

    Lot's of questions. Hopefully at least some of these can be answered.

    1. Oct 05, 2011

      Tommi Pääkkö says:

      Hi again Did some digging around and found out that there's no available code f...

      Hi again

      Did some digging around and found out that there's no available code for this. So I'm trying to build something up. If there's need for this kind of stuff I'll share it. If I ever get it working.

      The way my OR is set up now gets the state of lamp, if motion sensor triggers it. I think slider info gets transmitted too but now I don't have any other slider values than on and off.

      As for the scene implementation, I'm thinking of creating a script that listens to mochad. Scenes will be triggered through OR and target device will be a dummy device (house code + unit code). The script listens to a predefined scene group (house code) and triggers devices based on scene (unit code). Motion sensor will be handled so that it also triggers dummy device defined on the script and script triggers the real device based on the wanted result.

      If you have any comments about this please let me know. I've never done anything like this before. I'm a frontend web developer, not a programmer.

      1. Oct 06, 2011

        Marcus Redeker says:

        Coming version of OpenRemote will include a rule engine (Drools) which allows wh...

        Coming version of OpenRemote will include a rule engine (Drools) which allows what you are looking for.

        1. Oct 06, 2011

          Tommi Pääkkö says:

          Is there an ETA on release? This kind of thing sounds awesome. Will Drools be ...

          Is there an ETA on release? This kind of thing sounds awesome.

          Will Drools be able to act on motion sensor triggers? I know X10 as a protocol is a bit limited and CM15Pro as an interface doesn't really help. Perhaps the question is can I trigger rules from TCP protocol?

          Thanks

          1. Oct 06, 2011

            Marcus Redeker says:

            The plan is that every console command will go through the rules engine and also...

            The plan is that every console command will go through the rules engine and also each sensor update.
            This way you can have virtual buttons which only trigger rules (eg. activate "sauna-mode" or "night-mode").
            It would be possible to create a UDP/TCP listener protocol which takes TCP packets and triggers rules.
            No ETA yet.

Adaptavist Theme Builder Powered by Atlassian Confluence
Free theme builder license