Jump to content

WeatherBug Light data


Sub-Routine

Recommended Posts

I found a WeatherBug site close to our home that includes Light data. I can use this to turn lights on when it's overcast and turn them off if the sky clears.

 

To avoid cycling the lights on partly cloudy days I wanted to add a Wait. I selected 5 minutes which would see 5 data changes at the default polling interval of 60 seconds.

Unfortunately, my original program ran every time the data changed (every 60 seconds) and the Wait kept being restarted.

 

If
       Module 'Climate' Light < 65 

Then
       Wait  5 minutes 
       Set Scene 'Light Experiment' On

Else
       Wait  5 minutes 
       Set Scene 'Light Experiment' Off

Don't use this!!!

 

So I broke it down into three programs. The first program runs the Wait and then performs the Action. The Status of this program defaults to False but once run it will report True if the Then section was last executed.

 

Wait to Change

If
  - No Conditions - (To add one, press 'Schedule' or 'Condition')

Then
       Wait  5 minutes 
       Set Scene 'Light Experiment' Off

Else
       Wait  5 minutes 
       Set Scene 'Light Experiment' On

Bright Day = True
Dark Day = False

 

When it gets dark this program runs. If it was dark last time the Light data was polled the control program is already running the Else section and reports it's status as false. This program then quits without changing the control program and restarting the Wait. If it was light during the last poll this program begins the Wait before turning the scene on.

 

If
       Module 'Climate' Light < 65 
   And Program 'Wait to Change' is True

Then
       Run Program 'Wait to Change' (Else Path)

Else
  - No Actions - (To add one, press 'Action')

When the sky turns dark
Only runs if sky was light during last check

Link to comment

When the sky brightens this program runs.

 

If
       Module 'Climate' Light >= 65 
   And Program 'Wait to Change' is False

Then
       Run Program 'Wait to Change' (Then Path)

Else
  - No Actions - (To add one, press 'Action')

When the sky brightens
Only runs if sky was dark during last check

 

When the Light level crosses the threshold (65) it will have to remain above or below that level for 5 minutes before the lights change. Crossing the level during the wait will restart the Wait.

 

Rand

Link to comment
  • 3 weeks later...
I've been using the light data instead of sunset/sunrise for certain rooms. I'm pleased with the results. The threshold is 15 which I find to be perfect.

 

Good deal.

 

I have changed most schedules to sunset/sunrise and use the light data to control the lights from sunrise to sunset. I vary the threshold depending on the windows in the room. Now, in the winter, I use a lower Light level to turn off lights in rooms that have a window to the south and a higher level in rooms with windows to the north.

 

It's been working great! We had some snow a few days ago and I watched the lights stayed on later after sunrise, turned off in the south, came back on as the clouds rolled in, and turned all off as the sky cleared.

 

Our upstairs hall is open to the foyer and has a large window facing east. I use a lower level from sunrise to noon than I do from noon to sunset.

 

How's the sick child?

 

Rand

Link to comment

That's all pretty slick Rand. One thing I really like about this whole ISY thing is once you think you've got all the programs you need, an idea will pop into your head and you realize how cool and functional it could be.

 

I'm hoping by the time the spring/summer comes around there will be some good support for the ezflora stuff or something similar. Id like to integrate watering to this with the climate info.

 

Sick kiddo is good, sleeping finally, seems like everyone around here has some kind of bug these days.

Link to comment
  • 1 month later...
quick question, that tells you how much I really understand this:

 

are all 3 of these programs "enabled" or should I disable the "wait to change" program.

 

Don't worry someguy, half the fun is learning! Just start simple and add Conditions and Actions when you find you need them. It always takes some experimenting to have the programs run exactly as planned. You can't break anything.

 

They can all be enabled. Wait to Change has no Condition so it will not run unless called.

 

Rand

Link to comment

I used these programs to run the 8 exterior lights and two sets of landscaping lights for my house. I modified them to use the light data cut-off point at 6 instead of 65.

 

I chose this number by looked out my front door and deciding when I thought it was dark enough that it was worth lighting up the outside of my house.

 

It has worked great so far. I find this stuff really interesting and fun to work on. Thanks alot, fellows.

 

Also: I would just like to comment that the way that doing this is challenging and fun makes me return to smarthome's website on a regular basis, buying more switches, sensors, thermostats, and other things to further automate my house using the ISY. I hope that the people at smarthome realize that they should support Universal Devices wholeheartedly.

Link to comment
Also: I would just like to comment that the way that doing this is challenging and fun makes me return to smarthome's website on a regular basis, buying more switches, sensors, thermostats, and other things to further automate my house using the ISY. I hope that the people at smarthome realize that they should support Universal Devices wholeheartedly.

 

I hope so too! If you're so inclined, drop them an email and let them know.

Link to comment
  • 4 months later...

I wrote these 3 programs (which I found on the UDI Wiki, but they appear to be the same ones noted here.) When I wrote my three programs, the weather outside was already overcast, my light level was <5 to begin with.

 

