Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Feeds and Calendar
#1
I searched through and I saw several OLD posts about a RSS feed driver or implementation and a Google Calendar integration but they are really old now.

Is there anything current and native that works for this type of integration?  Would be great to build a front page with headline news and my google calendar along with the home automation information.
Reply
#2
(01-28-2020, 07:05 PM)simplextech Wrote: I searched through and I saw several OLD posts about a RSS feed driver or implementation and a Google Calendar integration but they are really old now.

Is there anything current and native that works for this type of integration?  Would be great to build a front page with headline news and my google calendar along with the home automation information.

The RSS Feed driver still works (or did about a year ago).  I was looking for a way to access our Google Calendars, and in the past, you could access it via an RSS feed - Google has since shut that down.  I had downloaded and installed the RSS driver and it works great, but not with Google Calendars.  Once I found out that Google Calendar had an API, I embarked on a Google Calendar driver, but got way over my head with OAuth2 issues, so I did the following:

- Wrote a python script that generates a JSON file - it handles the OAuth2 issues I had initially
- wrote a driver that reads the JSON file and loads it in the fields.  Handles 5 calendars, 50 items total.

What I do is run the python script in Windows Task Scheduler once an hour on the server, and the driver accesses it once an hour.  Could increase it, but for me this works great.  I even have my morning announcements for weather and alerts include events for the day.  Would be great if someone more skilled than me could eliminate the python script, but has worked well since I did it.
Reply
#3
(01-29-2020, 01:08 AM)kblagron Wrote:
(01-28-2020, 07:05 PM)simplextech Wrote: I searched through and I saw several OLD posts about a RSS feed driver or implementation and a Google Calendar integration but they are really old now.

Is there anything current and native that works for this type of integration?  Would be great to build a front page with headline news and my google calendar along with the home automation information.

The RSS Feed driver still works (or did about a year ago).  I was looking for a way to access our Google Calendars, and in the past, you could access it via an RSS feed - Google has since shut that down.  I had downloaded and installed the RSS driver and it works great, but not with Google Calendars.  Once I found out that Google Calendar had an API, I embarked on a Google Calendar driver, but got way over my head with OAuth2 issues, so I did the following:

- Wrote a python script that generates a JSON file - it handles the OAuth2 issues I had initially
- wrote a driver that reads the JSON file and loads it in the fields.  Handles 5 calendars, 50 items total.

What I do is run the python script in Windows Task Scheduler once an hour on the server, and the driver accesses it once an hour.  Could increase it, but for me this works great.  I even have my morning announcements for weather and alerts include events for the day.  Would be great if someone more skilled than me could eliminate the python script, but has worked well since I did it.

Thanks for the info.  I'll try out the RSS driver to pull news feeds for a front page widget.  

For google calendar with the OAuth2 did you explore using an app code to bypass the OAuth2 workflow?  This would give you a username/password method to get direct access versus dealing with OAuth2.  I'm not averse to Python and an external script pulling the data as I'm going to be doing the same thing to get my EcoWitt weather data published to MQTT with hope of then bringing it into CQC from there.
Reply
#4
Let me know if you want me to send the Google Calendar driver and Python Script to you, I need to look through it again and make sure nothing is hard coded, it is simple but works very good to display my calendar, wife's calendar, joint calender, and holidays.  With my setup, if someone shares their calendar with you, it will populate all shared calendars, and it keeps you from having to make the calendar public.  

The python script dumps the google calendar entries into a JSON file, and the driver reads the file, sorts it in chronological order, and populates the fields.

Fields are:  

Email_0? -Email address (Five Emails allowed)
Event0?_Name - Title of the Event
Event0?_Display - Text Display of the Date / Time of the Event
Event0?_EM - Email address associated with the event
Event0?_Start - Start Time for the Event
Event0?_End - End Time for the Event

I attached a snippet of my display.  I used some of the IV features to color code the display so you could tell which email was associated with the particular event.


Attached Files
.jpg   Google Calendar Display.jpg (Size: 144.1 KB / Downloads: 10)
Reply
#5
(01-30-2020, 12:33 AM)kblagron Wrote: Let me know if you want me to send the Google Calendar driver and Python Script to you, I need to look through it again and make sure nothing is hard coded, it is simple but works very good to display my calendar, wife's calendar, joint calender, and holidays.  With my setup, if someone shares their calendar with you, it will populate all shared calendars, and it keeps you from having to make the calendar public.  

The python script dumps the google calendar entries into a JSON file, and the driver reads the file, sorts it in chronological order, and populates the fields.

Fields are:  

Email_0? -Email address (Five Emails allowed)
Event0?_Name - Title of the Event
Event0?_Display - Text Display of the Date / Time of the Event
Event0?_EM - Email address associated with the event
Event0?_Start - Start Time for the Event
Event0?_End - End Time for the Event

I attached a snippet of my display.  I used some of the IV features to color code the display so you could tell which email was associated with the particular event.

