Please login or register.

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

Author Topic: First Macro using door sensor doesn't work  (Read 33527 times)

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: First Macro using door sensor doesn't work
« Reply #15 on: January 12, 2011, 09:33:44 AM »

Ok, I have my new macro working and will probably share the setup in the user macros forum.

I moved my living and dining rooms switches to the monitored house code of F. Now I can check to see if the light is on when the front door is opened and will only turn it on if it is off and between dusk and dawn. I also set a flag when the macro turns it on so I can turn it off when the door is closed.

But here is my problem. I had those lights on HC I and tied in to the ds7000 which is on HC I. That way I could see when the system is armed by the light flash. So I tried to make a macro for I1 (the old light code) in AHP to turn on or off the living room light that is now on F9. I try pressing the light 1 key on the security remote, I see the commands in the activity log, but the light will not turn on. Could that be because the HC I is not a transceived code in AHP? And I probably don't want HC I as a transceived code because I have the security console, right?
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: First Macro using door sensor doesn't work
« Reply #16 on: January 12, 2011, 12:42:53 PM »

Well, just got informed of a problem with my macro. It seems the light is still turning on even though it is daytime. The condition to turn the light on is after dusk and before dawn. So the light should not be turning on.

I have the correct location set in hardware config and the dusk and dawn times appear correct.

If needed, I'm using AHP 3.301 and 2.296 (i think) for smart macros and on alert.
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: First Macro using door sensor doesn't work
« Reply #17 on: January 12, 2011, 01:01:39 PM »

The condition to turn the light on is after dusk and before dawn. So the light should not be turning on.

in "AHP logic," that condition will NEVER be true.
X10 uses a midnight-to-midnight day.
In a single 12:00 AM to 11:59 PM, there is never a time that is both "after dusk" AND "before dawn".
"Before dawn" is the time from 12:00 AM until Dawn, and "After dusk" is the time from Dusk until 11:59 PM.
Those times are at opposite ends of the day, so you will never meet both conditions at the same time.
Try changing the condition to "before dawn" OR "after dusk", and see if that makes a difference.
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: First Macro using door sensor doesn't work
« Reply #18 on: January 12, 2011, 01:35:35 PM »

Try changing the condition to "before dawn" OR "after dusk", and see if that makes a difference.

The condition I'm using is the Time Range. It says "If Time is Between" with options to set Start (set to Dusk) and End (set to Dawn). In the specific time boxes it shows the current times for Dusk(4:53pm) and Dawn (7:04am) once I selected Dusk and Dawn.

This is how the macro reads once saved:

Trigger Conditions Front Door Zone 1 - Sensor Triggered and
Module Status Off - Living Room Ceiling Light and
The Time is Between Dusk and Dawn
End Trigger Conditions
Turn M1 ON

M1 On is a macro that sets a flag and turns on F9 (living room light)
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: First Macro using door sensor doesn't work
« Reply #19 on: January 12, 2011, 02:55:35 PM »

Exactly.
The condition will NEVER be true.
Starting at 12:00 AM, you will never hit a time that is AFTER 4:53 PM and BEFORE 7:04 AM, without crossing midnight again.
AHP Conditions and timers don't cross midnight.

Since you can't have two parallel condition tracks with an "or" in between, I would use the "else" option isntead.
Create a second macro with the EXACT SAME trigger address. That should link the two together. You should see a tab at the top for each one.

On the first one, set the conditions to:
      Module Status Off - Living Room Ceiling Light and
      The Time is Before Dawn

On the second one, set the conditions to:
      Module Status Off - Living Room Ceiling Light and
      The Time is After Dusk

Put the same commands in both macros.
You should see them "join" together (there will be two tabs at the top, one with each of the macros). They function as an if-then-else condition. If the first one is true, then it executes. Otherwise, it checks the condition on the second one, and executes that.
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: First Macro using door sensor doesn't work
« Reply #20 on: January 12, 2011, 03:09:38 PM »

So basically you are telling me the time range condition does not work for any times that cross midnight? But I can set it to start at Dusk and End at 11:59pm and make another macro only changing the time range to be Start at 12:00am and end at Dawn? Do I understand?

I do understand the linked macros. I see that for this macro because I have another one on the same trigger to turn the light off. Can I have more than 2 macros linked?
Logged

troll334

  • Hero Member
  • *****
  • Helpful Post Rating: 11
  • Posts: 159
Re: First Macro using door sensor doesn't work
« Reply #21 on: January 12, 2011, 03:12:57 PM »

Oh yeah!
I've got a trigger with 3 OR's (four conditions in total). Works great. And none of them cross the midnight
barrier that Noam's talking about. I think he taught me that trick a couple months ago.
Logged
AHP 3.236. CM15A. XTB-IIR. XTBM. Hauppauge 950Q.

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: First Macro using door sensor doesn't work
« Reply #22 on: January 12, 2011, 03:19:58 PM »

I'm editing the macro now. I deleted the time rage and added Specific Time and set it to Before Dawn. I see that it will let me add and OR. Can I just put OR After Dusk in the one macro? Or do I still need to make another macro for the After Dusk condition?

If I add the OR this is how it reads now:

Trigger Conditions Front Door Zone 1 - Sensor Triggered and
Module Status Off - Living Room Ceiling Light and
It's Before Dawn or
It's After Dusk
End Trigger Conditions
Turn M1 ON
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: First Macro using door sensor doesn't work
« Reply #23 on: January 12, 2011, 04:04:25 PM »