The status of my Control program (the 'Wait' program) was FALSE. It was the first of the 3 programs I wrote, and so it had never been run by either the Sunny Day or Cloudy Day programs (they did not even exist yet.)

 

Although it was overcast (light level <5), the status of the Control program was false. In order for the Cloudy Day program to run, the conditions are that light level<5 AND Control program is TRUE. So that program never ran.

 

Am I wrong to think that the program won't work unless you start on a sunny day, and then it eventually turns cloudy??

Link to comment

Out of curiosity Rand, Steve, how far away is the WB station you both are monitoring for your light levels? I have been thinking about experimenting with the light levels but the nearest station is 26 miles away and conditions can vary greatly with that distance. But at the same time I’m not sure if it would make a whole lot of difference with light levels. What do you think?

 

Its too bad all the WB stations do not offer the light data, I have a station a few miles up the road but it only offers temp rain and wind speed. And it only updates about every hour.

 

Under these circumstances its too bad we cant monitor 2 stations and select the useful data from each station for programs. I could use the light data from the distant station and all the rain and temp and wind speed from the closer station.

 

Thanks

 

Tim

Link to comment

The Clear Day program will run when it becomes bright (when the status of the Wait program is False.)

 

Don't the programs work for you?

 

Rand,

 

Sorry, I'm still confused. Are you saying you agree, that the programs only work after the first sunny day (after the status of the Wait program gets set to TRUE)?

 

Or am I just doing something wrong?

Link to comment

Rand,

 

Yes - the "Clear Day" program works, but that wasn't the issue. The issue was the "Cloudy Day" program. That program requires that the Wait program is TRUE.

 

And nothing was setting the program to TRUE, because I had several Cloudy day's in a row. So each day the Wait program remained at the 'default' state of FALSE. And as a result, my lights never got switched on. It wasn't until 2-3 days after I wrote the program, that we had a sunny day. Finally, at that point, the WAIT program changed to TRUE (the programs turned the lights off.) Then, once it was finally TRUE, and it eventually became Cloudy again, then the "Cloudy Day" program worked for the first time.

 

It seemed from the logic that this would happen, and that the programs would only work following at least one period of Clear/Sunny weather. Because of the fact that programs default to being "FALSE" and therefore requiring at least one kick-start to be set to TRUE.

 

If that's so, then I wonder if the same issue will re-occur when my ISY has to be re-started or re-set for any reason.

 

Am I wrong to think that the program logic works, but only after at least one Clear/Sunny period of weather happens? Do you think that if the programs are set up during extended Cloudy/Overcast weather that they should in fact work? If so, then I wonder if somehow I have them set up incorrectly?

Link to comment

Hi Matt,

 

My logic is that the programs are only active between sunrise-sunset. When sunrise occurs my outside lights turn on to the Stormy Day scene via schedule. Then when (if) it brightens the WeatherBug program turns them off. During the day if it becomes dark/light they turn on/off. A schedule turns on my Evening scene at sunset and the light data programs are disabled.

 

A few things to keep in mind. Even when the light data is 0 here it is still bright enough to see. This varies by station. Sometimes a WeatherBug station fails and the light data remains at 0 even on a bright day. So my Stormy Day scene only turns on 2 of my 5 outside lights. I think it's enough to make it appear as though someone is home and it doesn't waste so much power as having all the lights on like I do in the Evening/Midnight scenes.

 

Inside the house I use the same logic. Only enough lights stay on during dark days to make the house look occupied.

 

Rand

Link to comment
Hi Matt,

 

My logic is that the programs are only active between sunrise-sunset. When sunrise occurs my outside lights turn on to the Stormy Day scene via schedule. Then when (if) it brightens the WeatherBug program turns them off. During the day if it becomes dark/light they turn on/off. A schedule turns on my Evening scene at sunset and the light data programs are disabled.

 

A few things to keep in mind. Even when the light data is 0 here it is still bright enough to see. This varies by station. Sometimes a WeatherBug station fails and the light data remains at 0 even on a bright day. So my Stormy Day scene only turns on 2 of my 5 outside lights. I think it's enough to make it appear as though someone is home and it doesn't waste so much power as having all the lights on like I do in the Evening/Midnight scenes.

 

Inside the house I use the same logic. Only enough lights stay on during dark days to make the house look occupied.

 

Rand

 

As my 7th grade math teacher would say "Dawn over Marblehead" - I finally get it. Thanks for your replies, I am with you now. You default certain lights on to begin with each day, and then let the Sunny Day pgm turn them off if necessary (and then both programs will turn them on and off again throughout the day as needed.) Makes perfect sense.

 

My issue was because I didn't default them on via schedule. I was letting the programs try to set them (either on or off) based on the weather each day, with no default schedule.

 

The feedback and input is greatly appreciated. Cheers.

Link to comment
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.6k
×
×
  • Create New...