X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: KLF on December 14, 2007, 05:27:00 PM

Title: Conditions, flags and module status
Post by: KLF on December 14, 2007, 05:27:00 PM
I'm new here and have been poking around trying to learn how to set up very basic automation, primarily for timed control of lights and relocation of manual light contols.  At first glance, AHP seemed to be pretty slick (especially being able to address ALL house/module  codes with one device)  but I seem to be discovering that it may really be quite crippled in function even with "Smart Macros." 

First question - what hardware modules can be polled to get their ON/OFF status? (I'll probably be using mostly Socket Rockets- for a number of reasons) 

Am I correct in my understanding that only *1* house code can be monitored for module status? (i.e. a maximum of 16 modules can be monitored)

This means that a nice convenient system of having garage lights on "G," kitchen lights on "K,"  living room lights on "L" and outdoor lights on "O"  may be nothing more than wishful thinking if I wanted to control each group with single "toggle" button. This would trigger a macro which, for each press of the button, would cycle to the next in sequence of,  for example, (1) OFF, (2) only light #1 on, (3) only light #2 on, (4)  #1 and #2 on. This would be based upon testing the ON/OFF condition of the modules for each of the lights.

And while I realize that there may be the possibility of using "flags" to keep track of the status of each module (only assuming it is always activated through AHP, right?), the whole system seems tremendously less flexible than I had originally thought. Anyone have any comments or guidance?

KLF
   
Title: Re: Conditions, flags and module status
Post by: Walt2 on December 15, 2007, 07:59:54 PM

First question - what hardware modules can be polled to get their ON/OFF status? (I'll probably be using mostly Socket Rockets- for a number of reasons) 
   

Very few.  They are called "2-way".  Matter of fact, I believe X10 has actually discontinued their two 2-way modules; LM14A and AM14A.

AHP/CM15A actually keeps track of the module status real time.  It rarely needs to poll a module to order to find out its current status.

Plus remember, there is no harm in turning 'off' a module that is already 'off', and likewise, there is no harm in turning 'on' a module that is already 'on'.


Am I correct in my understanding that only *1* house code can be monitored for module status? (i.e. a maximum of 16 modules can be monitored)
   

Well, AHP can keep track of all the modules.  It is only the CM15A which is limited (due to little internal memory) to keeping track of only 16 module's on/off status when running by itself (not attached to a PC running AHP).


And while I realize that there may be the possibility of using "flags" to keep track of the status of each module (only assuming it is always activated through AHP, right?), ...
   

There are only 16 flags, and I believe only 14 of them are actually available for general usage.


..., the whole system seems tremendously less flexible than I had originally thought. Anyone have any comments or guidance?
   

AHP/CM15A is more powerful than the AH/CM11A, but less powerful than the AH2/CM14A.  What I can suggest, is that many times if you change how you are attacking a problem, and try using a different strategy/approach, there is usually a solution that works within the AHP/CM15A's capabilities.
Title: Re: Conditions, flags and module status
Post by: Dan Lawrence on December 15, 2007, 10:27:49 PM
OK, for the uninformed, what's a AH2/CM14A?

I presume AH2 is an untested version of AHP.
Title: Re: Conditions, flags and module status
Post by: KLF on December 16, 2007, 12:06:24 AM
quote author=Puck link=topic=14153.msg78600#msg78600 date=1197677731]
I'm not sure what you mean by "relocation of manual light contols"?
Quote

Well, in simpler and clearer terms, "putting a switch where I want it"

Quote
Well, AHP can keep track of all the modules.  It is only the CM15A which is limited (due to little internal memory) to keeping track of only 16 module's on/off status when running by itself (not attached to a PC running AHP).

I'm really interested only in "computer free" operation. And that obviously severely limits the modules that can be "monitored."

Quote
AHP/CM15A is more powerful than the AH/CM11A, but less powerful than the AH2/CM14A.  What I can suggest, is that many times if you change how you are attacking a problem, and try using a different strategy/approach, there is usually a solution that works within the AHP/CM15A's capabilities.

Then can you (or anyone) suggest how to create a macro (without having to check module status) that will advance to the next "step" for any single push of a button?  For discussion purposes lets assume there are a number of 3 light arrays and for each one we want the sequence to include the following 5 steps: All-on, #1 on, #1 and 2 on, #1 and #3 on,   Alll-off.

I'm really looking for a interface that lets me do what I would like directly without having to become overly clever. I'm not looking for a hobby, I'm looking for a convenient way to control a few lights. If I need to use the SDK and program in another language I'll do that, although I have not yet seen how one would upload to the CM15A  using the SDK interface. I'd probably be using VB6.   

KLF

 
Title: Re: Conditions, flags and module status
Post by: Tuicemen on December 16, 2007, 01:13:48 PM
Quote from: Klf
Then can you (or anyone) suggest how to create a macro (without having to check module status) that will advance to the next "step" for any single push of a button?  For discussion purposes lets assume there are a number of 3 light arrays and for each one we want the sequence to include the following 5 steps: All-on, #1 on, #1 and 2 on, #1 and #3 on,   Alll-off.
If you have the SmartMacro plug-in you can do most of this. AHP only sends "All Lights ON" and  "All Units OFF" not "ALL ON"
To do what you want you need to use elses and flags as conditions! EG:
First time you press trigger#

Condition if Flag 1,2 off
send all lights on
set flag 1


Second time you press Trigger #
Else macro
condition if flag 1 set & flag 2 off set
send A1 on
Set flag 2


Third time you press Trigger #
Else macro
condition if flag 1,2 set
send all off
clear flag 1,2

You'd expand the use of flags to the number you wish in your case 5. Do an Advanced search on flags and conditions for more examples and suggestions
Title: Re: Conditions, flags and module status
Post by: KLF on December 16, 2007, 04:00:21 PM
If you have the SmartMacro plug-in you can do most of this. AHP only sends "All Lights ON" and  "All Units OFF" not "ALL ON"
To do what you want you need to use elses and flags as conditions! EG:
First time you press trigger#

Condition if Flag 1,2 off
send all lights on
set flag 1


Second time you press Trigger #
Else macro
condition if flag 1 set & flag 2 off set
send A1 on
Set flag 2


Third time you press Trigger #
Else macro
condition if flag 1,2 set
send all off
clear flag 1,2

You'd expand the use of flags to the number you wish in your case 5. Do an Advanced search on flags and conditions for more examples and suggestions


Thanks. That's pretty straightforward, but wouldn't it be simplest to just use a flag to represent each light?
But that would still require use of 9 flags for the scenario I described (3 arrays), correct?   

KLF
Title: Re: Conditions, flags and module status
Post by: Tuicemen on December 16, 2007, 05:37:05 PM
You need one flag per button press, if I understand what your trying to do correctly! The last button press clears the flags so a total of 4 flags(sorry I was wrong when I stated 5) for a 5 press scenario! If each of your scenarios is 5 button presses long then you'd need 4 X 3 flags = 12
If you assign a flag for each light you'd have to make 2  macros for each light, One when it was turned on it set the flag and another macro that when it turned off the flag was cleared! Then you'd still have to make a macro that responded to the button presses and since you can turn a module on with its own address your sequence press wouldn't work as desired! In the end you'd be making more work for your self! ;)
Title: Re: Conditions, flags and module status
Post by: Walt2 on December 16, 2007, 07:36:56 PM
OK, for the uninformed, what's a AH2/CM14A?

I presume AH2 is an untested version of AHP.

Nope, AH2/CM14A is product that never made it out of beta-test.   It was intended to be a follow-on to the AH/CM11A.

Think of AHP/CM15A with unlimited number of conditionals per macro, more conditional tests (like checking dim level), to be able to manually check and modify flags, control IR devices (like turn your TV 'on'),  set DST rules, do firmware updates, and much more.
Title: Re: Conditions, flags and module status
Post by: Walt2 on December 16, 2007, 07:47:27 PM
Will not the OP quickly run out of flags, if he does it this way?  I mean, expand your pseudo code to control, say, 36 light sets with 3 lights in each set.

Remember, the OP doesn't want to check module status because 16 is not enough.  That same limitation will also affect flags.

If you have the SmartMacro plug-in you can do most of this. AHP only sends "All Lights ON" and  "All Units OFF" not "ALL ON"
To do what you want you need to use elses and flags as conditions! EG:
First time you press trigger#

Condition if Flag 1,2 off
send all lights on
set flag 1


Second time you press Trigger #
Else macro
condition if flag 1 set & flag 2 off set
send A1 on
Set flag 2


Third time you press Trigger #
Else macro
condition if flag 1,2 set
send all off
clear flag 1,2

You'd expand the use of flags to the number you wish in your case 5. Do an Advanced search on flags and conditions for more examples and suggestions

Title: Re: Conditions, flags and module status
Post by: KLF on December 16, 2007, 08:15:10 PM
You need one flag per button press, if I understand what your trying to do correctly! The last button press clears the flags so a total of 4 flags(sorry I was wrong when I stated 5) for a 5 press scenario! If each of your scenarios is 5 button presses long then you'd need 4 X 3 flags = 12
If you assign a flag for each light you'd have to make 2  macros for each light, One when it was turned on it set the flag and another macro that when it turned off the flag was cleared! Then you'd still have to make a macro that responded to the button presses and since you can turn a module on with its own address your sequence press wouldn't work as desired! In the end you'd be making more work for your self! ;)


