Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: MS16a and 3 different macros / tasks  (Read 38223 times)

Gilbert

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 25
MS16a and 3 different macros / tasks
« on: September 03, 2007, 04:15:48 PM »

Hello,

I've AHP, smartmacros and different active-eye sensors and I want to manage this :

from 7am to 8pm, if the sensor is triggered, send an e-mail and chime,
from 8pm to midnight, activate the porch light,
from midnight to 7am, activate the big (anti-theft) light.

I've tried different ways to program it : timers and macros but the result is never accurate :

three different macros, with the same trigger (E1), but each macro has a separate condition (E1 is the address of the active-eye):

Triger condition E1 is ON and
the time is between 7:01 AM and 8:00 PM
end Trigger conditions
wait 5 seconds
... (next sequences)

Triger condition E1 is ON and
the time is between 8:01 PM and 00:00 AM
end Trigger conditions
wait 5 seconds
... (next sequences)

Triger condition E1 is ON and
the time is between 00:01 AM and 7:00 AM
end Trigger conditions
wait 5 seconds
... (next sequences)

------------------
Results : I receive sometimes the result on false hours, sometimes together...

Do you have any idea of this problem ?
Regards,
Gilbert

« Last Edit: September 03, 2007, 04:18:38 PM by Gilbert »
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: MS16a and 3 different macros / tasks
« Reply #1 on: September 03, 2007, 07:17:31 PM »

When using ELSEs, never start a macro with a delay.
Logged

Gilbert

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 25
Re: MS16a and 3 different macros / tasks
« Reply #2 on: September 04, 2007, 01:47:56 AM »

When using ELSEs, never start a macro with a delay.


Hu, I don't use else's here, just some delay and one condition (time between). But thank you for the info.
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: MS16a and 3 different macros / tasks
« Reply #3 on: September 04, 2007, 08:56:29 AM »

Triger condition E1 is ON and
the time is between 7:01 AM and 8:00 PM
end Trigger conditions
wait 5 seconds
... (next sequences)

Triger condition E1 is ON and
the time is between 8:01 PM and 00:00 AM
end Trigger conditions
wait 5 seconds
... (next sequences)

Triger condition E1 is ON and
the time is between 00:01 AM and 7:00 AM
end Trigger conditions
wait 5 seconds
... (next sequences)

When you have 3 macros that are all triggered by the same E1 ON, ELSEs are involved even if you didn't click on the ELSE button while writing the macros. ;)
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: MS16a and 3 different macros / tasks
« Reply #4 on: September 04, 2007, 12:08:14 PM »

...When you have 3 macros that are all triggered by the same E1 ON, ELSEs are involved even if you didn't click on the ELSE button while writing the macros. ;)
Gilbert: I recommend rewriting it with elses. I believe it will work then.

Puck: Are you saying if I had two macros using the same addresses one would act as an else to the other? Any logical way to determine which would be executed 1st and what what would happen if their conditions overlapped.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: MS16a and 3 different macros / tasks
« Reply #5 on: September 04, 2007, 12:25:58 PM »

