CM11A X10 (serial)

Questions and comments specific to a particular plugin should go here.

CM11A X10 (serial)

Postby m3flyin2lo » Sat Jan 31, 2009 2:02 am

The CM11A X10 interface is natively supported via serial interface, no other software is needed. Most basic X10 commands are implemented. Events get generated for any command the CM11A receives from the powerline. Macro functionality is not implemented as I do not use it and do not think that it would add much to what Eventghost already offers.

The plugin automatically responds to CM11A's request to initialize after power failure. Besides X10 commands, it can also send a reset command that is helpful when the CM11A gets corrupted (which seems to happen every once in a while).

Code attached.
Attachments
SerialThread.py
Patched version of SerialThread.py.
If you have problems sending X10 commands, deploy this file in the eg/Classes directory.
(20.02 KiB) Downloaded 611 times
CM11A.zip
Version 0.3.2, updated 10/7/2009.
Unpack the content in the plugins directory.
(4.25 KiB) Downloaded 673 times
Last edited by m3flyin2lo on Wed Oct 07, 2009 2:39 am, edited 3 times in total.
m3flyin2lo
Plugin Developer
 
Posts: 22
Joined: Sun Nov 23, 2008 3:22 am

Re: CM11A X10 (serial) plugin

Postby atri7202 » Thu Mar 12, 2009 11:09 pm

i also have a CM11A and have tried you plugin but i get the following error when i try to do anything with it,

Stack trace (most recent call last) (851):
File "C:\Program Files\EventGhost\eg\Classes\UndoHandler\NewEvent.py", line 51, in Do
File "C:\Program Files\EventGhost\eg\Classes\TreeItem.py", line 81, in Create
File "C:\Program Files\EventGhost\eg\Classes\ThreadWorker.py", line 307, in CallWait
Traceback (most recent call last):
File "C:\Program Files\EventGhost\eg\Classes\MainFrame\__init__.py", line 352, in FuncWrapper
func()
File "C:\Program Files\EventGhost\eg\Classes\MainFrame\__init__.py", line 839, in OnCmdAddEvent
).switch(self.document)
File "C:\Program Files\EventGhost\eg\Classes\UndoHandler\NewEvent.py", line 51, in Do
item = document.EventItem.Create(parent, pos, name=label)
File "C:\Program Files\EventGhost\eg\Classes\TreeItem.py", line 81, in Create
self = eg.actionThread.CallWait(partial(cls, parent, node))
File "C:\Program Files\EventGhost\eg\Classes\ThreadWorker.py", line 309, in CallWait
"Timeout in %s.CallWait()" % self.__class__.__name__
Exception: Timeout in ActionThread.CallWait()

PLEASE HELP ME
atri7202
 
Posts: 14
Joined: Thu Mar 12, 2009 10:54 pm

Re: CM11A X10 (serial) plugin

Postby m3flyin2lo » Fri Mar 13, 2009 11:11 am

What version of Eventghost and what OS are you on?
m3flyin2lo
Plugin Developer
 
Posts: 22
Joined: Sun Nov 23, 2008 3:22 am

Re: CM11A X10 (serial) plugin

Postby atri7202 » Wed Mar 25, 2009 3:57 am

o wait nvm thanks for your offered help tho!! i fixed it on my own sorry it took me so long to reply
atri7202
 
Posts: 14
Joined: Thu Mar 12, 2009 10:54 pm

Re: CM11A X10 (serial) plugin

Postby philg » Wed Apr 15, 2009 1:35 am

Hi,

I have a CM11a and I'm trying to use this plug-in.
Forgive me if I'm asking something stupid, I've only found EventGhost today (and its looking very good so far).

I have been using my own X10 console app that I wrote in C# but I thought I would give this CM11a app a try as it would integrate much better (with events and all that) but I have a problem....

I'm using the latest release version of EventGhost (v0.3.5c.908) and it says, when I try and add the CM11a plug-in I see:
Code: Select all
Can't read __init__.py for plugin "CM11A"
in the log window.

Have I missed something stupid of is this a genuine problem? Is there any special configuration I need to perform?

If its important, I'm running on Windows Server 2008 x64 and everything else I have tried in EventGhost so far is working.

Thanks,
Phil
philg
 
Posts: 2
Joined: Wed Apr 15, 2009 1:32 am

Re: CM11A X10 (serial) plugin

Postby philg » Wed Apr 15, 2009 2:30 am

I have now tried the latest beta version (v0.3.6.1476) and have different results.
It still failed but I was able to fix it.

Bugs I have found so far:

Line 161: The open command passed too many arguments, the "8N1" seems to be the problem here. I remove it and it opened the port.

Line 333 (and others):
The second parameter to SendReceive , chr(header+cmd) gave an error because header+cmd = 256 in my case (command=brighter, brightness=95) which is not a valid character (chr). After looking at my C# code and the sendreceive function, I figured this return argument was not needed as such, so I changed ALL lines containing
self.SendReceive(chr(header)+chr(cmd), chr(header+cmd))
to
self.SendReceive(chr(header)+chr(cmd), chr(0))

Now it seems to work OK, but my X10 light switches don't send events, so there is actually no real benefit to me using this plug-in over my console app, which means I can also use the X10 device from other programs as the com port is not tied up all the time. So for now I will probably leave it as it was.

Thanks for the plug-in though - and I hope if anyone else has problems, this post may help sort it out.
Phil
philg
 
