Please login or register.

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

Author Topic: Daytime/Nighttime and Time Range Conditionals - HELP!  (Read 30005 times)

Prime

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 8
Daytime/Nighttime and Time Range Conditionals - HELP!
« on: May 08, 2006, 09:37:57 AM »

Basically I want to do this upon a motion sensor being triggered:

If there is motion AND it's DAYTIME
TURN ON CAMERA
RECORD VIDEO FOR 30 SEC.
TURN OFF CAMERA

If there is motions AND it's NIGHTTIME
TURN ON CAMERA
TURN ON LIGHT
RECORD FOR 30 SEC.
TURN OFF LIGHT
TURN OFF CAMERA

So I don't need the lights coming on during the bright of day.


Now, I've tried using the DAYTIME NIGHTTIME conditionals, and I have also tried using the  TIME RANGE conditions, with "BETWEEN DAWN AND DUSK" for daytime, and "BETWEEN DUSK AND DAWN" for nighttime.

The motion sensor at the front doorr is set to M4.  Here are my actual macros in AHP:


The first macro associated with M4 for DAYTIME is as follows:

Trigger Conditions M4 On and
It's daytime
End Trigger Conditions
Turn Front Yard Cam On
Start Recording Video
Wait for 15 Seconds
Stop Recording Video
Turn Front Yard Cam Off


The second macro associated with M4 for NIGHTTIME is as follows:

Trigger Condition M4 On and
It's nighttime
End Trigger Conditions
Turn Front Yard Cam On
Start Recording Video
Turn Front Spot Light On
Wait 15 Seconds
Turn Front Spot Light Off
Stop Recording Video
Turn Front Yard Cam Off


Now my understanding is that when BOTH of these macros recieve M4 On, only one of them should run depending on time of day since the logical condition is an "AND" and not an "OR".  When (M4 On "AND" Daytime) is met then the daytime macro should run, and the nighttime one should NOT, and vise vera.

But the spot light ALWAYS comes On !!
I have checked the clock and zone and city settings.  The surise sunset times in the interface table are correct.
How can I make this smart macro smart enough that it will NOT turn on the spot light during the day, but only at night?????


Any help would be greatly appreciated.
Logged

Don N

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 311
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #1 on: May 08, 2006, 11:15:33 AM »

Prime,
I have a similar situation and this works fine for me.  Make sure you remove the timer settings from your two Macros.

Motion sensor M4 Macro
Trigger Conditions M4 On and
It's nightime
End Trigger conditions
Turn Front Spot Light On
Wait for 15 seconds
Turn Front Spot Light Off

Front Camera M4 Macro
Turn Front Camera On
Start Video Recording
Wait for 15 seconds
Stop Video Recording
Turn Front Camera Off

Hope this helps.  Don
Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #2 on: May 08, 2006, 11:17:47 AM »

It sounds like what you have should work.  What are the addresses of the Front Yard Camera and the Front Spot Light?
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #3 on: May 08, 2006, 03:55:02 PM »

Prime: in order for your smartmacros to only one of the macros you need to have an else eg:
If there is motion AND it's DAYTIME
TURN ON CAMERA
RECORD VIDEO FOR 30 SEC.
TURN OFF CAMERA
Else
TURN ON CAMERA
TURN ON LIGHT
RECORD FOR 30 SEC.
TURN OFF LIGHT
TURN OFF CAMERA
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Prime

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 8
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #4 on: May 08, 2006, 08:27:51 PM »

Thank you for your responses.

The Front Yard Camera address is C4, and the Front Yard Spotlight address is L7.

Don, thanks, I think I see what you're getting at.  But I tried that.  I set a completely simple macro just to test the conditionals.  Basically I created the macro below:

If M4 On and It's Nighttime,
Turn Front Spot Light On

Well guess what.  The damn macro STILL turns the light on upon recieving M4 ON IN THE MIDDLE OF THE DAY!!!  So I don't think the smart macros are so smart  :-   Besides we shouldn't have to do things like that.  The macros should work as advertised.

Tuicemen, I have done the ELSE thing.   That is how it creates the second macro page, and it is "connected" to the first macro by the little loop thingy at the top (yes i AM a very technical person but sometimes you gotta resort to using such terms !! :)   )


Any other ideas?   X10, any clues????
Logged

Prime

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 8
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #5 on: May 08, 2006, 08:51:31 PM »

Hey Don, I thought about your idea a bit more and I understood what you meant.
Basically I separated the spotlight control from the video recording, AND I removed the daytime conditional.  So here are my two "M4 On" macros:

For the lights:

If M4 On and It's nighttime,
Turn on the spotlight
Wait 15 Seconds
Turn Off the spotlight


For the camera:

If M4 On
Turn camera on
Start Record
Wait 15 Seconds
Stop Record
Turn Camera Off



Makes sense because theory is that I ALWAYS want to record video, as both my macros indicated.  So this way the camera ALWAY comes on and records because the only condtion on it is M4 On.  And as for the light, it will come on if M4 On "AND" Nighttime are both met.


I tested it just now and the light did NOT come on since it's BEFORE sunset (nighttime) !
The moment of truth will be around 8:52PM or so when the "Nighttime" variable should become "TRUE", and then theory is that the light should come on.


I will try in about an hour and let you know.  If this works, THANK YOU SOOOOO MUCH !!   YOU ARE THE MAN !!   I didn't catch on to your idea at first.  Even if it doesn't work, thank you still  :)

