Please login or register.

Login with username, password and session length

Author Topic: More problems with conditionals macros  (Read 16815 times)

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
More problems with conditionals macros
« on: November 23, 2004, 11:17:33 AM »

I've developed a love / hate relation for
the conditionals macros. (I refuse to call
them smart macros till I can get one to
work the way they're suppose to work.)

My latest test simply tests a time range
during the if condition with no conditions
in the else.

Based on my understanding, I expected it to
execute the if during the time and the else
all of the other time.

It executes the if all the time even
outside the range.

For what its worth, this is the code it
generates.

<macro name="TEST 1" code="P1" trigger="1"
id="4000024" moduleid="2000045"
ts="127456987861674368" download="1" >
<el cmd="4" area="3" room="1000004"
target="1000004" />
<el cmd="7" area="1"
target="2000010" level="100" />
<conditions>
<el condition="8"
operand="5" operation="0" timehour="9"
timemin="0" condition2="0" operand2="4"
timehour2="10" timemin2="55"  />
</conditions>
</macro>
<macro name="Test else 1" code="P1"
trigger="1" id="4000026" moduleid="2000047"
ts="127456964573287312" download="1" >
<el cmd="4" area="3" room="1000004"
target="1000004" />
<el cmd="7" area="1"
target="2000024" level="100" />
</macro>
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. :)

kevinw

  • Guest
Re: More problems with conditionals macros
« Reply #1 on: November 23, 2004, 04:27:41 PM »

Steven R,
This should work.  It should execute
the "test 1" macro during the condition
time and the "test else 1" macro outside
the condition.  One comment though, the
commands to execute are the same for both
the IF and the ELSE macro.  They should be
different to be able to tell the difference
between the two, right?
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: More problems with conditionals macros
« Reply #2 on: November 23, 2004, 11:36:25 PM »

The way it was explained to me is that the
the if the conditional is true it executes
otherwise it moves on to the next else.

I've been using the wizard to create my
conditionals. I've just discovered that if
I create an if with "it's between hours I
specify", it doesn't work. On the other
hand if I use "It's after the time I
specify" followed by "It's before the time
I specify", it works.
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. :)

rick j

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 10
Re: More problems with conditionals macros
« Reply #3 on: November 25, 2004, 04:04:36 AM »

I've found that when I used between I need 2
entries so I'll set a flag and I'll use that
flag as a condidtion in my elses to do what
I need...
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: More problems with conditionals macros
« Reply #4 on: November 30, 2004, 10:40:22 PM »

This problem still exists with version
3.170!

I've been using the wizard to create my
conditionals. I've just discovered that if
I create an if with "it's between hours I
specify", it doesn't work. On the other
hand if I use "It's after the time I
specify" followed by "It's before the time
I specify", it works.
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. :)

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: More problems with conditionals macros
« Reply #5 on: December 01, 2004, 01:29:04 AM »

3 more problems...

Time range won't wrap over midnight. (May
have existed before 3.170.)
e.g. An after 12:01 am and before 12:10 am
works but an after 11:00 pm and before
12:10 am doesn't work.

Time range is off by 1 minute. (Existed
before 3.170.)
e.g. An after 12:00 am and before 12:20 am
is true until 12:21 am. i.e. It will
execute at 12:20 am!

AHP update flag isn't totally cleared after
downloading.  (Existed before 3.170.)
e.g. I edit a macro. The download macro
icon appears. I download marcos and timers.
The icon clears. I click on the room where
the macro is. Poof.. The AHP download icon
reappears telling me I need to download
macros again.
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. :)

X10 Pro

  • Hero Member
  • *****
  • Helpful Post Rating: 23
  • Posts: 1416
Re: More problems with conditionals macros
« Reply #6 on: December 01, 2004, 01:39:08 PM »

We're looking at the problem with between
times in the Condition Wizard. It could be
that we fixed the problem only in Advanced view.

We'll fix the download icon problem, too.
That should be pretty simple.

Because the CM15A interface works on a day
that goes from midnight to 11:59 PM, the
condition "After 11 PM AND Before 12:10 AM"
will never be true -- after 11PM is 11:00 to
11:59, and before 12:10 is from 12:00 to
12:10 AM. If you do this as an OR ("After
11PM OR Before 12:10 AM") it will work. It's
counterintuitive, I know, but that's how it
works.

The time ranges in conditions are always
inclusive. That is the interface checks to
see if the time is less than or equal 12:20
AM, not just less than. If you adjust your
range to account for that you'll be OK.
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: More problems with conditionals macros
« Reply #7 on: December 01, 2004, 11:31:38 PM »

Thanks!

As long as AHP can be programed to work
consistently in a repeatable and
predictable manor, I can live with it being
counterintuitive and off a minute. :)
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. :)

donald mcmow

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 306
Re: More problems with conditionals macros
« Reply #8 on: December 01, 2004, 11:41:44 PM »

You guys all have to remember that the
SECONDS are not looked at when any of the
time checks azre made. the program only
looks at hours and minutes. Since ALL of
the programing within AHP is setup to
acount for Hours and Minutes only your
macro checks will disreguard the seconds. I
can't think off hand where you would need
to worry about anything less than a minute
in a home situation - normally there is
nothing that critical running that needs to
be watched that closely.
Logged

steve

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: More problems with conditionals macros
« Reply #9 on: December 02, 2004, 10:26:44 AM »

"SECONDS are not looked at when any of the
time checks are made". Is this true for the
delay feature?  Wait 5 seconds  becomes 1
minute?
Logged

donald mcmow

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 306
Re: More problems with conditionals macros
« Reply #10 on: December 02, 2004, 10:32:51 AM »

No - delays are counted to the second -
only where you can not enter the seconds is
this a factor. Delay's allow for the entry
of seconds - the other time checks do not
allow for the entry of seconds and as such
your macro/event will run up to 59 seconds
later than when you might expect it to. I
don't think that would affect anything
unless you needed something to execute with
a resolution of seconds rather than minutes.
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: More problems with conditionals macros
« Reply #11 on: December 02, 2004, 11:39:30 AM »

"You guys all have to remember that the
SECONDS are not looked at when any of the
time checks azre made. the program only
looks at hours and minutes...."
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. :)

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: More problems with conditionals macros
« Reply #12 on: December 02, 2004, 12:11:01 PM »

Disregard previous incomplete message. I
submitted by mistake.

"...Since ALL of the programing within AHP
is setup to account for Hours and Minutes
only your macro checks will disregard the
seconds...."

I still logically would had expected a
condition "before 10:00 pm" to be false at
10:00 pm.

"...I can't think off hand where you would
need to worry about anything less than a
minute in a home situation."

True but for testing purposes it's nice to
know where the condition ends. I also have
a light set to go off randomly between
midnight and 1:00 am. If I'm doing a
conditional "reset" of lights just before
midnight, it is important not to have them
overlap.

e.g. I have a shutdown macro that turns
most everything off when triggered. It
calls another macro to see if the front
light should be on. If it is before 12:00
am the light needs to be turned back on.
Knowing that AHP tests for "less than or
equal" and not "less than" allows me to set
my less than time for 11:58 pm to insure
the light in not turned back on for the
night.

Granted this overlap won't happen often but
Murphy has a way of finding and exploiting
these situations against me. :)
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. :)
 

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