I wrote a script to load ical events: ical4openhab


I like the idea of controling my home via calendar events. The gcal binding did not work well and I did not like the fact that it needs full API access to all my calendars. That’s why I wrote a little script that returns the date, time and title of the events that starts or ends next in a given ical file. If it starts or ends now, it shows "NOW! " plus the title. If this script is executed every minute with the exec binding, rules can trigger when an event starts or ends. It works with all ical files, not only Google Calendar.



I cloned the repo to my OpenHAB machine and put my iCAL link in the ical.php file.

When I run php ical.php DTSTART or DTEND I get the following error:

PHP Fatal error:  Cannot redeclare debug() (previously declared in /home/cary/ical4openhab/ical.php:228) in /home/cary/ical4openhab/ical.php on line 452

I have zero PHP experience, any help?

Hm, for some reason, you already have a debug function. I would recommend to rename the debug function in the ical.php:

function debug

Maybe call it my_debug and replace all calls debug( --> my_debug(