OK bear with me here. Wouldn't one flag per light work? 
Lets make the lights a1,a2,a3 and use corresponding flags 1,2,3
The trigger will be some other single button press

______________________________________
Trigger press #1    ;if all lights are off, turn 1 on
Condition if Flag 1,2,3 off
send A1 on
set flag 1

Trigger press #2    ;if 1 is on, turn on 1 & 2
Condition if Flag 1 set
send A2 on
set flag 2

Trigger press #3   ;if 1 & 2 are on, turn on only 1 & 3 
Else macro
condition if flag 1 set & flag 2 set         
send A2 off                                     
clear flag 2
send A3 on
set flag 3

Trigger press #3 ;if 1 & 3 are on, turn all on 
Else macro
condition if flag 1 set & flag 3 set
send A2 on
set flag 2

Trigger press #4  ;if all are on turn all off 
Else macro
condition if flag 1 set & flag 2 set & flag 3 set
send Alll off
clear flag 1,2,3
______________________________________

Isn't that just one macro? (it might be necessary to have three conditions at each step)

Please keep in miind that I have not actually used this stuff yet so I'm merely trying to demonstrate the logic to be used rather than be precise with regard to syntax, etc.
I do, however, have programming experience.

However even assuimg that my logic is correct I am still frustrated with the limited number of available flags. I would for instance like to control two such arrays of 4 or 5 lights in my kitchen alone.   

