Announcement

Collapse
No announcement yet.

Google Calendar

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

    #31
    Originally posted by zimmer62 View Post
    I like this idea the best. As it makes it a lot less complicated for anyone who might or might not use this. Lets me invent my own tags, and deal with them as needed.
    I am thinking of adding some sample scripts for those that may not think of, or not know how to start creating their own tag language

    Originally posted by zimmer62 View Post
    I'd be curious a bit more about the eventid going into "A" device because I see a little bit of conflict there if two or more things are scheduled at the same time. Sometimes I have several all day events, or even two at the same time on my calendar.
    This is a collision problem I am aware of. I need to do some testing to see if the CheckTrigger call (this is what a plugin calls to have HS fire any events that match this trigger) is blocking or not. If it is blocking, great, I just need to add some logic to the Sleep call so that I don't lose time when polling Google.

    If it isn't then I don't, currently, have a solution that I am happy with that will pass information consumable by the 'Action' portion of an event.


    Originally posted by zimmer62 View Post
    When would all day events be triggered?
    I have not played with those yet. But they should work like any other event, the only difference is the start time is likely hard coded for midnight.

    Originally posted by zimmer62 View Post
    Would it be possible to ask your plugin current active events?
    Sure. There are a number of ways you can get a list of event. I currently have today's events, events for the next 24 hours, events between data/time and date/time, events containing the keyword X. So getting the list of actives (assuming that events spanning multiple days always get returned to be if I check for today's events) isn't that hard to do.

    Originally posted by zimmer62 View Post
    Will there be an event style object where we can just load it and refer to it's properties, or are you going to have GetName, GetDescription, GetWhatever?
    Yes, you can do one of two ways. Either calling into the plugin for a specific piece of information (title, start time, etc), or call to get the specific event and use the object returned.


    Originally posted by zimmer62 View Post
    Public Function GetUpcomingEvents(ByVal t As Timespan) As List(Of GoogleEvent)

    Public Function GetPastEvents(ByVal t As Timespan) As List(Of GoogleEvent)

    Public Function GetEvents() As List(Of GoogleEvent)

    Overloaded:
    Public Function GetEvents(ByVal search As String) As List(Of GoogleEvent)
    I'm currently using two DateTimes, but adding TimeSpan is trivial.

    Originally posted by zimmer62 View Post
    When I look at my google calendar I see a bunch of calendars, some of which I'm subscribing to public calendars, some of which are my friends, and several of my own also which a couple are public. Will this support multiple calendars such as this? e.g. I have a calendar for my ice hockey games that I share publicly, but these events aren't on my personal calendar. However I see them just fine when I bring up google's web interface.
    At first I am just going to deal with the calendar you are the owner of. Then I can look into supporting shared and public calendars.

    Comment


      #32
      Originally posted by BootsC5 View Post
      I poll google for events, if it is time for the reminder or start time I put the GC eventid into a device, then call the trigger. Your trigger would then pick up the eventid, via a script, then call back into the plugin for details (title, desc, location, etc) and you can do whatever you want with that information.
      this is somewhat similar to what i'm doing with my xPLGCal app http://www.doghouselabs.com/software...pl&app=xPLGCal

      Comment


        #33
        Sometime in the next few days, hopefully not more than a week or two, I will post/donate some code for this effort.

        In my copious spare time I recently wrote a plug-in for Google calendar. One of my kids and I got Android phones and they are (naturally) heavily Googlized, and the integration is so nice that I do not mind being forced into the Google apps. So, given how much of a PITA it is to synchronize calendars for the entire family with Outlook, I was easily tempted to change. I had an Exchange server set up just so that we could use public folders and have one calendar that we could add appointments to from any computer via Outlook, and then HomeSeer could access via Outlook to read our appointments to us. I was in the process of creating a script to send SMS messages to remind us of appointments when the Android phones hit us, so I instead picked up the Google Data SDKs and our template/sample plug-in and went that route.

        I have no plans to make the plug-in able to modify the calendar entries - the Google calendar UI is fine for that, and it saves me having to teach my wife how to logon to HomeSeer from her office anyway... The plug-in as it stands right now does not have any triggers, conditions, or create any devices. I did have plans to do some of that, but I could not find some strong need for anything so I had not done anything yet. I could not find any strong need because the Google options for SMS, Popup, and eMail reminders are more than enough! (The Popup reminders appear on any browser that is open to the calendar, and on the Android phone they work like a regular alarm/notification.) About the only thing I was strongly considering adding was a calendar for HomeSeer actions! I was thinking that the description of the event could have some script commands or some sort of pseudo language syntax for changing a device or triggering an event...

        The plug-in currently does just what I needed it to do at a minimum - in my family we each have our own calendar, and we have allowed each other to have access to the other calendars, so when I log in to Google Calendar I see the appointments for everybody in the family in different colors, plus we have a calendar for the Holidays. In the plug-in, I can enter the login credentials for each of these calendars and that makes them all available to the plug-in. A friendly name can be assigned to each login so that you can have HomeSeer speak appointments like: "Rick has an appointment tomorrow at ..." rather than speaking your Google calendar email address...

        The plug-in does not work with the individual date entries for recurring appointments - it fetches the day's appointments as single entries so that if a recurring appointment happens on a particular day, then it appears as if you entered the appointment just for that one day. That is something I thought about changing or writing an option for handling, but it did not bother me enough to follow through with it.

        At any rate, since there is desire here to work with this and I already have a head start on it, and really have no time to put in most of the wishlist items that I have for it, I think it would be helpful if I just donated the code to give any of you a head start on it. It is written in VB.NET but could be converted very easily to C# if you wanted.

        So just a head's up - I need to fix something with the date range selection of appointments and then I'll post a package with the source code.
        Regards,

        Rick Tinker (a.k.a. "Tink")

        Comment


          #34
          Thanks Rick! As a feature request, and to solve a "problem" with device proliferation. Would it be possible to add an optional trigger data blob to the end of a CheckTrigger call that is not part of the trigger pattern matching? (there are likely some backwards compatibility issues with this request)

          I'm not sure of the best way to pull the data out for the event action but perhaps just an array of strings, or maybe even key/value pairs.

          Comment


            #35
            Originally posted by BootsC5 View Post
            Thanks Rick! As a feature request, and to solve a "problem" with device proliferation. Would it be possible to add an optional trigger data blob to the end of a CheckTrigger call that is not part of the trigger pattern matching? (there are likely some backwards compatibility issues with this request)

            I'm not sure of the best way to pull the data out for the event action but perhaps just an array of strings, or maybe even key/value pairs.
            Huh? What are you looking for?
            Regards,

            Rick Tinker (a.k.a. "Tink")

            Comment


              #36
              I think he's referring to when writing a plug-in trigger call, he's like to attach some data to it.

              So a trigger happens, and then you want to run an event with that extra data, possibly passing it to a script through a parameter.

              So the trigger is checked, and matched, but maybe there were several reasons it was match. In this case because there were multiple calendar events all schedule to start right now. If we have a way to pass that data from the trigger to an action of some type like a script with that data as the parameters he wouldn't have to create devices for each event id.

              I'm not sure it's possible without a bit of work on the homeseer side how it handles triggers, and a good way to go about this might just be create a single virtual device and set it's value to a delimited list of eventids
              Joe (zimmer62)

              BLSecurtiy, AC-RF2, RCS Serial Thermostats, RFXCOM SMarthome SwitchLinc, mcsXap, Global Cache GC100, SqueezeBox, TWA_ONKYOINTEGRA, BLLogMonitor, BLPlugins, BLRadar, BLSpeech, BLZLog.aspx, HSTouch (Windows, iPhone, iPod), USB Mimo touchscreens, VMWare Server, Vortexbox, Windows Home Server, MyMovies, Windows Media Center, X10, ZWave, and much much much more.

              Comment


                #37
                I took that conversation with Rick offline.

                I am going to suspend the work I am doing until I get my hands on what Rick has to offer. In the mean time I should get back to some of my other half written plugins.

                Comment


                  #38
                  Let me know if you need any help. I'd love to take a look at Rick's source as well.
                  Joe (zimmer62)

                  BLSecurtiy, AC-RF2, RCS Serial Thermostats, RFXCOM SMarthome SwitchLinc, mcsXap, Global Cache GC100, SqueezeBox, TWA_ONKYOINTEGRA, BLLogMonitor, BLPlugins, BLRadar, BLSpeech, BLZLog.aspx, HSTouch (Windows, iPhone, iPod), USB Mimo touchscreens, VMWare Server, Vortexbox, Windows Home Server, MyMovies, Windows Media Center, X10, ZWave, and much much much more.

                  Comment


                    #39
                    Here you go...

                    If you modify this and wish to post a version for consumption by other users, post it in a more appropriate forum (script/plug-in library).
                    • This does not support conditions, triggers, or actions.
                    • It only provides read access to appointments, but it does so for multiple Google calendars (we have one for each member of the family plus a "Family" one for general appointments/reminders or family activities).
                    • Calendar account passwords are NOT encrypted in the INI file.
                    • There is a configuration web page, and a web page that allows you to view the events that it currently has downloaded.
                    • The interval in which the plug-in updates the appointments is configurable in the configuration screen.
                    • There is a script command and a web page button to instantly update/refresh the appointments in case you know you just made a change to the calendar and want to have it updated in the plug-in sooner than the next regular update interval.


                    The idea in its usage was that the plug-in would update the appointments on a regular interval, and would retrieve the number of days that you specify each time, so they would always be in memory for when you called for them in a script. What this means is, if you set up the plug-in to return a week's worth of appointments and then tell the plug-in to give you the appointments for a date range, the range cannot exceed the max number of days you are retrieving - so if you ask for an appointment 2 weeks in the future and you only downloaded 1 week, it does not go and grab another week's worth, it just returns nothing for that 2nd week.

                    Script commands to gather appointments are prototypes for various types of queries, but fall generally into two categories: Retrieving using the date only, or retrieving using date and time. This allows you to, for example, request the appointments for a date at 5PM in the evening, and it will only return the appointments remaining in the day after 5PM rather than everything you already did that day.

                    There were some changes I made recently that were not reflected in the documentation - I think something minor in the event object that is returned by a calendar query command.

                    The objects returned by a calendar query are objects created by the plug-in and are described in the documentation. The plug-in and all of its objects were not coded to be COM visible, so they will not work within a VB script without some work - there is an included VB.NET script that shows having the appointments spoken for the day.

                    You need to already have the Google Data API installed, but the code/project already has them referenced, and the output copies them to your output directory, so it is pretty easy to just copy the DLLs from the output directory to the root directory of your HS system to install or update it. The BIN directory contains a compiled version ready to go.

                    Post your questions about it here and I will answer, or if they are very specific to something you are doing and are not any value to the rest of the users, then send me an email.
                    Attached Files
                    Last edited by Rick Tinker; September 1, 2011, 10:43 AM. Reason: Updated source zip file to version 1.1
                    Regards,

                    Rick Tinker (a.k.a. "Tink")

                    Comment


                      #40
                      Rick, Thanks for the code...looking forward to playing with it, I have wished for a good calender plugin for some time.

                      One thing I have to ask is why do I have six new devices; [1 - [6...[1 is listed as 'Acme Panel Status' with 'No Connection' in the device string and an arm/disarm button, the rest are listed with Zone 1/2/3/4/5 and have no data inside. The room is given as 'HSGcal' so must be something to do with the plugin...I looked in the documentation and it said no devices are made by the plugin? Not causing a problem for me just a bit confused why they are there!

                      Comment


                        #41
                        for read only access, there is no need to store passwords. just use the "magic cookie" http://code.google.com/apis/calendar...uthMagicCookie

                        Comment


                          #42
                          Originally posted by mrhappy View Post
                          Rick, Thanks for the code...looking forward to playing with it, I have wished for a good calender plugin for some time.

                          One thing I have to ask is why do I have six new devices; [1 - [6...[1 is listed as 'Acme Panel Status' with 'No Connection' in the device string and an arm/disarm button, the rest are listed with Zone 1/2/3/4/5 and have no data inside. The room is given as 'HSGcal' so must be something to do with the plugin...I looked in the documentation and it said no devices are made by the plugin? Not causing a problem for me just a bit confused why they are there!
                          Sorry about that - forgot to nix that code. The plug-in was created using the sample plug-in from our developer's SDK, and the sample creates a fake alarm panel plug-in. I set the flags to tell HomeSeer that it had no triggers, conditions, actions, etc. but forgot about those devices!! They do not do anything but sit there looking pretty... First one to nix them from the code wins!
                          Regards,

                          Rick Tinker (a.k.a. "Tink")

                          Comment


                            #43
                            I just wanted to make sure someone is going to be working on this.

                            I wanted to know who to make my wish list know to....
                            Dick
                            HS PRO 2.5.0.81, WinXP, IE8, Shuttle XS35V3, 2.13GHz, 4GB, 40GB SSD drive, AC-RF2, ADIOcelot, Message Server, TI103, SNEVL CID, pjcOutlook, MCSTemperature, Powertrigger, BLBackup, BLFloorplan, BLIcon, BLOccupied, BLRadar, BLRfid, BLLogMonitor, ACPUPSD, UltraECM, WeatherXML & Stipus' script connector. 500+ devices, 260+ events, 1-wire weather station + temp/humidity sensors & Oregon Scientific temp & humidity sensors & 2 Brultech ECM-1240s

                            Comment


                              #44
                              Has there been any progress or updates to this project, or is everyone just working with Tink's PI?
                              Larry

                              Comment


                                #45
                                ok, side question...

                                I've been trying to setup the calendars properly for a few days...

                                Here's what I have:
                                One calendar for each member for the family.
                                The Homeseer account.

                                What I want to do, is when someone adds an event to their calendar, have it pop up on the homeseer account, which then would propogate out as a read only thing to the other accounts.

                                The reason for this is:
                                Each phone, uses Google exchange protocol to get e-mail, and calendar events. If I can make the phones be able to see all of the calendars, that would be perfect.

                                Right now, if the events would be pushed from the Homeseer account to each individual account, then this works itself out.

                                Or, if I can make them all only see the Homeseer account for calendar functions, YET have them get their own e-mail through push, that would also work...but I think having each phone ONLY see it's own calendar, so when a user adds an event, it will show up to everyone else as that person made the event.

                                Any ideas? I'm kind of sick of trolling through all the Google forums (spent about 3 days over the past 2 weeks looking).

                                Thanks!

                                --Dan
                                Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

                                Comment

                                Working...
                                X