I don't know if the "OR" applies to only the last two conditions (the first one MUST be true, and either of the last two must be true), or to the entire line (the first two must be true OR the last one must be true), but that shouldn't be too hard to test.

I have a series of about 5 or 6 "or" macros linked together, which are triggered by a PowerFlash module after a power-outage ends.
The logic was tricky to put together, but it does different things, depending on the day of the week, and the time of day when the outage ends.
Logged

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: First Macro using door sensor doesn't work
« Reply #24 on: January 12, 2011, 04:12:49 PM »

I see what you are saying. Either the light must be off and it is before dawn will turn the light on. Or it must be after Dusk (if the light is on or off) and turn the light on.

I'll check it when I get home. Can I just change the clock on my computer to simulate the time?
Logged

Dan Lawrence

  • Hero Member
  • *****
  • Helpful Post Rating: 68
  • Posts: 3991
Re: First Macro using door sensor doesn't work
« Reply #25 on: January 12, 2011, 05:43:55 PM »

I see what you are saying. Either the light must be off and it is before dawn will turn the light on. Or it must be after Dusk (if the light is on or off) and turn the light on.

I'll check it when I get home. Can I just change the clock on my computer to simulate the time?

That's even worse. If the CM15A is connected to the PC, it gets it's time from the PC.   
Logged
I don't SELL this stuff... BUT I sure do ENJOY using it!!!

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: First Macro using door sensor doesn't work
« Reply #26 on: January 12, 2011, 10:00:03 PM »

I see what you are saying. Either the light must be off and it is before dawn will turn the light on. Or it must be after Dusk (if the light is on or off) and turn the light on.

I'll check it when I get home. Can I just change the clock on my computer to simulate the time?

That's even worse. If the CM15A is connected to the PC, it gets it's time from the PC.   

Which is exactly what he wants to happen so he can test!   B:(   rofl
 >!
Logged
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: First Macro using door sensor doesn't work
« Reply #27 on: January 13, 2011, 10:54:03 AM »

Ok, so I got home and changed the macro to turn the light on only if it is off and it is after dusk. Opened the door and the light came on. Reset the time on the computer to Noon (before dusk) and cleared the interface and updated to make sure it showed Noon. Downloaded the timers and macros. Opened the door and the light came on. So I'm not sure if that test worked or not.

I checked my settings and put the clock back to the correct time. Which at the time is after dusk. Cleared and re downloaded. Before that I emptied the trash and purged all macros just to be sure. Opened the door and the light DID NOT come on. Said oh well and left it like that.

This morning when I left for work and opened the door, the light came on.  B:( It's after midnight and before dusk. Why did it come on? My clock on the computer and in the interface are both correct.

Just to clarify, here is the macro as it is now:

Trigger Conditions Front Door Zone 1 - Sensor Triggered and
Module Status Off - Living Room Ceiling Light and
It's After Dusk
End Trigger Conditions
Turn M1 ON

M1 ON will set flag 1 and turn F9 on

I have a linked macro that is triggered by the door close with a condition for flag 1 set. Then it will run M1 OFF. This macro will turn the light off.

Guess I need to make the duplicate macro for when the door opens but change after dusk to before dawn. Then make sure the light doesn't turn on between Dawn and Dusk.

MACRO 1:
Trigger Conditions Front Door Zone 1 - Sensor Triggered and
Module Status Off - Living Room Ceiling Light and
It's After Dusk
End Trigger Conditions
Turn M1 ON

MACRO 2:
Trigger Conditions Front Door Zone 1 - Sensor Triggered and
Module Status Off - Living Room Ceiling Light and
It's Before Dawn
End Trigger Conditions
Turn M1 ON

MACRO 3:
Trigger Conditions Front Door Zone 1 - Door Closed and
Flag 1 - Set
End Trigger Conditions
Turn M1 OFF

Just wondering, does After Dusk mean 12:00am to Dawn? Does Before Dawn mean Dusk to 11:59pm?
Logged

troll334

  • Hero Member
  • *****
  • Helpful Post Rating: 11
  • Posts: 159
Re: First Macro using door sensor doesn't work
« Reply #28 on: January 13, 2011, 11:16:32 AM »

any way I can talk you into specifying exact times instead of dusk/dawn?
and maybe even get rid of the other conditions...just to test the time thing?
K.I.S.S.  :)
Logged
AHP 3.236. CM15A. XTB-IIR. XTBM. Hauppauge 950Q.

lviper

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 10
  • Posts: 294
Re: First Macro using door sensor doesn't work
« Reply #29 on: January 13, 2011, 11:44:10 AM »

any way I can talk you into specifying exact times instead of dusk/dawn?
and maybe even get rid of the other conditions...just to test the time thing?
K.I.S.S.  :)


Sure, I'd be happy to test it with set times. However, I thought my KISS would be using dusk and dawn so I wouldn't have to edit the times throughout the year. Would just love to understand the logic behind those settings. I understand the passing midnight thing, but if I set it to After Dusk I would assume that means from whatever time dusk is today until 11:59pm tonight.

However, since the light would not come on during that time frame, and it did come on this morning makes me think it does not know what time dusk is, even though the condition shows it grayed out in the specific time. But then again, even if it didn't know when dusk started, it still wouldn't meet the condition and the light shouldn't come on at anytime.

I tried using the Nighttime condition but it wouldn't turn the light on either. Never checked it during the day though.
Logged
Pages: 1 [2] 3
 

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