About This File
Hi All,
I came across the problem of making my private Google Calendar's entries available in HC2 with the intention of using it in some of my home's automation scenarios. Since I was unable to find any simple solution on the internet I did create my own and here it is
The scene runs on my HC2 since few weeks without any issues. I did schedule the scene using Sankotronic's Main Scene for Time Based Events and it is synchronizing my Google Cal every hour.
There are three basic steps to make the scene working for you:
· Provide the link to your google calendar by modifying the address hold in the local variable
local gCalUrl = https://calendar.google.com/calendar/ical/xxxxxxx.ics
- Create global variable GCalendar which will hold the synchronized Google Calendar entries
- Maintain the translation table monthMapping to map the names of the months to your local language. This is needed due to the fact that global variable “Month” could the name of current month in your local language – which is the case for me.
Once GCalendar global variable is synchronized with Google Calendar I can use it in "good morning" scene which is reading the agenda for the day once I'm brushing my teeth in the morning
Any comments highly appreciated.
Global variable GCalendar is holding the information on upcoming events. The information is structured in the following way:
GCalendar = { Name, StartDate, EndDate, WholeDay };
Name holds the name of Calendar event, StartDate and EndDate are the event's start and end-date accordingly, WholeDay is a flag with values "Yes" in case the event was defined as "whole day" and "No" if this isn't the case.
jompa68 did create VD which shows today's events from your calendar for current date. VD is attached below (hope you don't mind jompa68 but having it in the first post makes it easier to find ).
Update 8.3.2017
Thanks to @jompa68 I realized there is no handling of recurring events. Honestly I did not think this small topic can be so much complicated... anyway. Some basic recurrence rules should now be supported by the script.
Update 12.3.2017
@emielstroeve figured out that calendar events marked as "whole day" were not recognized by the script. Version 1.2 solves this problem by adding the missing functionality. I did extend the structure of GCalendar variable with additional field "WholeDay". The field contains "Yes" in case the event is defined as "whole day" otherwise the field is set to "No".
Recommended Comments
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.