[RELEASE] iCal Calendar Switch Driver

I am happy to share a new custom driver for Hubitat that allows an iCal (ICS) calendar feed to directly control a virtual switch based on scheduled events.

This driver is designed for users who want reliable, calendar-driven automations without requiring timezone overrides or complex rule logic. It follows standard iCal feeds, including Microsoft 365 / Outlook calendars, and evaluates events using the hub’s configured timezone.

Key features
• Drives a Hubitat switch ON/OFF based on active calendar events (including the ability to specify X minutes before or after)
• Uses the hub’s timezone for display and scheduling (no manual timezone selection required)
• Parses common Outlook / Microsoft 365 calendar feeds, including calendar-level timezone data
• Expands recurring events (RRULE) such as weekly meetings
• Supports event filtering and exclusion logic to avoid false triggers (including subjects, tentative/busy/free, all-day events, etc.)
• Designed for stability and transparency, with clear logging for troubleshooting

Typical use cases
• Turn lights, modes, or presence indicators on during meetings and off when they end
• Drive Do Not Disturb or notification suppression automations
• Trigger routines based on work schedules or shared calendars
• Provide a reliable calendar-based “busy” switch for Rule Machine

Availability
• Source code is available on GitHub – search for:
truittchris / he_ical_switch

• Available via Hubitat Package Manager – search for:
iCal Calendar Switch by truittchris

Both installation methods are fully supported. If you already use Hubitat Package Manager, that is the recommended approach.

Feedback and contributions
This is an actively maintained project. Bug reports, feature requests, and pull requests are welcome. Please include logs and a brief description of your calendar source when reporting issues, as iCal implementations can vary.

If you find this driver useful, feedback in the thread is appreciated and helps guide future enhancements.

6 Likes

This is awesome! I don't yet have a need, but I'm sure I will soon!

Thanks! If you end up using it and are looking for additional or different functionality, just let me know.

1 Like

To add some real-world context on why I built this driver and how I use it day to day:

I work from home, and the problem I needed to solve was twofold:

  1. clearly signaling to my family when I am in a meeting (because closed doors aren't enough...), and
  2. automatically managing Do Not Disturb on my phone without manual intervention (because I never remember to do it manually).

Using this driver, my Hubitat hub monitors my work calendar. One minute before a meeting starts, the virtual switch turns on. That single switch activation does two things in my environment (via WebCoRE):

• It turns on a visible light indicator in the house so my family knows I am in a meeting
• It sends a message to my Android phone, which Tasker intercepts and uses to enable Do Not Disturb mode

When the meeting ends, the switch turns off, the light goes off, and Tasker returns my phone to normal notification mode.

The key benefit here is reliability. Everything is driven directly from the calendar feed, evaluated using the hub’s timezone, with no manual toggles, no duplicated logic in Rule Machine, and no need to remember to silence or unsilence devices. Once it is set up, it simply follows the calendar.

This same pattern can be adapted for presence indicators, modes, notification suppression, or any automation that needs a dependable “busy” signal tied to real calendar events.

2 Likes

FYI it's HE ICal switch by Chris Truitt in HPM. Searching for Ical Calendar Switch comes up blank. I ended up searching for truittchris and that brought it up.

Not sure if I can use it but it sounds interesting. I have a few rules that I may be able to incorporate using this to make them better. Thanks for sharing.

Same here. Thanks for putting this together! Will try it out!

EDIT: FYI I found this in HPM under the "Integrations" tag

How involved would it be to expand to private or authenticated calendar feeds, so that it wouldn't be required to expose a calendar publicly? If it's involved, I suppose I could just expose my busy/not busy status. That would lose the ability to leverage keyword filtering, but I do not want to expose meeting details publicly.

If you're talking about Interactive logins and OAuth (Microsoft 365 / Google style), the answer is unfortunately no. If the ICS feed requires OAuth2 with redirects, cookies, CSRF, or an interactive web login, a Hubitat driver generally cannot complete that flow by itself as far as I've been able to find.

Right, it would have to be an app i think. Or have an app component, with this as the child device.

Well...the only solutions I've been able to come up with involve registering an app in Azure for Microsoft Graph or setting up a Google calendar API to essentially give you access to your calendar on either of those services. You'd have to set up a Raspberry Pi to be the "bridge" between those services and Hubitat. The Pi would need a stable LAN IP address (DHCP reservation is fine). It'd also need internet connectivity to access microsoft graph endpoints and/or google calendar api endpoints. What's your level of comfort/knowledge?

I believe this could be done directly by the hub, with a companion app that does the authentication.

See App OAuth | Hubitat Documentation

I’m familiar and comfortable with assistance on this. But have some other coding projects at the moment so involvement would be advisory if you’re interested.

But as I looked into this, im equally intrigued with a broader Microsoft integration to capture Microsoft Teams meeting status. There’s an API for that too.

This is correct that an App would manage the Oauth components and feed to a child device. My GCal Search app is an example on how this could work where app queries the Google APIs and feeds the data to the child switch.