Posts: 2
Joined: Wed Apr 15, 2009 1:32 am

Re: CM11A X10 (serial) plugin

Postby m3flyin2lo » Wed Apr 15, 2009 3:04 am

The problems you are having are most probably due to the fact that you are not using the latest release. I would recommend 0.3.6.1487, that's the one I am running at it's been pretty stable. This release included some features that were added to the Serial interface for this plugin in particular (e.g. supporting odd/even parity).

I used to be in the same situation as you: running a separate Java-based X10 app. Eventghost + CM11a plugin makes things a lot easier, particularly when using the Timer plugin (to schedule events) or responding to events from other units.

Try this release and let me know if you still have problems.
m3flyin2lo
Plugin Developer
 
Posts: 22
Joined: Sun Nov 23, 2008 3:22 am

Re: CM11A X10 (serial) plugin

Postby m3flyin2lo » Wed Apr 15, 2009 3:10 am

philg wrote:I have now tried the latest beta version (v0.3.6.1476) and have different results.
It still failed but I was able to fix it.

Bugs I have found so far:

Line 161: The open command passed too many arguments, the "8N1" seems to be the problem here. I remove it and it opened the port.

Line 333 (and others):
The second parameter to SendReceive , chr(header+cmd) gave an error because header+cmd = 256 in my case (command=brighter, brightness=95) which is not a valid character (chr). After looking at my C# code and the sendreceive function, I figured this return argument was not needed as such, so I changed ALL lines containing
self.SendReceive(chr(header)+chr(cmd), chr(header+cmd))
to
self.SendReceive(chr(header)+chr(cmd), chr(0))

Now it seems to work OK, but my X10 light switches don't send events, so there is actually no real benefit to me using this plug-in over my console app, which means I can also use the X10 device from other programs as the com port is not tied up all the time. So for now I will probably leave it as it was.

Thanks for the plug-in though - and I hope if anyone else has problems, this post may help sort it out.
Phil


Good catch on the overflow bug, fixed and uploaded a new version.
Thanks!
m3flyin2lo
Plugin Developer
 
Posts: 22
Joined: Sun Nov 23, 2008 3:22 am

Re: CM11A X10 (serial) plugin

Postby 73challenger » Sun May 03, 2009 8:32 pm

I was wanting to try out your plugin but it says it does not exist anymore. I was wondering if you could upload it again. Thanks alot! I was to use this to dim my lights when movies are played :-) I use a command line program currently. Thanks a bunch!
73challenger
 
Posts: 2
Joined: Sun May 03, 2009 8:13 pm

Re: CM11A X10 (serial) plugin

Postby m3flyin2lo » Sun May 03, 2009 9:03 pm

73challenger wrote:I was wanting to try out your plugin but it says it does not exist anymore. I was wondering if you could upload it again. Thanks alot! I was to use this to dim my lights when movies are played :-) I use a command line program currently. Thanks a bunch!


Where are you trying to download it from? There is an attachment in the first post of this thread, with a ZIP file in it. Works fine for me. Did you try that one?
m3flyin2lo
Plugin Developer
 
Posts: 22
Joined: Sun Nov 23, 2008 3:22 am

Re: CM11A X10 (serial) plugin

Postby 73challenger » Sun May 03, 2009 9:09 pm

Thats weird...it works now! The link might have broke because i was using server 2008?
73challenger
 
Posts: 2
Joined: Sun May 03, 2009 8:13 pm

Re: CM11A X10 (serial) plugin

Postby m3flyin2lo » Sun May 03, 2009 9:17 pm

73challenger wrote:Thats weird...it works now! The link might have broke because i was using server 2008?


Out of the box Windows Server has all sorts of restrictions on websites and downloads through IE, maybe that was the issue.
m3flyin2lo
Plugin Developer
 
Posts: 22
Joined: Sun Nov 23, 2008 3:22 am

Re: CM11A X10 (serial) plugin

Postby vicx » Tue Sep 15, 2009 1:45 am

This plugin is almost working for me.
It talks to my CM12 (CM11A but Australian 240V model) but I get
CM11A Unknown event: 66
for A1 ON.

All commands are unknown events.

I will play around with python code but I am a n00b who hasn't done much numeric stuff during my learning of python basics.
vicx
 
Posts: 13
Joined: Sun Sep 06, 2009 11:34 am

Re: CM11A X10 (serial) plugin

Postby m3flyin2lo » Tue Sep 15, 2009 11:17 am

What version of Eventghost and Windows are you on?

One thing to try: in the __init__.py script for this plugin, search for "CM11A Unknown event" and a couple of lines above you will see a commented print statement. Uncomment it so that it shows the content of the buffer received from your CM12. Post that, it might help figure out what is going on.
m3flyin2lo
Plugin Developer
 
Posts: 22
Joined: Sun Nov 23, 2008 3:22 am

Re: CM11A X10 (serial) plugin

Postby vicx » Tue Sep 15, 2009 1:33 pm

OK no problem. WinXP EG 0.3.7.r1076

Code: Select all
11:20:33 PM   CM11A.ACK
11:20:33 PM   ('Buffer: 66', 1)
11:20:33 PM   CM11A Unknown event: 66
11:20:34 PM   ('Buffer: 020162', 3)
11:20:34 PM   CM11A.X10 'A.On'
vicx
 
Posts: 13
Joined: Sun Sep 06, 2009 11:34 am

Next

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 2 guests