more G-Labs products

Author Topic: ALL ON / ALL OFF for X10  (Read 1277 times)

June 06, 2016, 09:50:59 PM
Read 1277 times

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Hello,

The current implementation of X10 All/On    All/Off  cycles through all the module codes in sequence like this:

A1 ON
A2 ON
A3 ON
etc


X10 however supports an ALL ON command that will turn all units on at the exact same time.

It would be GREAT if HG could implement this native X10   ALL ON  / ALL OFF command as it would drastically speed up turning on an entire house code for things like panic buttons or security systems.

Thanks for your consideration.

June 06, 2016, 10:29:28 PM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
True!  If you had as an example an entire house code used for lights and wanted to turn all of them on at the same time, there are 3 approaches that yield wildly different implementation times.  This assumes a script taking no time, and perfect reception on your PLC without interference.

Manual:  (hail module, turn it on, move to next)
Code: [Select]
command cycles time cumulative time
E1 25 0.417 0.417
E1 ON 25 0.417 0.833
E2 25 0.417 1.250
E2 ON 25 0.417 1.667
E3 25 0.417 2.083
E3 ON 25 0.417 2.500
E4 25 0.417 2.917
E4 ON 25 0.417 3.333
E5 25 0.417 3.750
E5 ON 25 0.417 4.167
E6 25 0.417 4.583
E6 ON 25 0.417 5.000
E7 25 0.417 5.417
E7 ON 25 0.417 5.833
E8 25 0.417 6.250
E8 ON 25 0.417 6.667
E9 25 0.417 7.083
E9 ON 25 0.417 7.500
E10 25 0.417 7.917
E10 ON 25 0.417 8.333
E11 25 0.417 8.750
E11 ON 25 0.417 9.167
E12 25 0.417 9.583
E12 ON 25 0.417 10.000
E13 25 0.417 10.417
E13 ON 25 0.417 10.833
E14 25 0.417 11.250
E14 ON 25 0.417 11.667
E15 25 0.417 12.083
E15 ON 25 0.417 12.500
E16 25 0.417 12.917
E16 ON 25 0.417 13.333

collective: (hail all modules, turn all on with single ON command)
Code: [Select]
command cycles time cumulative time
E1 25 0.417 0.417
E2 25 0.417 0.833
E3 25 0.417 1.250
E4 25 0.417 1.667
E5 25 0.417 2.083
E6 25 0.417 2.500
E7 25 0.417 2.917
E8 25 0.417 3.333
E9 25 0.417 3.750
E10 25 0.417 4.167
E11 25 0.417 4.583
E12 25 0.417 5.000
E13 25 0.417 5.417
E14 25 0.417 5.833
E15 25 0.417 6.250
E16 25 0.417 6.667
E ON 25 0.417 7.083

native: (utilizing the all on command)
Code: [Select]
command cycles time cumulative time
E All ON 25 0.417 0.417

So, with the worst case implementation it could take over 13 seconds to turn all lights on.  HG uses the second approach and it could take 7 seconds.  If the native X10 command were implemented, it would take ~0.4 seconds to turn on the lights for a house code.

EDIT:  I asked a similar question at the X10 forums 2 years ago and was given a very detailed response.
http://forums.x10.com/index.php?topic=28743.msg160924#msg160924
« Last Edit: June 06, 2016, 10:31:08 PM by bkenobi »

June 07, 2016, 03:39:36 AM
Reply #2

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Thanks sir,

I have been wondering off and on if I could do a system call to mochad from HG to get the ALL ON/ALL OFF functionality I desire but that just seems too kludgy...  so I'll see if Gene might be interested in implementing.

June 07, 2016, 04:32:35 PM
Reply #3

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
It's not ideal, but I think it would work out ok.  Mochad is a service that sits in the background and waits for a command.  If you use HG to send that command with a wget, you probably could do this with a very simple wizard or c# script.  It would be nicer to not need this extra step, but I think it would make your system work a little smoother.

June 07, 2016, 11:46:00 PM
Reply #4

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
HG already supports this through API calls:

/api/HomeAutomation.X10/A/Control.AllLightsOn

/api/HomeAutomation.X10/A/Control.AllLightsOff

where 'A' is the house code.


June 07, 2016, 11:53:50 PM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
kevinvinv is suggesting that when the API call is made, it sends a command to each light in the 'A' HC and then the ON command.  There is a native command that X10 supports to send a A ALL ON or ALL OFF command.  Doing so eliminates the need to send the addresses to each UC.  I have not tested this recently but as I recall, sending the API command results in a string of PLC commands that address the lights and then one to command them ON or OFF.  Perhaps it has changed recently though.

June 07, 2016, 11:57:57 PM
Reply #6

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
it is the native one.

June 08, 2016, 12:04:28 AM
Reply #7

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
kevinvinv is probably referring to the "group lights on/off"  from the ui?

June 08, 2016, 12:14:04 AM
Reply #8

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Hmm,   I am confused (not unusual).

When I run the API commands:

/api/HomeAutomation.X10/A/Control.AllLightsOn
/api/HomeAutomation.X10/A/Control.AllLightsOff

I see the lights in house code A turning on one after the other...  as if controlled by a loop.

I looked through the code and dont see anywhere where there is an actual X10  ALL ON command issued but I EASILY could have missed that.  I recall seeing a loop that sends ON to each of the unit numbers consecutively.

I guess I dont know what the group all on commands are but I'd LOVE to find out how to turn on every single light in house code A at the SAME exact time like the X10 ALL ON command does.  I certainly am not seeing that with the above referenced API calls.

Are we all talking the same language?

Thanks for your help everyone!!!  Would love to hear what you have to say about this.  Perhaps I am missing something important.

June 08, 2016, 12:18:16 AM
Reply #9

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer

June 08, 2016, 12:26:12 AM
Reply #10

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Will try again tonight.  I havent looked at it for a few versions.  Thanks!

June 08, 2016, 12:30:15 AM
Reply #11

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
you're welcome. This was already asked before, I hope it's cleared now.

June 08, 2016, 02:37:49 AM
Reply #12

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196

Well, sure enough-  it seems to work.

The last time I tried it was on R514 and the discussion you probably are referring to is here:
http://www.homegenie.it/forum/index.php?topic=1341.30

Thanks!!!

June 08, 2016, 04:54:47 PM
Reply #13

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I should have verified myself but I remembered when this was asked a while back.  I assumed that since it came up again, it was still an issue.  The command is used where Gene linked and the hex code is defined here:

https://github.com/genielabs/x10-lib-dotnet/blob/7237ac14fb475cf19a9fceeff36e139b18772c1c/XTenLib/Enums.cs#L37
« Last Edit: June 08, 2016, 04:59:10 PM by bkenobi »

June 08, 2016, 06:04:27 PM
Reply #14

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196


Either it didnt work that way back in R514 when I last tried it OR (more likely) I got confused b/c I saw a sequential enabling in the log file.

It still does show this sequential enable/disable in the logfile but I think that is just updating the widget status- not actually enabling/disabling the modules sequentially.

The other problem back in R514 was that there was this "cant create new program" bug so I got probably a little disoriented with the details of what I was observing.

ANyway... I am REAL happy that it is working now!!!!