.ics calendar support

I’d like to see an app that reads an ics calendar link and creates events.

My specific use case is for reminders for trash, recycling and compost pickup.

2 Likes

Isn’t that just the calendar application built into your smart phone? Mine notifies me already... :wink:

Seriously though... I am curious...what would Hubitat do with these events? Turn on a light? Speak a phrase? I assume something other than a notification as your calendar app already does that.

Perhaps there is a away to use IFTTT to trigger a Hubitat event when a calendar event occurs?

2 Likes

Well, I’d use a vibration sensor or a pressure sensing mat to know if the proper bins have been moved to the curb. If they haven’t I would do a voice announcement as I don’t always carry my phone.

Another use case would be setting modes around holidays, summer 9/40 work schedules, etc...

There was a google calendar integration built into ST

While initially the thought was silly for my family it did become indispensable for one main reason... when there was NO SCHOOL!!

See on a normal day everything begins at 7am (curtains open, mode changes to day, motion sensors activate for certain rooms) because everyone has to get up and go to school.

But on that random day when there is no school (ie. teacher workday), you could add it to the calendar and the ST app would recognize the phrase 'No School' and trigger a contact sensor to be open.

I then modified our morning routine so that it would only fire at 7am IF the contact sensor 'No School' was Closed.

This is actually quite nice. With HE it has not yet become necessary because there have been no off days from school and with summer coming I can manually adjust the morning start time back an hour or so to accommodate.

But you asked and well . . . believe me WAF went off the charts when this automation was put into place.

3 Likes

I've been trying to setup the GCal Search, the two apps port right over (so far) but only one of the drivers port over without errors.

The GCal Event Sensor driver throws this error when porting over:
No signature of method: Script1.htmlTile() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:mapHTML, action:getMapHTML, refreshInterval:1, width:6, ...]]

Also, when porting over the GCal Search app...we need to enter in the Oauth Client ID and Secret but the two boxes are greyed out. How do we enter in our own values into these boxes? I have the values from Google but can't enter them in.

Thanks

Couldn’t you create rules in RM that run on the days your trash/recycling/compost get picked up?

The day changes when there is a holiday. Also, it’s not all 3 that are picked up every week.

Has ownership given much thought to this?

Has anyone looked into this for a possible solution.

Porting this app over would be a major win!

Anyone every look into this?

Considering it's Cloud-based, would an IFTTT integration work? I'm still migrating from ST/HASS and will eventually take a look at Calendar integrations, but for now that's been my solution :slight_smile:

I had a go at porting this over. I never used the original so I don't know what most of the other functions do, but I wanted to be able to read calendar events in Hubitat :slight_smile:
It works for showing the next event (with optional filter) using the Contact/Event sensor type.

I didn't test any of the notification stuff (would prefer to do this via Rule Machine myself, unless there is some reason it's built into the app itself?), and didn't test the Presence sensor type either.
But it's a start - feel free to modify as necessary!

Note: The connecting to Google part is a little clunky, as you'll have to go out to a separate tab and enter a code, but you'll only have to do the linking once.
(Couldn't get the original web flow to work with Hubitat because both Google and Hubitat wanted to use the access_token parameter when returning the callback to the app).

3 Likes

I reported this to @chuck.schwer. hopefully a working solution can be found. I was wanting to port this app as well just waiting for this to work properly.

1 Like

If anyone downloaded this to try, I suggest updating all 4 (2x driver code, 2x app code) with the update I just posted, and then turn off the new toggle for Logging in the GCal Search app.
The original ST app has an extreme amount of logging... unnecessary if you're not experiencing an issue.

Hi there,

I just tested this as I am moving from ST to Hubitat. I detected 2 major issues which causes the GCal Search app to be impossible to use for now :

  • The Contact/Event sensor type finds the next event when created, but when a new event is added in Google Calendar, the sensor does not update rightly to the new event. Indeed, only the "eventTime" will update accordingly to the new event, but everything else stays locked to the previous event's values. Even when pushing "refresh" this does not correct itself.
  • The offset notify function is not working. I set some offsets in the app, but no offset works at the expected time, nor any of the offset values in the sensor are filled with good values (such as startMsg, or endMsgTime).

Do you think you could look into this ? I will keep my ST hub while this is not working, and will use IFTTT in order to transmit the values needed into Hubitat, but this is not optimal at all.

Thank you very much.

Hi @hgozilla, I just tested this and did not see the issue you described.

I had a GCal Event sensor that had picked up an event... I then added a new event before that one, and when the sensor next refreshed, all the values had updated correctly, not just the eventTime. Can you give me the exact steps on how to reproduce this?

I did note that I hadn't tested any of the notification parts of the original app. I use Hubitat's Rule Machine for notifications instead. Could you set a delay in RM to achieve the same thing...?

@cometfish thank you very much for porting over this solution from ST! I have enjoyed using it over the past many months since you posted the code. I have been able to automate my home based on school holidays, family member being sick, parent traveling, and guest staying.

I mentioned to @sburke781 and @neonturbo that I made some edits to this app in this thread:

I wanted to post my version in case anyone is interested. My use case is much simpler and I removed some of the complexity from the ST/ported version to address the following features and use case:

  • Simpler solution using a switch instead of presence and other sensor
    • Ability to set a default value of the switch that is used when there is no calendar entry and the switch will toggle from that value if there is a calendar match. This is useful if you prefer the switch to be of a certain value in dependent rules and apps or viewing on a dashboard.
  • Moved the processing of the search string match to the calendar title to HE. I had problems depending on Google's search to match the search string to the calendar title. Many times a wrong calendar entry was matched.
  • Ability to enter multiple search strings separated by commas for the same switch
    • By default the search string entered will be matched to the google calendar title using a starts with match - calendar enter starting with search string will match
    • A contains search can be entered by inserting an asterisk within the search string. For example to match both Kids No School and Kids Late School, simply enter Kids*School
  • Caching of the day's calendar entries for a set period of time. This is useful when you have many switches checking the calendar for entries that run near the same time. For example I have 5 different search trigger apps that I set to run at 1 AM so instead of querying the calendar 5 times, the first one will cache the results so the others can leverage the cache. Default cache is 5 minutes.

My forked version can be found here:

5 Likes

I ran into an issue that I don't know how to solve with Google when trying to set this up.

I don't have Gsuite, so I have to select "external use" app and verify my app with Google. I don't have a domain (that I know of) for the verification process, and Google claims it may take "weeks" to verify my app...

So I guess you need a business account to use this?

Sounds great! There was definitely a LOT of unnecessary complexity in the original ST app... and I'd noticed it loaded the calendar once for each switch instead of load once and cache - that was one of the items on my list to look at one day.
I'll take a look at your upgraded version :slight_smile:

You shouldn't need a G Suite/business account - I am using a personal one.
There's no verification needed if you can select Application Type: Internal. What did it say when you tried?