KLF
Title: Re: Conditions, flags and module status
Post by: Tuicemen on December 16, 2007, 09:39:09 PM
Walt2: Yes the OP would run out of flags but they want to press one button to run multiple macros,with lights on different Housecodes!  If you have a better method, please  do tell! ;)


KLF: you can't just assign a flag to a light they have to be told when to set/clear themselves
You need a macro to set\clear each flag for each light, flags can only be set cleared with a macro! However you show all the same housecode for your lights so in that case you could use House code "A" as the monitored house code and use the module condition as the if!
Quote
I do, however, have programming experience
This may be a problem as AHP seems to follow a logic that causes programmers to loose their hair! ;)
Quote
Please keep in miind that I have not actually used this stuff yet so I'm merely trying to demonstrate the logic to be used rather than be precise with regard to syntax, etc
Since this is the case search the forums for Posts on flag useage! Also visit the x10wiki  (http://kbase.x10.com/wiki/Main_Page) and read up on AHP and Smartmacros! AHP doesn't follow Logic the way Most Programmers see it! As you stated it has limitations understanding them all will help when & if you get it! ;)
Title: Re: Conditions, flags and module status
Post by: KLF on December 16, 2007, 10:58:39 PM

KLF: you can't just assign a flag to a light they have to be told when to set/clear themselves
You need a macro to set\clear each flag for each light, flags can only be set cleared with a macro!
I thought that was exactly what I was suggesting.  (1) Turn the light on and set its flag or (2) Turn the light off and clear its flag

Quote
However you show all the same housecode for your lights so in that case you could use House code "A" as the monitored house code and use the module condition as the if!
Two problems there as I understand it. (1) That precludes using "module conditions" for a different array using a different housecode (or, at best, just adds another 16 codes that can be checked) and (2) requires "two way" modules if WALT2's earlier response is correct about what is necessary to be able to poll modules.     

Quote
AHP seems to follow a logic that causes programmers to loose their hair! ;)
Hardly sounds like a strong recommendation for the system. And I said previously, I'm not looking for a hobby - I'm looking for some tools.   

Quote
... search the forums for Posts on flag useage!
Been there, done that. Couldn't find definitive answers to the questions I have asked (although I had not originally recognized that "flags" might even be necessary to accomplish the goal I described).  That why I asked question.  I downloaded the Smart Macros manual. It describes the basic concept but has almost no content about actually using the software. That's  not very encouraging about the whole system

