Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

System Variables - Month?

Featured Replies

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?  

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.

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.

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

  • Author
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.  

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.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.