[Puck: Are you saying if I had two macros using the same addresses one would act as an else to the other? Any logical way to determine which would be executed 1st and what what would happen if their conditions overlapped.

When editing a macro, if you enter an X10 trigger address that already exists for another macro, it will appear as an else to its predecessor. When this happens you will immediately see the cascading macro tabs at the top of the editor screen. The order of the tabs from left to right is the else order.

This is how elses can be created without physically clicking on the add else button.

Because AHP else statements do not execute as a true else (as most programmers are familiar with), for reliability, you must make sure that it is not possible for more than one set of conditions to be true throughout the else string of macros. I also found that if any macro in an else starts with a delay, AHP tends to treat the ELSE as an AND.
Logged

Boiler

  • Guest
Re: MS16a and 3 different macros / tasks
« Reply #6 on: September 04, 2007, 05:27:41 PM »

When editing a macro, if you enter an X10 trigger address that already exists for another macro, it will appear as an else to its predecessor. When this happens you will immediately see the cascading macro tabs at the top of the editor screen. The order of the tabs from left to right is the else order.

This is how elses can be created without physically clicking on the add else button.

Thank you Puck,
That little tidbit simplifies my life greatly.  I'm one of those "anal" types that writes everything out longhand before diving into the AHP interface.  I never knew that adding a second trigger automatically created an else statement.  I've been writing these out and painstakingly checking all my If's and else's.

Just tried this and it works like a charm.  Maybe it's me, but this method of adding an Else statement results in significantly less Brain Pain.

Thanks again,
Boiler
Logged

TakeTheActive

  • Hero Member
  • *****
  • Helpful Post Rating: 126
  • Posts: 1047
  • Old !@#$% Tinkerer!
Re: MS16a and 3 different macros / tasks
« Reply #7 on: September 04, 2007, 09:46:40 PM »


When editing a macro, if you enter an X10 trigger address that already exists for another macro, it will appear as an ELSE to its predecessor. When this happens you will immediately see the Cascading Macro Tabs at the top of the editor screen. The order of the Tabs from left to right is the ELSE order.

Thank you Puck,

That little tidbit simplifies my life greatly...

...Just tried this and it works like a charm.  Maybe it's me, but this method of adding an ELSE statement results in significantly less Brain Pain.

Boiler,

Without a dedicated TEAM of ACTIVE Community Organizers, what will keep this very useful " tidbit " from floating off into the "Corkboard Ether" (...just a collection of random facts, scattered in random replies, across random threads...) just like its predecessors? ??? :( :-[

Suggestions?

[Or, maybe BXVC -Bill- will simply (unjustly, IMHO) CENSOR me again for publicly speaking the truth regarding my ongoing dissatisfaction with what's been going on "Behind the Scenes" here, since multiple PMs to various Community Organizers proved futile...  :( :o >:( ]
« Last Edit: September 05, 2007, 01:58:46 AM by -Bill- (of wgjohns.com) »
Logged
Low Post Count != Low Knowledge - High Post Count != High Knowledge ;)

ADVICE TO X-10 NEWBIES FROM AN X-10 OLD-TIMER

Boiler

  • Guest
Re: MS16a and 3 different macros / tasks
« Reply #8 on: September 05, 2007, 12:03:31 AM »

Quote
Boiler,

Without a dedicated TEAM of ACTIVE Community Organizers, what will keep this very useful " tidbit " from floating off into the "Corkboard Ether" (...just a collection of random facts, scattered in random replies, across random threads...) just like its predecessors? ??? :( :-[

Suggestions?

[Or, maybe BXVC -Bill- will simply (unjustly, IMHO) CENSOR me again for publicly speaking the truth regarding my ongoing dissatisfaction with what's been going on "Behind the Scenes" here, since multiple PMs to various Community Organizers proved futile...  :( :o >:( ]

TTA,
I share some of your frustration.  The forum contains a wealth of information an knowledge.  However this information is difficult to access and "we" Oldtimers and Co's alike are guilty of the following:

  • Replying to common problems with short answers without referring to the Tutorials that could give the user the "complete" answer.
  • Engaging in short Q and A sessions that my be useful to the original poster but useless to others who follow (far to difficult to trace though 30+ Q&A sessions)
  • Jumping to conclusions without getting the details of the problem (again short Q&A).
  • General forum organization - organizing posts, topics, and CURRENT ISSUES so that visitors (registered and not) can access them easily.

Don't get me wrong, I plead guilty to most of the above.  I will try to change my ways.

At the same time, we are faced with a number of "new" modules that are rewriting the way we use AHP.  This should be a HUGE BANNER presented on entry to the forum.  We've already had many users (both new and old) that have had problems with these units (and these are only the registered users - who knows how many users we've lost). 

We've recently been called egomaniacs and other names on a couple of threads.  I don't believe that for a second.  I do believe that many of our forum visitors get extremely frustrated trying to organize and make sense out of the scattered information on the forum. 

BTW - I chose this forum several months ago because it seemed to be the only "active" and "relevant" forum.  I still believe that to be the case.  Nonetheless, we really need to step things up (CO's and regulars alike).

TTA - of the above, the only thing that I see as objectionable is your last comment aimed at BXVC -Bill.  I read your original post, but I can't honestly say that I remember the "censored" section.  Nonetheless, based on what I've seen, I trust Bill to do the right thing according to the forum Etiquette rules (I believe you helped write these).

PM's and Thread replies welcomed,
Boiler

« Last Edit: September 05, 2007, 08:23:00 PM by Boiler »
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: MS16a and 3 different macros / tasks
« Reply #9 on: September 05, 2007, 12:59:23 PM »


Without a dedicated TEAM of ACTIVE Community Organizers, what will keep this very useful " tidbit " from floating off into the "Corkboard Ether" (...just a collection of random facts, scattered in random replies, across random threads...) just like its predecessors? ??? :( :-[

Suggestions?

Actually this is why I created the "Helpful Tips and Suggestions" threads for each of the Plug-ins!

In these I requested help from other COs as well as users to keep these "tidbits" from getting buried in a sea of questions or creating a Sea of stickies!
To Date: No other CO has added a link, ??? ::) although some have: split the topics, or made some modifications to the threads without adding any Value to the thread!
Note: This tidbit is now linked from Topic: Helpful Hints and Suggestions (Smart Macros)  (Read 5331 times)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

HA Dave

  • Hero Member
  • *****
  • Helpful Post Rating: 175
  • Posts: 7127
Re: MS16a and 3 different macros / tasks
« Reply #10 on: September 05, 2007, 09:28:15 PM »

Puck thank you for such great and HELPFUL information! (And congratulations... as I see your nearing the record on helpfuls)

And despite what others may say fear not.. your post will not be lost. The very words contained in the post serve as meta-tags, and will allow for searchable results by future users.

Data is accumulating in such large volumes that humans will never be able to keep it properly categorized and organized. Thank God (and Bill Gates) that we have computers to sort through these mountains of posts for us.

Fortunately... this is a Community forum. Our concern for the other members... (not the information)... is at the very heart of the Community.
« Last Edit: September 05, 2007, 09:34:41 PM by Dave_x10_L »
Logged
Home Automation is an always changing technology

Gilbert

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 25
Re: MS16a and 3 different macros / tasks - (timer for switches not for macros ?)
« Reply #11 on: September 22, 2007, 10:11:52 PM »

I tried different ways to do my job.

Now, it works with 3 dummies :
one switch (transceiver appliance with poll) ON from 6am to 8pm (timer set),
one switch (transceiver appliance with poll) ON from 8pm to 0am (timer set),
one switch (transceiver appliance with poll) ON from 0am to 6am (timer set).

and it works perfectly if I create my 3 macros with switch state check (E1 is the ws16 and macro address):

Trigger Conditions E1 ON and
Module Status ON - DUMMY 06-20
END Trigger Conditions
... (next steps)...

Trigger Conditions E1 ON and
Module Status ON - DUMMY 20-00
END Trigger Conditions
... (next steps)...

Trigger Conditions E1 ON and
Module Status ON - DUMMY 00-06
END Trigger Conditions
... (next steps)...

BUT, why the simple option of setting a timer into the macro doesn't work ? That's why timer are made for, no ?

Like :

Trigger Conditions E1 ON and
Time is between 00 am and 06 am
END Trigger Conditions
... (activation of switches)...

I understand the idea of dummies and flags, but is the timer function working only for devices and not for macro's ? If I put timers with devices, all is OK, but never with macros. If the answer is NO TIMERS inside MACROS, why this option is available ?

BTW, may I use any ghost switch for dummies or should I use switches with poll function (and then, what's the use of that poll feature) ?

BTW 2 (...) : what can I do to avoid multiple runs (within seconds) with that macro when the ws16a is detecting someone ? Use flags to delay the different steps or for blocking multiple runs ? Or should I change the delay inside the ws16 ?
The idea is to run the macro only once in between 5 minutes.

Thank you
Gilbert

Logged

svcguy

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 14
Re: MS16a and 3 different macros / tasks
« Reply #12 on: August 12, 2008, 01:06:23 AM »


Because AHP else statements do not execute as a true else (as most programmers are familiar with), for reliability, you must make sure that it is not possible for more than one set of conditions to be true throughout the else string of macros. I also found that if any macro in an else starts with a delay, AHP tends to treat the ELSE as an AND.


Not to bring up an old thread (>*<), but what if I *DID* want all three conditions to be checked?  Should I use a delay first.  My scenario is this:

MS16 - set to H5
Camera - set to J1
Chime - set to K1
Socket Rockets (2) - set to D5

When the H5 triggers, I want the lights at D5 to come on *always*, my record J1 macro to start *always* and my chime K1 macro to start only between 8:00am and 10:00pm.  In that order.

My record J1 macro goes like this

Condition:  Flag 1 is OFF
  Turn Flag 1 ON
  Select Camera J1
  Take Snapshot
  Begin Recording
  Delay 20 sec.
  Stop Recording
  Turn OFF J1
  Delay 2 min ( to finalize recording, else sometimes AHP crashes)
  Turn Flag 1 OFF

My Chime K1 macro goes like this:

Condition Flag 2 OFF
  Turn Flag 2 ON
  Chime K1
  Delay 30 sec
  Turn Flag 2 OFF

So, just do I add a delay (5 sec) to the start of each macro to get them all to start? ???

Thanks,
Andy
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: MS16a and 3 different macros / tasks
« Reply #13 on: August 12, 2008, 09:17:43 AM »

svcguy: For your example I suggest simply creating an ELSE macro with the two separate scenarios and the time conditions to determine which one executes. The leading delay in a macro and its tendency to execute all macros is a software bug and although it may work and do what you want, it may lower the the reliability of your setup. So whenever there is a more stable way of performing an action, it would be best to take that route. Plus you never know when an update may come out and this bug gets fixed.  ::)
Logged

svcguy

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 14
Re: MS16a and 3 different macros / tasks
« Reply #14 on: August 13, 2008, 08:57:57 PM »

Puck, I like your idea and am going to try it out.  I did, however, come up with another solution. 

I created a master macro Back Motion ON triggered by H5 ON:
D5 ON                         //  Turn Back Porch Lights ON
Delay 5s                       //  Delay required or else it doesn't function properly
M2 ON                         //  Dummy module (2-pin appliance) that triggers Back Door Chime Macro
Delay 5s                       //  Delay required (see above)
M3 ON                         //  Dummy module (2-pin appliance) that triggers Record Back Door Macro

and Back Motion OFF triggered by H5 OFF
D5 OFF                        //  Turn Lights OFF
M2 OFF                        //  Housekeeping; not really needed
M3 OFF                        //  Housekeeping; not really needed


This way my tested and working Back Door Chime and Record Back Door Macros can be left intact.  For whatever reason, without a delay it didn't quite work properly.  It seemed that it tried to do everything at once resulting in M3 turning on before M2 ( ??? ), and the Back Door Chime Macro never firing.

We will see.  They work and I'll field test them in the coming days to see if they hold up.

Andy
Logged
Pages: [1] 2
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.