Jump to content

System Variables - Month?


Jberglie

Recommended Posts

Posted

I have a swimming pool light that I would like to program to go on automatically only during specific months of the year as there is no point in turning it on during the winter.  Is there a way to write a program using the system variables available to do this?  

Posted

Sure.  One first has to create a program which assigns the value of the month system variable to a variable created by you.  You would then use that variable as a condition in the program to turn on the pool light.

Posted

You could always create a program to turn the lights on and off at specific times, then put it into a folder and set the properties of that folder to enable the programs within to only run between certain dates.

Test Programs - [ID 00A7][Parent 0001]

Folder Conditions for 'Test Programs'

If
        From     5:30:00PM on 2018/04/01
        To       5:30:00PM on 2018/09/30
 
Then
   Allow the programs in this folder to run.
 

I actually don't know if this is available in the 4.x.x series firmware, but it's pretty foolproof if it is.

Posted (edited)
10 hours ago, Bumbershoot said:

actually don't know if this is available in the 4.x.x series firmware, but it's pretty foolproof if it is.

I believe it was available in 4.x, but who wants to update this condition every year if there is a convenient way to avoid doing so.

Edited by oberkc
  • Like 1
Posted
12 hours ago, oberkc said:

Sure.  One first has to create a program which assigns the value of the month system variable to a variable created by you.  You would then use that variable as a condition in the program to turn on the pool light.

Yes -- I do not wish to update the program annually.  

 

The system variable that from reading the wiki it appears we can produce is the long form date.  - so how would I go about breaking down that date into the month format in a program just to check the month, and assign a variable based on what month it is?  - 

 

To me it seems all I can get out of the system variable is 11-10-2018  -- but I essentially just want the first part of that to be able to facilitate this.  

Posted

I am not in a position to confirm, but current month is one of the system variables, I thought.  In fact, I think I use it in one of my programs.

Posted (edited)
4 hours ago, Jberglie said:

Yes -- I do not wish to update the program annually.  

 

The system variable that from reading the wiki it appears we can produce is the long form date.  - so how would I go about breaking down that date into the month format in a program just to check the month, and assign a variable based on what month it is?  - 

 

To me it seems all I can get out of the system variable is 11-10-2018  -- but I essentially just want the first part of that to be able to facilitate this.  

 

Note. to use a time frame over the end of the year you must use "OR" logic like this.

If
      MM.DD >= 12.24
   OR
    MM.DD <= 1.12

Otherwise you would use "AND" Logic like this
If
    MM.DD >= 12.24
   AND
    MM.DD <= 12.26

 

To isolate a month you would still have to use a range like this
If
    MM.DD >= 12.00
   AND
    MM.DD <= 12.99  (or 12.31)

This will not work MM.DD = 12 because the variable will never be just an Integer in this logic.

Edited by larryllix
Guest
This topic is now closed to further replies.

×
×
  • Create New...