Will post in just over an hour.  Guess I could change the system time and try now, but I just don't wanna muck with it   :-X
« Last Edit: May 09, 2006, 09:24:11 AM by Prime »
Logged

Prime

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 8
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #6 on: May 08, 2006, 10:08:15 PM »

Well, it's doing a different wierd thing now  >:(
Now that it's "nighttime", the light is coming on, which is great, but now the camera macro is not running !!!
Sheeeeesh.  Both are set to trigger "M4 On", so I don't get it   :o   Shouldn't both macros run????
Logged

Prime

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 8
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #7 on: May 09, 2006, 09:23:27 AM »

I tried yet another thing:

I added record function to the light controls since the camera macro didn't want to launch after nighttime.  So here are my macros now:

If M4 On and It's Nighttime,
Turn on camera
Start Recording
Turn on light
Wait 15 Seconds
Turn Off Light
Stop Recording
Turn Off Camera


And the other macro is still the same:

If M4 On
Turn camera on
Start Record
Wait 15 Seconds
Stop Record
Turn Camera Off


Well guess what happens now.  The light is coming on ALWAYS again !!!!  Day or night !!!    I GIVE UP   >:( >:( >:(  I don't know how to get this thing working.  I guess worst case scenario the light will always come on, but the bulbs for that spot light are quite expensive and I wanted to extend its life.
Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #8 on: May 09, 2006, 10:16:18 AM »

That is really strange.  It should work for you.  One thing you can try is to go back to having separate macros for the camera and lights but have them on separate addresses and have the camera macro turn on a virtual appliance module at the same address as the light macro (and thus trigger the macro).  The light macro could then be conditional on it being nighttime.  You shouldn't have to do it this way, but if we can get it to work that is the main thing.
Logged

Don N

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 311
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #9 on: May 09, 2006, 11:08:24 AM »

Prime,
When you had this configuration (see below), did you have the "little loopy thingy" at the top connecting the two macros?  What is the address of your camera?

For the lights:

If M4 On and It's nighttime,
Turn on the spotlight
Wait 15 Seconds
Turn Off the spotlight


For the camera:

If M4 On
Turn camera on
Start Record
Wait 15 Seconds
Stop Record

Don
Logged

billy

  • Sr. Member
  • ****
  • Helpful Post Rating: 7
  • Posts: 110
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #10 on: May 09, 2006, 11:24:47 AM »

Try:

If M4 On and It's daytime,
Wait 2 Seconds
Turn on camera
Wait 2 Seconds
Start Recording
Wait 2 Seconds
Turn on light
Wait 15 Seconds
Turn Off Light
Wait 2 Seconds
Stop Recording
Wait 2 Seconds
Turn Off Camera

I know this will make the response time excessively long but it's just a test.

Temporarily delete your other macro because when M4 is triggered AHP will try to run them both.
Logged
"I would rather live my life as if there is a God and die to find out there isn't, than live my life as if there isn't and die to find out there is."  Albert Camus

Prime

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 8
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #11 on: May 09, 2006, 12:01:00 PM »

Roger, I think I see what you mean. That is an interesting approach.  I will try this when I get home and report.  I guess I can RDP into the AHP server (windows server 2003) and do the changes but I want to actually trigger the motion sensor (or send M4 On with an RF remote)  rather than clicking on the macro.   I have read that clicking on the macro is not the best way to test the macro. 

I don't want to taint this testing at all and report some accurate results as I really appreciate everyone taking the time and reading and replying.  So I'll keep it accurate.

Don, yes I did have the loopy thingy with that config.  I think as soon as your trigger addresses are the same it loopy-connects them together.  The address of the front yard camera is C4.  The spotlight address is L7.

Billy I will try this as well when I get home.  I will try it even if Roger's idea works, just to see.  But of course I want the light to come on at night, not during the day, so I'll use the Nighttime conditional (guessing that's what you meant  :)  )
 Do you thing the delays in between will resolve the issues?

 -John
« Last Edit: May 09, 2006, 12:15:11 PM by Prime »
Logged

Prime

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 8
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #12 on: May 09, 2006, 10:12:55 PM »

Well folks, Roger's idea worked !!!   THANKS ROGER !!  ;D

I created "a virtual trigger module" and put it into the camera macro and it gets turned on with the camera  macro (M4 On trigger), and then it gets turned back off after the delay.  This virtual device is set to P7.  P7 then is the trigger for the lights macro which has the nighttime conditional on it.

I just tried it and lights stayed off for the daytime, and came on at nighttime !!   Kinda sad that I gotta do it in such a round-about way, but hey, it works !!

Billy, I'm sorry to report that the delays did not make a difference.  It did exactly what it was doing with my ORIGINAL macros, but of course with the added delay.

THANKS AGAIN ROGER  ;D   
I have six cameras that I can get set up now using this scheme.

Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #13 on: May 10, 2006, 12:42:46 PM »

Kinda sad that I gotta do it in such a round-about way, but hey, it works !!

You shouldn't have to do it this way, but I am glad you got it working.

Quote
THANKS AGAIN ROGER  ;D   

My pleasure.  Thank you for reporting that you got it to work!
« Last Edit: May 11, 2006, 10:34:01 AM by roger1818 »
Logged

Don N

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 311
Re: Daytime/Nighttime and Time Range Conditionals - HELP!
« Reply #14 on: May 10, 2006, 06:58:50 PM »

Primm,
I'm curious as to what your script looks like now.  If you don't mind, would you list each macro along with all the commands.  This may help other folks as they try to implement the same scenario as yours.  Thanks, Don
Logged
Pages: [1] 2
 

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