X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: Curt on October 14, 2007, 03:16:02 PM

Title: Found way to make conditions work
Post by: Curt on October 14, 2007, 03:16:02 PM
I finally found out how to get my conditions to work. All I wanted to do was turn on the light before recording video at night, but not turn on the light in daytime. It turns out the day/night or time conditions will only work if the macro can be stored in the interface. To do both vodeo (run only from PC) and conditionally turn on a light, I set a subroutine to run a different macro that only turns on or off the light. This is how mine works:

Macro a1-on that is triggered by a motion sensor:
Appliance Control b1 on
Select camera front
Video Recording start
Delay 10 seconds
Video Recording stop
Appliance Control b1 off
Camera front off

Macro b1-on for turning light on:
if nighttime
light b2-on

Macro b1-off for turning light off:
light b2 off

Title: Re: Found way to make conditions work
Post by: Puck on October 14, 2007, 06:26:48 PM
Curt: Welcome to the forum. I'm surprised you cannot get an else macro to work with time conditions. Nonetheless, a good work-around.

Just be aware that Macro B1 will try and of execute the same time as the remainder Macro A1. You could occasionally get a signal collision where one or both the light & camera don't get activated.
Title: Re: Found way to make conditions work
Post by: steven r on October 14, 2007, 10:00:02 PM
...Just be aware that Macro B1 will try and of execute the same time as the remainder Macro A1. You could occasionally get a signal collision where one or both the light & camera don't get activated....
Would a signal collision be less likely if he moved the command "Appliance Control b1 on" to just before the delay?
Title: Re: Found way to make conditions work
Post by: Puck on October 14, 2007, 10:15:17 PM
...Just be aware that Macro B1 will try and of execute the same time as the remainder Macro A1. You could occasionally get a signal collision where one or both the light & camera don't get activated....
Would a signal collision be less likely if he moved the command "Appliance Control b1 on" to just before the delay?

That would be a safer place for it.
Title: Re: Found way to make conditions work
Post by: spam4us on October 14, 2007, 11:46:41 PM
How about turning on the light first, then triggering the recording macro that turns light b2-off at the end regardless if it's on or not. This way the light gets turned on before the recording starts with less chance of a collision.

Macro a1-on that is triggered by a motion sensor:
if nighttime
  light b2-on
  delay 1 sec
  Appliance Control b1 on
else
If daytime
  Appliance Control b1 on

Macro b1-on for turning light on:
  Select camera front
  Video Recording start
  Delay 10 seconds
  Video Recording stop
  Camera front off
  light b2 off

you could also set up a dummy switch on the monitored house code that gets turned on at night & turned off during the day. Call it switch M1.  Your macro would then look like this.l

Macro a1-on that is triggered by a motion sensor:
if M1 On
  light b2-on
  delay 1 sec
  Appliance Control b1 on
else
If M1 Off
  Appliance Control b1 on