Jump to content

Looking for a calendar program


satwar

Recommended Posts

I really need some help in getting a calendar program.  Hopefully there's some documentation to explain how it works.  Unfortunately the coding I've seen so far is way beyond my abilities.

As a first project I'd like the program to trigger an even/odd number day to flag permission to a irrigation system to run on even numbered day of my house.

Thank you in advance for your assistance.  I had a program from this forum which ran for many years, and then suddenly stopped and I don't have the skills to troubleshoot.

Link to comment
13 minutes ago, satwar said:

I really need some help in getting a calendar program.  Hopefully there's some documentation to explain how it works.  Unfortunately the coding I've seen so far is way beyond my abilities.

As a first project I'd like the program to trigger an even/odd number day to flag permission to a irrigation system to run on even numbered day of my house.

Thank you in advance for your assistance.  I had a program from this forum which ran for many years, and then suddenly stopped and I don't have the skills to troubleshoot.

@asbril would be the best source I know for that subject. (note I flagged him)

Link to comment
47 minutes ago, satwar said:

I really need some help in getting a calendar program.  Hopefully there's some documentation to explain how it works.  Unfortunately the coding I've seen so far is way beyond my abilities.

As a first project I'd like the program to trigger an even/odd number day to flag permission to a irrigation system to run on even numbered day of my house.

Thank you in advance for your assistance.  I had a program from this forum which ran for many years, and then suddenly stopped and I don't have the skills to troubleshoot.

There are some nodeservers that link to Google calendars, but that seems like more work than needed to create calendar events to mark even/odd days.  Maybe your other ideas for a calendar interface or more appropriate.

To detect even/odd days, you should be able to do that just using ISY date/calculations w/o nodeservers.

I'm sure @larryllixcould show you examples.

But if you already have V5 firmware / nodeserver setup (or don't mind setting up) I would look at the Timedata nodeserver that has an even/odd day node.

 

Also, you could post your program that is no longer working and have someone help you understand why.

Link to comment

I use the date programs in this thread with one minor correction:

// Determine Week of Month
 
        $iISY.WeekOfMonth  = $iISY.DayOfMonth
        $iISY.WeekOfMonth -= 1
        $iISY.WeekOfMonth /= 7
        $iISY.WeekOfMonth += 1
        $iISY.WeekOfMonth Init To $sISY.WeekOfMonth
        $sISY.WeekOfMonth  = $iISY.WeekOfMonth

(the scratch math should be done with the integer variable and then copied to the state variable instead of the other way around)

$iOddDayFlag = iISY.DayOfMonth
$iOddDayFlag %= 2
$sOddDayFlag = iOddDayFlag
at the end of the program (or anywhere after iISY.DayOfMonth is set)

note %= is mod or remainder....

then to use it

If sOddDayFlag > 0

then

   it's an odd numbered day of the month

else

  it's an even numbered day of the month

---

disclaimer: odd/even portion is typed off the top of my head, if it doesn't work say so and i'll fix it but I'm short time right now and can't test.

 

Link to comment
28 minutes ago, gzahar said:

There are some nodeservers that link to Google calendars, but that seems like more work than needed to create calendar events to mark even/odd days.  Maybe your other ideas for a calendar interface or more appropriate.

To detect even/odd days, you should be able to do that just using ISY date/calculations w/o nodeservers.

I'm sure @larryllixcould show you examples.

But if you already have V5 firmware / nodeserver setup (or don't mind setting up) I would look at the Timedata nodeserver that has an even/odd day node.

 

Also, you could post your program that is no longer working and have someone help you understand why.

I looked at the time/date nodeserver but one thing that seems to be missed is a combination Month and day combination variable.
However two conditions would suffice to accomplish any date with a yearless condition.

I use a few programs to use the ISY internal system variables that already have that information. When we had to rely on connections, routers and cables to connect with polyglot the one box solution seemed much more reliable, at that time.  Now, with a single box polisy that argument becomes somewhat moot.

 

Have a look at this technique. I use it for most holiday lighting scenes and many other functions. It only uses one trigger variable for triggering other programs.

 

 

Link to comment
1 hour ago, satwar said:

I really need some help in getting a calendar program.  Hopefully there's some documentation to explain how it works.  Unfortunately the coding I've seen so far is way beyond my abilities.

As a first project I'd like the program to trigger an even/odd number day to flag permission to a irrigation system to run on even numbered day of my house.

Thank you in advance for your assistance.  I had a program from this forum which ran for many years, and then suddenly stopped and I don't have the skills to troubleshoot.

I use the Holidays Google nodeserver (Polisy) and it is powerful. Once the nodeserver is connected, you enter a whole day event in your Google Calendar and then a node is created in ISY which you can program to trigger whatever you want.  In fact in my Google calendar I created some 10 different sub-calendars and have a different node for each of these in my ISY. I have these trigger different programs (lights that go ON when the cleaning lady comes, wake-up for when my wife works or when I have meetings, lights that go ON or OFF when we are on a trip, etc etc.

Link to comment
1 hour ago, satwar said:

I really need some help in getting a calendar program.  Hopefully there's some documentation to explain how it works.  Unfortunately the coding I've seen so far is way beyond my abilities.

As a first project I'd like the program to trigger an even/odd number day to flag permission to a irrigation system to run on even numbered day of my house.

Thank you in advance for your assistance.  I had a program from this forum which ran for many years, and then suddenly stopped and I don't have the skills to troubleshoot.

Do you mean even/odd as per the day of the month?  ie, 29,31,1,3,5,etc?  Or do you mean every other day?

ISY time/data node server does both if you want.  There is an even/odd day node that goes by the day of month (as in the example above).

There is also the node "days since epoch" which just counts day after day after day since Jan 1, 1970.  So you can do an even/odd with that by dividing by 2 and if the remainder is 0, it is an even day, if it is 1, it is an odd day.  You will need to transfer the value to a variable.

every other day - [ID 008E][Parent 0093][Not Enabled]

If
        Time is 12:00:01AM
 
Then
        $i.every.other.day  = 'ISY Time Data' Days since Unix Epoch days
        $i.every.other.day %= 2
 
Else
        
 

EDIT: You can can also do even/odd weeks by first dividing by 7, then remainder divide (%=) by 2.  This works for my recycling which comes every other week.

Link to comment

@satwar time/data node server is green. simple. works. 

I do something similar to what you are trying to do and I keep it pretty simple. Am sure it could be optimized, but its readable and easy. I am looking for three options for my sprinkler program #1.

1) 7 days a week, 2) three days a week 3) every other day. 

