I am using various google calendars, and with the help of this PI I display upcoming appointments and birthdays in virtual devices. Now I have created anotehr calendar, with public holidays and my holidays. I want to create a event (script) which turns a virtual device on if the calendar has an entry holiday. The calendar is called Holidays, and the only entries are all day events called Holiday.
I use this script (which needs to be adapted) to grab events from my existing calendar to be displayed in my virtual device.
How do I need to change this, to load todays events from Holidays (is {"xxx@gmail.com","Holidays",0}) that right ? I only need to determine if there is an entry, as that calendar is only to store holidays
I use this script (which needs to be adapted) to grab events from my existing calendar to be displayed in my virtual device.
Code:
Sub Main(parm as object) Const ScriptName As String = "SendCalEvents" Dim allEvents As Object() Dim calevents as string = "" allEvents = hs.PluginFunction("BLGData", "", "GetCalendarEventsForXDays", new Object(){"xxx@gmail.com","Holidays",0}) If allEvents.GetUpperBound(0) = -1 ' calevents = "" hs.SetDeviceValueByRef(2035,0,true) Else ' For Each ev As Object In allEvents ' hs.writelog("Info", ev.StartDate & " " & ev.Name) ' calevents = calevents & ev.StartDate.Substring(0, ev.StartDate.Length - 5)& " " & ev.Name & "<br>" hs.SetDeviceValueByRef(2035,100,true) End If End Sub
How do I need to change this, to load todays events from Holidays (is {"xxx@gmail.com","Holidays",0}) that right ? I only need to determine if there is an entry, as that calendar is only to store holidays
Comment