That snipet looks great.  Yes Please send me the driver and python code.  I'd love to integrate it.  I'm trying to build out a "front page" view for a home dashboard and this would be great to have... I never remember recycle day and it's on my wife's calendar Smile

Next up to start toying with the TTS again to see what's up there.  Would be nice to setup a TTS reminder to match the calendar events.
Reply
#6
Okay give this a try:

Prerequisites:  Python 3.7  (May be able to use other versions, but this is the one I used.

I have a batch file MenuCalendar.bat in the "C:\Program Files\CQC\CQCData\HTMLRoot\Batch folder, and it gets executed to generate the MenuGCal.json file that is accessed by the Driver.  It uses the Python application and the when the python script runs, it redirects it to the .json file.  I first redirect it to a temporary file, then copy to the .json file that is accessed.  The reason I did this is to eliminate any conflicts with the driver trying to read the file while the file is being generated.  You may have to change some of the paths within the batch file to correspond with your setup.

I use Task Scheduler to run the batch file at startup and every hour after that.  I set the driver to read this file every 2 hours.

The Python script uses a "token.pickle", and you will need to run the batch file (or the python script within Idle) one time to set it up.  It will prompt you for the email you want to authorize, and then create the token.pickle file.  After that, it bypasses the need to log in, and will access the token.pickle file to give access.

Let me know if you have any luck with it.


.cqcdrvpack   GCal.CQCDrvPack (Size: 6.21 KB / Downloads: 2)
.zip   GCal.zip (Size: 1.76 KB / Downloads: 3)
Reply
#7
Here is a scheduled event that kicks off at 8am at my house each day that shows how I use TTS to announce the weather along with the info in the google calendar.  It's a bit long as it turns on different zones of my whole house audio system at the start and then switches them back at the end.  In the middle it announces the weather, then announces the events for the day.  Right now it is set up for 3 events - if you have more than that, you would have to add to this event action.  Within the action, you will need to change Email?@gmail.com (about 2 or 3 places)  with your emails, and you can change (User ?) with your name, which is what I have there.

It also changes some abbreviations within the weather and google calendar so that it says it correctly


.txt   Scheduled TTS Event.txt (Size: 21.11 KB / Downloads: 4)
Reply
#8
Cool stuff. I'll play with this later today as I have time. Thanks!
Reply
#9
(01-30-2020, 10:45 PM)kblagron Wrote: Here is a scheduled event that kicks off at 8am at my house each day that shows how I use TTS to announce the weather along with the info in the google calendar.  It's a bit long as it turns on different zones of my whole house audio system at the start and then switches them back at the end.  In the middle it announces the weather, then announces the events for the day.  Right now it is set up for 3 events - if you have more than that, you would have to add to this event action.  Within the action, you will need to change Email?@gmail.com (about 2 or 3 places)  with your emails, and you can change (User ?) with your name, which is what I have there.

It also changes some abbreviations within the weather and google calendar so that it says it correctly

I looked through your event and info and it has the 'PlayWav' and 'SayTTS' however that runs on the local system??? In the beginning you are adjusting and turning on the different zones but where do you specify the zone you are sending the audio to?  Or do you have your master server connected to the AVR for output?
Reply
#10
On my system, everything plays from the CQCServer output audio port, which is directed into one of the audio inputs on the B&K CT600.  All of the commands at the beginning are to switch to that input and adjust the volume.  

I forgot about the PlayWav stuff - what that is:  I have about 10 .wav files that play randomly prior to the announcements - Robin Williams "Good Morning Viet Nam", and Arnold Schwarzenegger's "Good Morning", etc.  Just something to make you smile early in the day.  The wav files are stored on the server, but I also installed them on the IV computers too, because I used it as described below.

On any of the IV's, you could set up a button to that runs an action that plays something identical to what is in that event, and it would play locally.  I had that at one time, but ended up taking it out because I never used it.

Using the command line parameter /Port on the IV, you can remotely control other IV's, and the help says it will allow you to play wav files and say text.  it is in the help in Tools->Interface Viewer -> Remote Control.  I haven't used this, but may have played around with it sometime in the past.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CQC in the news :) ukbjorn2000 1 1,340 12-29-2010, 11:03 AM
Last Post: Dean Roddey
  Google Calendar...a little underwhelmed. beelzerob 6 1,559 09-27-2009, 09:09 PM
Last Post: anogee
  Migrating Wife to an online "Family Calendar" IVB 6 2,529 04-23-2009, 07:27 AM
Last Post: personalt
  Kaleidescape in the "news" bph 0 1,144 12-17-2008, 04:35 PM
Last Post: bph
  Ripped BluRay playback? Any News? penngray 5 2,099 11-06-2008, 08:41 AM
Last Post: penngray
  Grocery Inventory and Calendar.... noshali 117 21,790 12-28-2007, 06:54 PM
Last Post: AutoX

Forum Jump:


Users browsing this thread: 1 Guest(s)