Three separate programs, plus some other very simple programs to change a variable to differentiate between which program is true. 

1) Sprinkler 1 7 days - [ID 0158][Parent 02BD]

If
        Time is  4:30:00AM
    And 'Non Alarm / Rain Sensor' Logical Status is Normal
    And $Sprinkler_1 is 1
    And $I_Sp1_Days is 7
 
Then
        Run Program 'SP1 Lake 1' (If)
 

2) Sprinkler 1 3 Days - [ID 02D6][Parent 02BD]

If
        On Mon, Wed, Fri
        Time is  4:30:00AM
    And 'Non Alarm / Rain Sensor' Logical Status is Normal
    And $Sprinkler_1 is 1
    And $I_Sp1_Days is 3
 
Then
        Run Program 'SP1 Lake 1' (If)
 

3) Sprinkler 1 Odd Days - [ID 02D7][Parent 02BD]

If
        Time is  4:30:00AM
    And 'Non Alarm / Rain Sensor' Logical Status is Normal
    And $Sprinkler_1 is 1
    And $I_Sp1_Days is 2
    And 'ISY Time Data' Odd or Even Day is ODD
 
Then
        Run Program 'SP1 Lake 1' (If)
 

Two enabler programs for the whole sprinkler system and controller program 1 to run or not:

All Sprinkler - [ID 01BE][Parent 01A5]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        $All_Sprinkler  = 1
        $All_Sprinkler Init To $All_Sprinkler
 
Else
        $All_Sprinkler  = 0
        $All_Sprinkler Init To $All_Sprinkler
 

 

Sprinkler 1 - [ID 0044][Parent 01A5]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        $Sprinkler_1  = 1
        $Sprinkler_1 Init To $Sprinkler_1
 
Else
        $Sprinkler_1  = 0
        $Sprinkler_1 Init To $Sprinkler_1
 

Using Mobil link under advanced options for these programs, I change these "enabling" programs to be:

-Run then: Enable

-Run Else: Disable

-True: Enabled

-False: Disabled.

Delete everything else

I have three more for each of the different #days / week that sets the last variable in the Then and a 0 in the Else. Running an else of any of these shuts down the sprinkler as well. Now it super easy to change between:

-Turn all sprinkler on or off,

-Turn sprkinler program 1 on or off

-Select the three different Days a week I preset. 

 

 

Link to comment
On 1/15/2022 at 3:55 PM, satwar said:

I really need some help in getting a calendar program.  Hopefully there's some documentation to explain how it works.  Unfortunately the coding I've seen so far is way beyond my abilities.

I have attached the coding which i originally used.  The programming starts at folder DayMonthYear:

