Google Calendar Schedule?

Discussions of Q-SYS hardware and software.

Moderators: Cameron Shoffner, Christian Cook, Kirk Fyvie, Martin Barbour, Fred Thomke, Gary Evans_QSC, Chris Brouelette

Thu Sep 24, 2015 8:49 am

  • Hello, a client of mine uses Google Calendar to keep track of scheduling for all their events (as a way so many people can log in and see as well as change schedules) they want to know if it's possible to import the Google Calendar into their audio system (QSys Core 500i) So if they need to make changes to opening or closing schedules, or announcements they can just add a line in the Google Calendar and have it updated on the Core.

    Getting the schedule out of Google Calendar is not really that hard, especially with their API, but getting it into the Core is what I am hitting my head on. I already told them it would probably not be an instant thing, maybe an hour or 24 hours to update, and they are fine with that but since so many people will have access to the schedule they really want to be able to have something that can import instead of having to log into the Core and double their work load. I would also like this so I don't have to give out the log in info to lots of people!

    What I am envisioning is I will setup some controls to do the tasks (play announcements, Mute everything, Unmute everything, ect) and they can be triggered by the calendar events. Kinda thinking just add the command to the memo field, and the export will have that as well as the date and time of the event. I am thinking it would be a script that would read the info, but is there anyway to get that info into the schedule portion of the QSYS Admin?
    Matt Drake
    morte615@gmail.com
    --------------------
    Dragon's Fire Design: http://dragonsfiredesign.com
    Facebook: http://www.facebook.com/mattdrake
    morte615
    Possibly an old pro
     
    Posts: 42
    Joined: Tue Jul 22, 2014 6:59 pm
    Location: Orlando, FL

Sat Oct 03, 2015 9:55 am

  • morte615, I am looking into this and will respond once we have an answer for you, thank you for your patience.
    Gary Evans
    Manager, Application Engineering
    QSC Audio Products, LLC[/b]
    Image
    Gary Evans_QSC
    QSC Audio Products
     
    Posts: 5
    Joined: Wed Sep 03, 2014 1:47 pm

Sun Oct 04, 2015 6:55 am

Mon Oct 05, 2015 5:03 am

  • The short answer is no it is not possible.

    Our scheduler shares nothing in common with the architecture of Google's calendar or any other calendar. The problem is that our Scheduler (which is not a calendar) has meta-data like Command Codes etc which do not translate to what Google stores for Calendar events.
    Gary Evans
    Manager, Application Engineering
    QSC Audio Products, LLC[/b]
    Image
    Gary Evans_QSC
    QSC Audio Products
     
    Posts: 5
    Joined: Wed Sep 03, 2014 1:47 pm

Thu Oct 08, 2015 8:30 pm

Mon Nov 09, 2015 6:42 pm

  • I started working on this, as it piqued my interest.

    I got the basics working (LED turns on when calendar event matches the current time).

    If it's useful to you / anyone, here's where I got to (using a Lua Control Script):

    Code: Select all
    require('json');

    EVENTS = { };

    TZ = os.time() - os.time(os.date("!*t"));

    CalendarTimer = Timer.New();

    eventRunner = function()

      local now = os.time();
     
      local bufferedOutputs = {};
      for i=1,#Controls.Outputs,1 do
        bufferedOutputs[i] = 0;
      end
     
      for k, e in pairs(EVENTS) do
       
        -- Check if event currently active
        if(now >= e["start"] and now <= e["end"]) then
       
          -- Check which output to use
          if(e.name == "MUSIC") then
            bufferedOutputs[1] = 1;
          end
       
        end
       
      end
     
     
     
      for i=1,#Controls.Outputs,1 do
        Controls.Outputs[i].Value = bufferedOutputs[i];
      end
     
    end

    CalendarTimer.EventHandler = eventRunner;

    CheckTimer = Timer.New();

    local checkGoogleCalendar = function()

      local parseCalendar = function(table, code, d, e)
        --print (d);
       
        local i = 1;
        local events = {};
        local event;
        for l in string.gmatch(d, "(%g+)") do
          --print (i .. " " .. (l)); i = i + 1;
          if(l == "BEGIN:VEVENT") then
            event = {};
          elseif(string.match(l, "DTSTART:")) then
            local t = string.match(l, ":(.+)");
            local tO = {
              year = string.sub(t,1,4),
              month = string.sub(t,5,6),
              day = string.sub(t,7,8),
              hour = string.sub(t,10,11) + 1,
              min = string.sub(t,12,13),
              sec = string.sub(t,14,15)
            };
            event["start"] = os.time(tO) + TZ;
          elseif(string.match(l, "DTEND:")) then
            local t = string.match(l, ":(.+)");
            local tO = {
              year = string.sub(t,1,4),
              month = string.sub(t,5,6),
              day = string.sub(t,7,8),
              hour = string.sub(t,10,11) + 1,
              min = string.sub(t,12,13),
              sec = string.sub(t,14,15)
            };
            event["end"] = os.time(tO) + TZ;
          elseif(string.match(l, "SUMMARY:")) then
            event["name"] = string.match(l, ":(.+)");
          elseif(l == "END:VEVENT") then
            events[#events+1] = event;
          end
        end
       
        print("Updated from Google Calendar. Retrieved " .. #events .. " events.");
       
        EVENTS = events;
       
        print(json.encode(events));
       
        eventRunner();
       
      end
     
      HttpClient.Download({EventHandler = parseCalendar, Url = "https://calendar.google.com/calendar/ical/kpog0nj6q692p08mj7iiu6dmsk%40group.calendar.google.com/private-0fb520bc2414f7244f28bb65eab37ab4/basic.ics"});

    end

    CheckTimer.EventHandler = checkGoogleCalendar;

    checkGoogleCalendar();
    CalendarTimer:Start(1);
    CheckTimer:Start(10);
    Attachments
    Google Calendar.qsys.zip
    (14.79 KiB) Downloaded 56 times
    gmichael225
    Possibly an old pro
     
    Posts: 26
    Joined: Fri Nov 06, 2015 1:59 am

Thu Jul 14, 2016 8:29 am

  • Has anyone continued working on this? It would be very nice to allow customers to add recordings, bells, Room configurations into the calendar either via UCI or some global calendar application.

    Thanks
    Paul.j.anderson
    Newbie
     
    Posts: 2
    Joined: Tue Apr 05, 2016 9:00 am



Return to Q-SYS Support




Information
  • Users browsing this forum: No registered users and 1 guest