Jump to content

How to set a program so it doesn't run more than once a day


smileyw

Recommended Posts

Posted

I have a "raining" program that e-mails me if it is raning at the house using the weather module. The problem is that the program keep alerting me constantly. I want it to just do it once a day. I tell it to stop the program, but it is obviously restarting, and I don't know why.

 

I am obviously missing something here, but I don't quite understand what it is... It is a simple program, and it is listed below:

If

From 12:10:00AM

For 23 hours 45 minutes and 59 seconds

And Module 'Climate' Rain Today > 0 "

 

Then

Send Notification to 'e-mail'

Stop program 'Raining'

 

Else

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

Posted

Hi smileyw,

 

The trouble is every time WB updates status and rain today is > 0" your program turns true and runs. Having the Stop Program at the end doesn’t really do any good for future program runs.

At first I was thinking you would need 3 programs, but I think these 2 might do the trick.

 

Program Rain Today:

 

If
       From    12:10:00AM
       For      23 hours 45 minutes and 59 seconds
   And Module 'Climate' Rain Today > 0 "
   And Program 'Rain Email Flag' is False

Then
       Run Program 'Rain Email Flag' (Then Path)

Else
       Run Program 'Rain Email Flag' (Else Path)

 

Program Rain Email Flag:

 

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

Then
       Send Notification to 'Email' content 'default'

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

 

Once the WB reports Rain Today > 0†then the program Rain Today will turn true (as long as it is within the time frame and Rain Email Flag is false). At which time Rain Today program will run Rain Email Flag program which will then email you. Once the flag program is turned true it will stay true until the program Rain Today turns false (or the ISY is rebooted). Then the process can start all over again the next day.

This should work, but I haven’t tried it out so – use with caution :D .

 

Tim

Posted

Well, I believe the Rain Today program would turn false once the clock strikes 11:54PM and stay false until 12:10AM and WB reports rain today > 0".

 

But now that I am thinking about it more though... I think that if WB reports rain today > 0" while the time is in the off period (11:54PM - 12:09:59AM) the two programs will cycle back and forth against each other.

 

So it looks like 3 programs will be needed.

 

Program Rain Today:

 

If
       From    12:10:00AM
       For      23 hours 45 minutes and 59 seconds
   And Module 'Climate' Rain Today > 0 "
   And Program 'Rain Email Flag' is False

Then
       Run Program 'Rain Email Flag' (Then Path)

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

 

Rain None Today:

 

If
       From    12:10:00AM
       For      23 hours 45 minutes and 59 seconds
   And Module 'Climate' Rain Today is 0 "
   And Program 'Rain Email Flag' is True

Then
       Run Program 'Rain Email Flag' (Else Path)

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

 

 

Program Rain Email Flag:

 

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

Then
       Send Notification to 'Email' content 'default'

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

 

Tim

Posted

I use three programs. I get one notice when Rain Rate >0. When Rain Rate =0 for at least 10 minutes the program is reset. I have WeatherBug update every 60 seconds.

 

Rain Rate

If
       Module 'Climate' Rain Rate > 0 
   And Program 'It is Raining' is False

Then
       Run Program 'It is Raining' (Then Path)

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


 

This program will only run if it hasn't rained in 10 minutes (10 updates).

Rain Rate Not

If
       Module 'Climate' Rain Rate is 0 
   And Program 'It is Raining' is True

Then
       Wait  10 minutes 
       Run Program 'It is Raining' (Else Path)

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


 

It is Raining

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

Then
       Wait  10 seconds
       Send Notification to 'Text to Blackberry'

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


 

Rand

Posted
I use three programs. I get one notice when Rain Rate >0. When Rain Rate =0 for at least 10 minutes the program is reset. I have WeatherBug update every 60 seconds.

Rand

 

Even more elegant :)

 

Actually, this is has all been really helpful to teach me how to do programming on the ISY.

Posted

 

Even more elegant :)

 

Actually, this is has all been really helpful to teach me how to do programming on the ISY.

 

Tim's answer is more relevant to "Once a Day", which was your original question. A gold star to Tim today!

Posted

 

Even more elegant :)

 

Actually, this is has all been really helpful to teach me how to do programming on the ISY.

 

Tim's answer is more relevant to "Once a Day", which was your original question. A gold star to Tim today!

 

Not really, becuase the Weather resets at midnight back to zero, so it essentially is the same thing.

Its raining here today, so we will see if it works.

Posted

Here's another take with an eye towards simplicity. No ELSE branches in any of these programs (of course).

 

Program 1: RainNotifyFlag (no code)

 

Program 2: SendNotitifcationOnRain

If

Module 'Climate' Rain Today > 0.2 " (some reasonable threshold)

 

Then

Send Notification to 'e-mail'

Run Program RainNotifyFlag (Then Branch)

 

Program 3: ResetRainNotifyFlag

If

Time is 12:10:00 AM (sufficient time for module to reset values to 0)

Then

Run Program RainNotifyFlag (Else Branch)

 

In my mind, simple is the most elegant.

Posted
I use three programs. I get one notice when Rain Rate >0. When Rain Rate =0 for at least 10 minutes the program is reset. I have WeatherBug update every 60 seconds.

 

Rain Rate

If
       Module 'Climate' Rain Rate > 0 
   And Program 'It is Raining' is False

Then
       Run Program 'It is Raining' (Then Path)

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


 

This program will only run if it hasn't rained in 10 minutes (10 updates).

Rain Rate Not

If
       Module 'Climate' Rain Rate is 0 
   And Program 'It is Raining' is True

Then
       Wait  10 minutes 
       Run Program 'It is Raining' (Else Path)

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


 

It is Raining

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

Then
       Wait  10 seconds
       Send Notification to 'Text to Blackberry'

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


 

Rand

 

So this sort of works, but the "It is Raining" doesn't ever seem to go to false. In fact, if I just run the "else" of that program manually, it still doesn't go to false. Is there something I need to do in the else to make it go false?

 

W

Posted

In Program Summary tab, what does ISY report the status of those three programs as?

 

In the Configuration>Climate tab what is the current Rain Rate amount?

 

And, did you want Rain Rate or Rain Today? In your original example you used Rain Today.

 

I would look at the conditions in the first program. When you force the flag false, the first program must be turning true and running which in turn turns the flag true.

 

Watch the run times in Program Summary tab for those 3 programs and run Else on the flag.

 

Tim

Guest
This topic is now closed to further replies.

×
×
  • Create New...