1496947129_MonthAdvance.thumb.jpg.27a4ef48d53f7d60a80c4d9e8ed676c3.jpg1637623142_MonthReset.thumb.jpg.a4b33c5023d5f5e215bbe84c21f8e5f9.jpgYear.thumb.jpg.b54b161fb892408c9f86db78d2e67037.jpg1913150459_DayofYearAdvance.thumb.jpg.df83f182bc31ec0083f6ef007290b95c.jpg1685912652_OddEvenDay.thumb.jpg.9308ab2467ffd5505bc4188aa7cf9161.jpg337425012_DayofMonthpart2.thumb.jpg.1b78431549b98992f51a08ed460837c8.jpg1912532155_DayofMonthpart1.thumb.jpg.6f26a7653e18b891d5efb6cc9d7d3692.jpg637702301_AdvanceDay.thumb.jpg.c29eae9b06828e52d53843cfee92625b.jpg527771106_DayMonthYear.thumb.jpg.44d6426853aa883ca53ff105a366d70e.jpg270305740_LeapYearCalculator.thumb.jpg.5f4c8a5017a0d6fb546c4703a7f88063.jpg

Link to comment

If you don't have the hardware already setup and running Polyglot, then I would consider using the TimeData nodeserver from Polyglot Cloud.  You need a portal account/subscription for that I believe.  Otherwise I would choose the simple programs below before I went out and bought the hardware to run Polyglot locally.  And for all of this, you need to be on version 5.x of the ISY firmware.

Per @MrBill's example & notes variables that start with i are integer and s are state.

If
        Time is 12:00:15AM
 
Then
        $iOddDayFlag = [Current Day of Month]
        $iOddDayFlag %= 2
        $sOddDayFlag = iOddDayFlag
        $sOddDayFlag Init To iOddDayFlag
 
Else
   - No Actions - (To add one, press 'Action')

 

If
    sOddDayFlag > 0

Then
   it's an odd numbered day of the month

Else
  it's an even numbered day of the month

Link to comment
9 hours ago, gzahar said:

If you don't have the hardware already setup and running Polyglot, then I would consider using the TimeData nodeserver from Polyglot Cloud.  You need a portal account/subscription for that I believe.  Otherwise I would choose the simple programs below before I went out and bought the hardware to run Polyglot locally.  And for all of this, you need to be on version 5.x of the ISY firmware.

Per @MrBill's example & notes variables that start with i are integer and s are state.

If
        Time is 12:00:15AM
 
Then
        $iOddDayFlag = [Current Day of Month]
        $iOddDayFlag %= 2
        $sOddDayFlag = iOddDayFlag
        $sOddDayFlag Init To iOddDayFlag
 
Else
   - No Actions - (To add one, press 'Action')

 

If
    sOddDayFlag > 0

Then
   it's an odd numbered day of the month

Else
  it's an even numbered day of the month

Thank you, I think I may be able to understand this approach.  

Link to comment
6 hours ago, satwar said:

Thank you, I think I may be able to understand this approach.  

Polyglot can be hosted locally or you can host it on UD's server. If you want UD to host it, then purchase it.  It isn't expensive but it is a subscription.  The portal also allows you to access your ISY from outside your LAN without opening any ports.  Also helps manage different users and integrate with Alexa/Google.  A big down side to polyglot on the cloud is if your internet goes down, you have no polyglot and anything ISY needs from it to run programs and stuff will be dead.  On the upside, it doesn't take much to setup when on the cloud.

If you want polyglot local, the cheapest way to add it is to buy a raspberry pi and install polyglot on it.  The rpi with an SD card might be around 50 bucks.  If you want to spend some extra for an enclosure you can, and should if it isn't otherwise secured out of harms way.  Setting up your rpi with polyglot will require you know about rpi or that you follow some detailed directions to the letter.  You could also buy a polyisy.  Polyisy can also host ISY and ultimately it will be required I imagine as the firmware gets fancier and fancier and requires the added horsepower.  Not sure, but I think polyisy might ship with polyglot pre-installed, otherwise installing it on polyisy will be very similar to a rpi.  I got my polyisy in the very first round and had to do all that configuring manually.

Polyglot really expands ISY capabilities.  There are dozens, perhaps even getting up near 100 apps you can install on polyglot that add functionality and integration.  Last I checked, the full list of nodes available using the cloud version of polyglot was shorter than locally hosted, but I can't say for certain as I don't use the cloud version.  Things like integrating with your alarm system, getting weather data, tracking your water, electricity, your roomba, your tesla, and so on are on polyglot.  And of course, detailed time and date info.  Here is a list.  https://polyglot.universal-devices.com/  These are all free to install.  Though a new version of polyglot (v3) is now available with paid nodes.  The hope is that with the $$ incentive, the number of nodes and degree of functionality will go up.  But I use over a dozen of the current free nodes and most are really good.

Link to comment

834268474_SetupOddEvenFlag.thumb.jpg.888b48bff73f038a1c11cc3cc00e9cd0.jpg

22 hours ago, gzahar said:

If you don't have the hardware already setup and running Polyglot, then I would consider using the TimeData nodeserver from Polyglot Cloud.  You need a portal account/subscription for that I believe.  Otherwise I would choose the simple programs below before I went out and bought the hardware to run Polyglot locally.  And for all of this, you need to be on version 5.x of the ISY firmware.

Per @MrBill's example & notes variables that start with i are integer and s are state.

If
        Time is 12:00:15AM
 
Then
        $iOddDayFlag = [Current Day of Month]
        $iOddDayFlag %= 2
        $sOddDayFlag = iOddDayFlag
        $sOddDayFlag Init To iOddDayFlag
 
Else
   - No Actions - (To add one, press 'Action')

 

If
    sOddDayFlag > 0

Then
   it's an odd numbered day of the month

Else
  it's an even numbered day of the month

I've taken a stab at coding by following your advice but there are a few problems.   My thoughts were to write two small programs.  First program to determine whether i'm on a even day of the month and the  second program to operate the irrigation system.

Zone Timers.jpg

Link to comment
12 hours ago, satwar said:

834268474_SetupOddEvenFlag.thumb.jpg.888b48bff73f038a1c11cc3cc00e9cd0.jpg

I've taken a stab at coding by following your advice but there are a few problems.   My thoughts were to write two small programs.  First program to determine whether i'm on a even day of the month and the  second program to operate the irrigation system.

Zone Timers.jpg

a little hard to see your programs, (next time right click on your pgroam, and select copy to clipboard, and then past) I assume the first one follows the example. For the second one, you need to consider two more things: 1) after each zone runs, you need to turn it off, as you turn on the next one. 2) Do you have a pump or is it city water? I have a pump so I need to consider that as well.

Would suggest you do something like this:

Set zone 1 on

wait 20 minutes

set zone 2 on

wait 1 second

set zone 1 off

wait 20 minutes 

etc etc.

This way, there is a slight overlap on your zones and that will reduce any hammer you might get from the water. 

 

Another enhancement you may want to consider is use a variable for time for each zone and then a second variable that you can change to adjust the whole watering schedule. This requires slightly different programing , more of a chain of programs, where each zone is its own program and calls the next one in line.  Here is an example. In this one, I change the variable SP1percent and for all my sprinkler 1 controller programs / times, they all get adjusted. So for dry spells, I may make it 120, for wet spells rescue to 75. etc  Here are two of the programs. I have one for each of my zones. 

SP1 Lake 1 - [ID 02C4][Parent 02BD]

If
        $I_Sp1_Lake_1 > 0
 
Then
        Set 'ELK Controller / Sprkl Lake 1' On
        Set 'ELK Controller / Sprinkler Pump' On
        $I_Sp_Counter  = $I_Sp1_Lake_1
        $I_Sp_Counter *= $I_Sp1_Percent
        $I_Sp_Counter /= 100
        Repeat While $I_Sp_Counter > 0
           Wait  1 minute 
           $I_Sp_Counter -= 1
        Repeat 1 times
           Run Program 'SP1 Lake 2' (If)
           Wait  4 seconds
           Set 'ELK Controller / Sprkl Lake 1' Off
 
Else
        Run Program 'SP1 Lake 2' (If)
 

SP1 Lake 2 - [ID 02C6][Parent 02BD]

If
        $I_Sp1_Lake_2 > 0
 
Then
        Set 'ELK Controller / Sprkl Lake 2' On
        $I_Sp_Counter  = $I_Sp1_Lake_2
        $I_Sp_Counter *= $I_Sp1_Percent
        $I_Sp_Counter /= 100
        Repeat While $I_Sp_Counter > 0
           Wait  1 minute 
           $I_Sp_Counter -= 1
        Repeat 1 times
           Run Program 'SP1 Lake 3' (If)
           Wait  4 seconds
           Set 'ELK Controller / Sprkl Lake 2' Off
 
Else
        Run Program 'SP1 Lake 3' (If)
 

Link to comment
20 hours ago, satwar said:

834268474_SetupOddEvenFlag.thumb.jpg.888b48bff73f038a1c11cc3cc00e9cd0.jpg

I've taken a stab at coding by following your advice but there are a few problems.   My thoughts were to write two small programs.  First program to determine whether i'm on a even day of the month and the  second program to operate the irrigation system.

Zone Timers.jpg

A couple of issues on the first program.

You have sOddDayFlag %= iOddDayFlag

Should be = not %= there.

Also remove the Run Program line from the Then clause.  It does not help running a program @ 12:00am that won't run until 12pm.

On the second program, just use Time = 12:00pm  (remove the for 3 hours, again, not really doing anything)

And I think you want sOddDayFlag = 0 (not <0) for even days (and >0 for odd days)

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...