Possible to use ical4j?


I'm trying to use ical4j to try to integrate calendaring capabilities with my Hubitat. However, whenever I try to import the package, :

import net.fortuna.ical4j.model.property.*
import net.fortuna.ical4j.model.*
import net.fortuna.ical4j.model.component.*

I get "unable to resolve class ContentBuilder", when I try to use such class. Any thoughts?

Note: I'm just scratching the surface with Groovy. Apologies for my lack of knowledge in this area.

Thank you

Two issues: first, this library isn't part of the standard Java or Groovy environment, so you'd need a way to make it available. But second, and more importantly, Hubitat has an allowlist of classes allowed to be imported in the "sandbox" that user apps and drivers run in, there would be no way to get this--or anything not otherwise allowed--into that in there in the first place, at least not without staff doing it (unlikely for third-party libraries they or the system doesn't have a use for, but they have been known to listen to reasonable requests).

What you can do in the meantime: in the event that you're able to re-implement the pieces of this library that you need in "plain" Groovy and Hubitat's allowed classes (and the extras provided by the app and driver environment), you could re-implement what you need. Probably hard, maybe impossible, but I don't know details if the iCalendar specs. You could also run this on an external system via whatever means you want--making it act as a "middleman"--then find some way to integrate it into Hubitat, like MakerAPI or a custom app/driver. You may also wish to see if someone else has already done something similar before, either here or in the similar "classic"/Groovy SmartThings environment, with which Hubitat's is largely compatible.


There are several calendar integrations available in this community, just not using ical4j.


Thank you @bertabcd1234 and @ritchierich for your insight and very prompt response.

I don't really need all the functionality that ical4j offers, so one of these calendar integrations should do it.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.

Download the Hubitat app