Announcement

Collapse
No announcement yet.

Check if date is a holiday

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Ok a couple people asked me to post this as well as Sparkman so here it is. It will (when called) verbally tell you about upcomming events/holidays in the next 7 days. It will state these in the appropriate format. EA: Tommorrow, Day after tommorrow, "in (3,4,5,6 Days) or if it is 7 days away it will state next [Week day name].

    I have also included the .ini covering other U.S. holidays, Daylight saving time reminders ect.

    I emailed the .ini file to sparkman as well as this script. Please feel free to put these in future .zip files that you may upload.
    Attached Files
    Visit My Home Seer Site at:
    www.JohnWPB.com
    Created with LCARS

    Comment


      #17
      "Did only cal.asp have problems with the date/time format? If so, I'll see if I can rewrite it to be non-locale specific."

      This was the only file (apart from the ini) that I changed

      "Also, is there any rime or reason as to what days May day and Bank holidays fall on?
      What's the purpose of a Bank holiday? Is that when the banks are closed, or are they days off when everybody goes to the bank"

      Bank Holidays are Public ( or statutary) holidays and the banks are closed, though these days most of the shops are open. Where a holiday falls on a weekend, like christmas for instance, then we would have an equivilant bank holiday during the week. May day is supposed to be the first of May and I guess there are other general rules for the others, but they are all fixed by the government and may vary from the rules

      As to the comments about events or holidays, it would be great to be able to differentiate between those days you need to be reminded of and those when you do not need to be dragged out of bed so early! This includes weekends as well

      Cheers
      Kevin

      Comment


        #18
        Hi Kevin,

        I've attached a new version of cal.asp. It should be non-locale specific. Can you try it out and let me know if it works?

        Cheers
        Al

        - Dec. 19/2003: Removed attachment as this version of the file has been included in the download.

        [This message was edited by Sparkman on Fri, 19 December 2003 at 07:41 PM.]
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #19
          Sparkman,
          (Geez, that is a great handle!) I for one really would love to have your routine (or maybe a new routine, since you've now got a following) return an array of matches rather than just one. I already have a home-grown script which displays whatever important stuff is happening each day on a BetaBrite. In our particular case, it turns out that my wife's family has several over-lapping birthdays. Seems like a statistical anomoly, but I married her... Anyway, what I'd like is a way to call a script with a particular date, and get back as many "holidays" as match. If you are too busy, I can take a look at it and correspond via email, but I trust your work better than mine.

          Steve

          Comment


            #20
            Hi Steve,

            In case you're wondering how I got the nickname/handle, Sparkman is a translation of my last name (Vonkeman, which is Dutch) into English... I do get the occasional email from people that actually have Sparkman as their last name wondering if I'm related.

            I've been given more thought on a good way to return multiple items. My current thoughts are to return a multi-dimension array that would contain the following for each event that occurs on that day:

            1. the name of the event (Uncle Bob's Birthday, Christmas, etc.)
            2. whether to use the event in announcements (True/False)
            3. a string containing the announcement (like Happy Birthday, Merry Christmas, etc.)
            4. whether to use the event to modify behavior of other scripts like a wakeup script (True/False)

            The INI file would look something like this:

            [Holidays]
            Holiday1=Christmas
            Holiday2=Uncle Bob's Birthday

            [Christmas]
            Date=December 25
            Announce=True
            Announcement=Merry Christmas
            ChangeBehavior=True

            [Uncle Bob's Birthday]
            Date=December 25
            Announce=True
            Announcement=Happy Birthday Uncle Bob
            ChangeBehavior=False

            Any other items that people would like to see returned?

            I should have some time this weekend to whip something up. For now, I'll create a separate function and INI file, but eventually I would see the 2 merging (unless there's a demand for the "simple" version).

            Cheers
            Al

            [This message was edited by Sparkman on Fri, 19 December 2003 at 12:13 AM.]
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #21
              err... Well, maybe I can wait. (I'm going on holiday with the family for a couple of weeks, and so won't have direct access to Homeseer for a while)

              What you've suggested sounds great to me, since I haven't actually become dependent on your original version. However, it sounds like it will break everything with everyone else. If we can get past that, I'd be THRILLED with what you've described. I'll stay tuned, albeit from a thousand miles away from my Homeseer server...

              Steve

              Comment


                #22
                Sparkman

                Yes, thats great works fine for me

                Perhaps you could consider adding a ToDo list to the package as well?

                Kevin

                Comment


                  #23
                  Hmmmm a "to-do" list would be nice.... Sparkman, I commend you for taking on this task I started out with the idea of writing this script over a month or so ago.
                  Before I even got it up and running I had some GREAT suggestions. One of them was what you could call a to do list. Holidays happen on a given date every year. and this script handels this PERFECTLY!
                  A "to do" list would consist of possibly another area or subroutine. I personally think this would be better as a 2nd .ini file or text file. The first and current .ini file should never need changed as these holidays happen on the same date, or given day of the month.

                  The second .ini would be user definable dates such as vacations, doctors appointments, upcomming weddings, graduations ect. Anything that would not happen every year, but something you could set as a reminder just once.

                  This is a totally different set of rules that would apply. Holidays are something that happens EVERY year on a given date that is calculated. "reminders" are something that would be added as necessary when needed. These would obviousally occur only once, to never recur or happen again.

                  The reason I mention a 2nd .ini is that this could be used for a completely hard coded date including the year. For instance:
                  Doctors appointment, December, 29, 2003. The main difference from the holiday calculation is a routine to look not only at the day and month, but also the year.

                  Wow, this is getting a bit complicated, but I think it could be done. After all, from what I have seen on this message board, a script is not something that is released and final, but a starting point for improvement
                  I should close this post now, as I have really started to ramble on here My mind often goes faster that I can control or even keep up with!

                  If anyone has any ideas's on how to handle this, or accomplish this, or suggestions, please post! Often it is not the script that is the hard part, but knowing what would actually be useful to others.

                  - "Home automation is no longer a thing of the future"
                  Visit My Home Seer Site at:
                  www.JohnWPB.com
                  Created with LCARS

                  Comment


                    #24
                    Hi John,

                    This project does seem to be getting a bit bigger everyday .

                    The script/INI file does currently support non-recurring events/hard coded events. I think the main issue with using it for those types of events is how to easily add/delete the events without having to manually edit the INI file. This works OK for recurring holidays, but would be a pain for one-time events. I might be able to accomplish it by opening a window when clicking on a date in the calendar. The new window would give you options to edit or add events on that date, and write them to the INI file.

                    Thoughts?

                    Cheers
                    Al
                    HS 4.2.8.0: 2134 Devices 1252 Events
                    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                    Comment


                      #25
                      Hi all,

                      Version 2 has now been released. It will return an array of the events/holidays that occur on a given date along with other parameters. To see a full description, go here.

                      The calendar, announcement script and the examples have all been updated to take advantage of the new features. Take a look at them to see how to call the function. The function has been renamed to WhichHolidays from WhichHoliday. The WhichHoliday function is still included to ensure backwards compatibility.

                      The scripts are compatible with the old version of the INI file as well, but there are additional sections that can be added.

                      If you have any questions, let me know.

                      Cheers
                      Al
                      HS 4.2.8.0: 2134 Devices 1252 Events
                      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                      Comment


                        #26
                        This is a very good script and I can see many uses for it.

                        I do have a a question, I am not sure what ADO stands for unless it's for Another Day Off..

                        Also a suggestion:

                        Would it be possible to have a selection that would dictate the maximum number of days prior to the event that an announcement can be made. An entry of "0" would only announce of the day of the event, a "3" would announce the event 3 days prior to and everyday up to the event.
                        Here's an example

                        [Christmas Day]
                        Announcement=Merry Christmas
                        Image=/images/christmas.gif
                        Remind=False
                        Announce=True
                        ChangeBehaviour=True
                        AnnouncePrior=2

                        This would announce Christmas on the 24th and 25th.

                        I guess it would just make the house smarter. I might like to know 7 days in advance for a Doctor's appointment but I don't need to know this information for Halloween except the announcement on that day.

                        As for birthdays I can select a different number depending if a friend or relative lives further away so that I have enough leway to send a card.

                        Just a thought,
                        Bernie

                        Comment


                          #27
                          I was going to suggest the exact same thing.
                          Great package, by the way!

                          Mark
                          Mark

                          Comment


                            #28
                            Hi Bernie,

                            <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Bernie:
                            This is a very good script and I can see many uses for it.

                            I do have a a question, I am not sure what ADO stands for unless it's for Another Day Off..
                            <HR></BLOCKQUOTE>

                            Glad you like the script. As for ADO, that's exactly what it stands for

                            I left some of my days-off as examples in the INI file. Just delete the entries that you don't need.

                            <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>
                            Also a suggestion:

                            Would it be possible to have a selection that would dictate the maximum number of days prior to the event that an announcement can be made. An entry of "0" would only announce of the day of the event, a "3" would announce the event 3 days prior to and everyday up to the event.
                            Here's an example

                            [Christmas Day]
                            Announcement=Merry Christmas
                            Image=/images/christmas.gif
                            Remind=False
                            Announce=True
                            ChangeBehaviour=True
                            AnnouncePrior=2

                            This would announce Christmas on the 24th and 25th.

                            I guess it would just make the house smarter. I might like to know 7 days in advance for a Doctor's appointment but I don't need to know this information for Halloween except the announcement on that day.

                            As for birthdays I can select a different number depending if a friend or relative lives further away so that I have enough leway to send a card.
                            <HR></BLOCKQUOTE>

                            Great suggestion. I'll implement it slightly different though. There are currently two entries in the INI file related to this, Announce and Remind. Announce is set to True if you want to announce it the day of the event and Remind is to remind you before the event (For occasions that you may want to be reminded before the event, but not on the day itself). To keep the terminology consistent, I'll add RemindPrior. If RemindPrior was 0, you would have no reminders prior to the event, and it would only be announced on the actual date if Announce was set to true. Let me know if you think this would work for you.

                            Cheers
                            Al
                            HS 4.2.8.0: 2134 Devices 1252 Events
                            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                            Comment


                              #29
                              Sparkman,

                              This would be a great addition and would work perfectly. I was just suggesting a method but wanted to leave all the details to you, especially that you will be doing the actual implementation.

                              I also thought that you could use the Reminder to do the same. A Reminder=0 would be the equvalent of Reminder=False and a Reminder=4 would announce 4 days prior.

                              Thank you for taking the time to work on this suggestion.

                              Bernie

                              Comment


                                #30
                                Hi all,

                                Released version 2.1 which adds the RemindPrior and Email parameters. For the explanation of how to use them, look at the posting in the Script Library. This version is backwards compatible.

                                Cheers
                                Al
                                HS 4.2.8.0: 2134 Devices 1252 Events
                                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                                Comment

                                Working...
                                X