Quote
Also visit the x10wiki  (http://kbase.x10.com/wiki/Main_Page) and read up on AHP and Smartmacros! AHP doesn't follow Logic the way Most Programmers see it! As you stated it has limitations understanding them all will help when & if you get it! ;)
Again, really not much helpful information there. I'm not looking for the sales pitch. I know what I want to do I'm just trying to figure out whether it's reasonably feasible. The problem I see with x10 in general is that it has not yet really made the transition from its origins 20+ years ago to the modern digital age.  This is perhaps best demonstrated by the extreme kludginess demonstrated here:
http://www.x10.com/products/x10_th2807.htm
With the Thermostat Controller, you can make sure your heating bills stay low. X10's Thermostat Set-Back Controller works like a lit match placed beneath your thermostat

If that comes from the same folks that created the software, I can see why the software lacks "logic."
The SmartHome Powerlinc is looking appealing, though I am having similar difficulty learning specifics of its operation. However Smarthome, to their credit, does provide a full download of their basic software so that it can at least be seen prior to puchase.

KLF



 
Title: Re: Conditions, flags and module status
Post by: Tuicemen on December 17, 2007, 04:34:54 PM

KLF: you can't just assign a flag to a light they have to be told when to set/clear themselves
You need a macro to set\clear each flag for each light, flags can only be set cleared with a macro!
I thought that was exactly what I was suggesting.  (1) Turn the light on and set its flag or (2) Turn the light off and clear its flag
Sorry I miss read your post  :-[ must have shoveled too much snow ;)

Quote
Quote
However you show all the same housecode for your lights so in that case you could use House code "A" as the monitored house code and use the module condition as the if!
Two problems there as I understand it. (1) That precludes using "module conditions" for a different array using a different housecode (or, at best, just adds another 16 codes that can be checked) and (2) requires "two way" modules if WALT2's earlier response is correct about what is necessary to be able to poll modules.     
In AHP you can set one of the 16 house codes to be monitored this doesn't require two way modules however if someone turns On/Off an module locally the CM15A only sees the last state that was sent from it! Same problem would happen with flags! :(

Quote
AHP seems to follow a logic that causes programmers to loose their hair! ;)
Hardly sounds like a strong recommendation for the system. And I said previously, I'm not looking for a hobby - I'm looking for some tools. 
Unfortunately  that is true! Many long time programmers have set the AHP software aside and use the SDK or another software such as Mr-house or HomeDomination! Others still have no problems with it! Sorry you didn't find what you were looking for at the wiki ::)
Quote
The SmartHome Powerlinc is looking appealing, though I am having similar difficulty learning specifics of its operation. However Smarthome, to their credit, does provide a full download of their basic software so that it can at least be seen prior to purchase.
SmartHome Powerlinc does have it's problems too. Check out AccessHA Forum (http://www.accessha.com/forums/index.php?) or the SmartHomes Forum (http://www.techmall.com/default.asp) and compare for yourself. I haven't used the SmartHome Powerlinc but others here and at AccessHA have used both!



 

Quote
Title: Re: Conditions, flags and module status
Post by: steven r on December 17, 2007, 10:08:58 PM
Quote
I do, however, have programming experience

This may be a problem as AHP seems to follow a logic that causes programmers to loose their hair!...
So very true!  :( ;)
e.g. Some have discovered that if you start an else with a delay it will execute regardless of the conditions.
Title: Re: Conditions, flags and module status
Post by: KLF on December 17, 2007, 11:05:58 PM
Unfortunately  that is true! Many long time programmers have set the AHP software aside and use the SDK or another software such as Mr-house or HomeDomination! Others still have no problems with it! Sorry you didn't find what you were looking for at the wiki ::)

I think I'm probably headed in that direction. I had the chance to play with the "Smart Macros" interface a bit. I have a hard time believing anyone who has used or created "good" software would consider that to be anything but junk. It's so crippled that it's hard to consider it to be any form of software at all. I had not realized that it offers NOTHING BUT the flimsy drag-and-drop interface, simple to use but with no flexibilty or power whatsoever.       

SmartHome Powerlinc does have it's problems too. Check out AccessHA Forumr the SmartHomes Forum and compare for yourself. I haven't used the SmartHome Powerlinc but others here and at AccessHA have used both!

Thanks for the additional links. I am still trying to fully grasp what the benefits and burdens might be if and when I jump into the SDK for either Activehome or Smarthome. Obviously Activehome is a lot "cheaper", but that may be true in every sense of the term. All-in-all, it appears the biggest loss in either may be the inability to use the "standalone" capabilities of the respective hardware devices. But given that I have some programming experience, the SDK programming may actually be easier and quicker than trying to outwit the "SMART MACROS" plug-in (an apparent oxymoron if there ever was one).

KLF 


 

Title: Re: Conditions, flags and module status
Post by: ltnitrobud on July 28, 2008, 08:31:04 AM
Wow, how many house's do you have?  Just kidding!  Your miss using house code when you should be using unit code since you only have one house.  However, you may want to use for example "A" for your camera's and motion sensors and lights, and use "C" for your appliance's and/or security alarms and door/window sensors.  By doing so you easily controll 16 combos of lights/cameras/etc on one remote with one letter code on it and not have to use a screwdriver or coin to change the house code every five minutes.  Once your thinking "unit" instead of "house" you will make everything easier to use and you'll start to understand how versitile x10 really can be.  Your only limit is your own ability to come up with new way's to use it and more money to expand what your doing with it...by buying more modules!  Have fun with it!  Don't get too serious or frustraited and if needed re-read the papers that come with each unit since it may not have made since the first time you read them, but they will make sense as you become more familiar with how and what each module is capable of doing!  I hope this helped...have fun!