Please login or register.

Login with username, password and session length

Author Topic: Help with a macro please?  (Read 7565 times)

stevecon

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
Help with a macro please?
« on: November 09, 2009, 06:20:38 AM »

Here's what I have: 

I have several light switches & modules that are turned on in the morning so that after I've showered and come downstairs for coffee (5:30 AM) the lights are on.  A short time later, outside lights come on for the sidewalk and driveway.  This works very well (although in the last week I find that some don't want to turn on in the evening - but that's another story).

Here's the problem:

Around here (Massachusetts), dusk and dawn settings vary widely throughout the year.  Sometimes, 5:30 AM is well after sunrise and other times, it is pitch black.  I would like the lights to come on at 5:30 AM *only* if it is "dark" (I 'll call this "dark" period anytime between 30 minutes before sunset through 30 minutes after sunrise) otherwise, it is bright enough and turning them on would be a waste on energy.  I have created a phantom module (I-13) that turns on when it is dark (by my definiton above), thinking I could use this as a condition.  I am having zero luck writing this macro.

Any help with this would be greatly appreciated!

Thanks!
Logged

HA Dave

  • Hero Member
  • *****
  • Helpful Post Rating: 175
  • Posts: 7127
Re: Help with a macro please?
« Reply #1 on: November 09, 2009, 09:23:28 AM »

Here's the problem:
Around here (Massachusetts), dusk and dawn settings vary widely throughout the year.  Sometimes, 5:30 AM is well after sunrise and other times, it is pitch black. 

AHP has a dusk/dawn setting where it calculates the sun's rise and set by date, based on your geographical location. This setting adjusts for the several minutes of change in those times over the period of a year. Using that setting will improve you setup greatly.

However.. no calculation can account for cloud cover. Here in Ohio, not only does earths cycles alter sun light levels, storm clouds can make it dark even at midday. I use a motion sensor (PR511), which has a built-in dusk/dawn sensor, to capture true light levels. I use the sensor to turn inside lights on at dusk and off at dawn. Then in the middle time AHP turns the lights off and then back on based on my schedule (plain timers). So it doesn't matter if its May or December... if my schedule has me (or my wife) up, and its dark outside... we have light.
« Last Edit: November 09, 2009, 09:29:30 AM by Dave_x10_L »
Logged
Home Automation is an always changing technology

stevecon

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
Re: Help with a macro please?
« Reply #2 on: November 09, 2009, 10:35:02 AM »

Hi Dave,

Thanks for your reply.  I am familiar with the dusk / dawn settings that are available in the timer programming.  My situation is different however.  I want the light to come on at 5:30 ONLY if is prior to that 30 minute period AFTER sunrise.  Likewise, I have outdoor lights that I want to have on at 5 PM until 7 PM every day if it is after that 30 minute period BEFORE sunset.   In summer, the period of 30 minutes prior to sunset occurs much later than 7 PM, so turning the lights on then wastes energy.  As the days become shorter, and sunset comes earlier having the lights on would be helpful. 

I do like the cloudy skies variable option you mentioned though.  I have the motion detectors you mention, too.  Maybe setting one of those to work instead of using the 30 minute timer & dusk / dawn setting is a better way to go.  Again, a way to incorporate the sensor with the switch so that BOTH must be on (or satisfied as in the case of the sensor) to allow the light to come on and if I'm not looking for too much, have them work together to shut the light off when it gets brighter.

Ideally I'd use the sensor to turn on a phantom module (I suppose setting a flag would do, but I'm even more unfamiliar with those than the macro writing).  That way, any light I wish to control when both time AND light level could use a macro (condition?) that looks at the state of the phantom module to see if it should enable a command to the light to come on at the proper time.  It would also issue a command (rather than merely enable it) the light when EITHER time or light level is appropriate. 

Thanks!
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Help with a macro please?
« Reply #3 on: November 09, 2009, 01:56:18 PM »

Sounds like you are on the right track.
If it were me, I'd set up a phantom module triggered by the motion sensor's day/night address, or a macro that either turns on a flag,  (and turns it off again when it is light).
Then, the macro that turns on your lights can be set to activate ONLY if the flag/phantom module is on. This also allows you to override, by manually changing the state of that flag or phantom module.
Logged

stevecon

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
Re: Help with a macro please?
« Reply #4 on: November 09, 2009, 07:00:09 PM »

Hi Noam,

Thanks for your input, as well.  The motion detector set to simply detect dark and light does seem to offer more value than hard coded dusk / dawn offsets under the right conditions.  We get our fair share of dark afternoons due to storms in winter (and summer for that matter) but, the business of the sensor settings defaulting back to A1 when changing batteries along with the fact that I only need to turn the lights on early morning and early evening, as no one is at home during the daytime that would need them.  I would use that set up however, if it were easier to implement than the timer method I've been on.

Currently I have all devices on the I house code.  I also have a switch that goes on every hour between 8 AM and 3 PM and then again from 12 midnight until 4:30 AM that triggers a macro that issues an All Off command.  This was to get a handle on some lights that seemed to magically turn on by themselves during the daytime (and equally possible - in the middle of the night) while we weren't home (or asleep).  Whenever I thought I'd found the problem and made changes, it would only happen again the next day/week/month.  I raised the white flag after a while, and this setup seems to be functioning.

The whole macro thing is difficult to get my head around for some reason.  I'm very logical in my thinking and usually can figure stuff out without too much difficulty, but not this Smart Macro program from X-10...  I just don't know what the problem is.  So, if you would, in simple to understand English (and preferably using single syllable words); what would you (or anyone else for that matter) do and how?

Thanks!   
Logged

HA Dave

  • Hero Member
  • *****
  • Helpful Post Rating: 175
  • Posts: 7127
Re: Help with a macro please?
« Reply #5 on: November 09, 2009, 08:28:12 PM »

Currently I have all devices on the I house code.  I also have a switch that goes on every hour between 8 AM and 3 PM and then again from 12 midnight until 4:30 AM that triggers a macro that issues an All Off command.  This was to get a handle on some lights that seemed to magically turn on by themselves during the daytime (and equally possible - in the middle of the night) while we weren't home (or asleep).  Whenever I thought I'd found the problem and made changes, it would only happen again the next day/week/month.  I raised the white flag after a while, and this setup seems to be functioning.

That's interesting... and it should be a whole new post/thread of it's own. I wouldn't except that ramdon activity myself (it would drive me mad).

The whole macro thing is difficult to get my head around for some reason.  I'm very logical in my thinking and usually can figure stuff out without too much difficulty, but not this Smart Macro program from X-10...  I just don't know what the problem is.  So, if you would, in simple to understand English (and preferably using single syllable words); what would you (or anyone else for that matter) do and how?    

I am no expert macro writer myself. But I try real hard to keep my macros very simple. I never hesitate to break up the actions I want to accomplish into two, three, or even four macros. That helps me.

You should look at the user created macros:   http://forums.x10.com/index.php?board=103.0   see if maybe you can find a bit of understanding there.
Logged
Home Automation is an always changing technology
 

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