more G-Labs products

Author Topic: How to send X10 All On or All Off  (Read 8738 times)

March 30, 2016, 05:05:03 AM
Reply #45

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
I hate to bring this one up again but I cant believe I am the only one who wants an AllOn or AllOff X10 command that works well.  The API command in 514 seems to individually send ON and OFF to each address... and of course that takes a long time to complete.

The best thing I can think of, is to add a low level command function for the CM15 as was posted earlier so that we can send the precise data packet necessary for whatever command we want to send. 

I am not sure I want to embark on that project... but it really is holding me back from where I want to go with my automation setup...

Anyone have any thoughts on this?

March 30, 2016, 04:41:15 PM
Reply #46

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
This might not be as difficult as you think.  All X10 commands take place in a single module that you can view on github.  If you check out the xtenlib file there, you can see all the functions.  It would be possible to code in your own and submit a pull request for Gene to consider.  There's nothing wrong with coding in your own function and just running that version locally if it solves your problem.  I've run custom versions in the past to resolve temporary issues while Gene was working on the main branch in the past.  Once you get set up to compile, making changes is pretty easy.

This is where the compiled dll is on github.
https://github.com/genielabs/HomeGenie/tree/master/Externals/g-labs

I haven't messed with things since it's been moved to an external library.  But, this can be compiled separately and tested on its own supposedly.
https://github.com/genielabs/x10-lib-dotnet

March 30, 2016, 08:16:32 PM
Reply #47

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Mr Kenobi,  have you compiled it on Linux?    I might want to go that route...

March 31, 2016, 06:37:12 AM
Reply #48

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I have not.  I compiled with VS2013 as I recall, but I know there are a couple people here that have used Linux to compile.

March 31, 2016, 04:38:02 PM
Reply #49

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Thank you.   The funny thing is that now that I am back on 512 it appears some of my x10 issues have gone away (so far)...   so maybe I'd have to compile my own fork of 512...    I dont know... I'll have to think it over.  I didnt want this to be another engineering project  :)

All I want is a stinkin "panic button" routine that turns all the lights on quick...   maybe I need to re-think things a bit. 

As always,  thanks!

March 31, 2016, 04:58:08 PM
Reply #50

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
If things work in 512 but not 514/515, you could look at the history between those versions and see if anything sticks out.  Github offers that capability if you can figure out how to use it.  I have used it a couple times but have to relearn each time.

Alternately, if you have an IDE with a compare feature (most do), you could download the X10 related files for both versions and do a diff on them.  For something that simple, Notepad++ would work well.

March 31, 2016, 09:27:04 PM
Reply #51

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
Kevinv, I've also noticed strange behaviour with x10 in rc514. Just updated to rc515 so I'm keeping a close eye on it. I wonder what changes were made from rc512 to rc514 to cause this.

I'm also puzzled as to why the AllLightsOn/Off wasn't implemented in HG. It's present in Active Home Pro and works fine.

March 31, 2016, 10:10:49 PM
Reply #52

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Hi Pete,  thanks for the information and confirmation.

It seems to me that there is an API call for  AllLightsOn  and in 514 can be accessed from C# but the thing I didnt like there is that it seems to just cycle through all the addresses turning each one on as opposed to sending the actual X10 All On command which would turn the entire house code on at once.

I'd love to hear your experience with 515 ...   I cant make the move back up there real soon b/c it seems to take too long to deal with whatever bugs show up. 

I wish I had time to be a developer and help fix and add features but alas-  cant seem to fit it all in.

I actually contemplated implementing my AllOn functionality WITHIN AHP and the CM15 but that sounds to cobbled together... I was trying to get a reasonably reliable and hack-free system  :)

April 01, 2016, 04:54:28 PM
Reply #53

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I wouldn't use AHP for that personally.  If I were going to cobble something together, I'd try to call a mochad command.  But, it would be much cleaner to implement the X10 command in the HG libraries rather than cobbling anyway.

BTW, if you guys could briefly summarize the X10 abnormalities that you've seen I'd appreciate.  I'd like to have a list of what people are seeing so we can verify that it's not a setup fluke vs a real bug.  I've seen some strange behavior as well that I've documented in a thread here as well as an issue on github.  So far, my issue has only been captured 2x and I still don't know the source (though I'm certain it's HG related as I've isolated other causes).

April 01, 2016, 04:59:17 PM
Reply #54

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Thanks obi-wan,  Your input is always valuable.

The strange stuff I saw with 514 was basically mis-decoded commands.   Now... I havent tested it THOROUGHLY back on 512 but what I saw was that when I would send a command like A2,   HG would report A6 or something like that.

Seems strange I know.   I'll test more on 512 and see if that behavior truly is gone.

April 04, 2016, 05:20:31 PM
Reply #55

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Are these RF or PLC?  That's very peculiar.  A2 and A6 are very different hex codes, so those shouldn't get confused.  PLC for A is (0110 or 6) which is apparently not getting confused.  But UC 2 = 1110 or E while UC 6 = 1001 or 9.  The binary is so different that if those are good examples, HG must be doing something strange.  I've heard that M13 is a bad code to assign to a module since it's just zero (M=0000, 13=0000) and can be triggered by noise.

On the other hand, if this is RF, then there is more similarity between commands.  Looking at:
http://www.micheldalal.com/sw/java/x10/docs/docs/cm17a_protocol.html

A2 ON           01100000   00010000
A6 ON           01100000   01010000

A2 OFF          01100000   00110000
A6 OFF          01100000   01110000

The only difference is a bit switch in the second word.  Since RF commands are sent several times in a row and the controller will repeat each onto PLC, if one command gets slightly messed up, it could turn the wrong module on/off potentially.  I have never seen this, but I see no reason why it couldn't happen.

April 06, 2016, 02:16:42 AM
Reply #56

petediscrete

  • ****
  • Information
  • Sr. Member
  • Posts: 220
I can't nail exactly what my difficulties were with rc514 Bkenobi as the problems were intermittent. Delays in x10 commands being performed and in some cases not at all. Problems using Generic IP Camera module, feeds intermittent or failing altogether. Email notification in some cases not being sent.

So far I've not encountered these problems using rc515 and it definitely feels a lot more stable. Gene mentioned sorting some issues with the latest version of Mono. Maybe this has resolved some issues.

Speaking of Gene I wonder is he away in sunnier climes. Hope all is well with him.

April 06, 2016, 05:16:23 PM
Reply #57

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Gene has been posting in the last week or two, so he's back from his time off it seems.