Giter VIP home page Giter VIP logo

homebridge-calendar's Introduction

homebridge-calendar

A calendar plugin for homebridge, which allows flexible scheduling of triggers using any iCal calendar.

HomeKits own scheduling means are limited and in some instances not flexible enough for more advanced scheduling needs. This plugin integrates any iCal calendar (iCloud, Google Calendar, ...) into HomeKit and creates stateless switches for the events in the calendar using the scheduled event summary.

Status

HitCount Build Status codecov.io Dependency Status devDependency Status Node version NPM Version

Supported calendars

  • iCloud Calendar
  • Google Calendar

In theory any calendar solution that supports iCal (RFC 5545) and sharing should work, however some vendors choose to deviate from the RFC in their implementation. If you use one that works, but isn't on the list - great please add it to this README.md.

Installation

After Homebridge has been installed:

sudo npm install -g homebridge-calendar --unsafe-perm

Configuration

{
  "bridge": {
      ...
  },
  "platforms": [
    {
      "platform": "Calendar",
      "calendars": [
        {
          "name": "Cal 1",
          "url": "webcal://",
          "pollingInterval": 5,
          "offset": "-8h",
          "sensors": [
            "Sensor 1",
            "Sensor 2"
          ]
        }
      ]
    }
  ]
}
Attributes Usage
name A unique name for the calendar. Will be used as the accessory name and default switch for any calendar events.
url The address of the calender. Can be a webcal://, a http:// or an https:// URL.
pollingInterval The polling interval the plugin uses to retrieve calendar updates in minutes. If not set, the plugin will update the calendar ones in 15 minutes.
sensors An array of event summaries to create special sensors for.

The above example creates the plugin with three contact sensors:

  • Cal 1
  • Sensor 1
  • Sensor 2

Cal 1 will be opened any time any event starts in the calendar. Sensor 1 and Sensor 2 will only open if the event name starts with Sensor 1 or Sensor 2 respectively.

Calendar events may overlap, may be full day, recurring or single occurance events and can even span multiple days.

Offset

You might want to trigger the sensors earlier than the scheduled event. This can be done by applying an offset to the calendar. An offset specifies the time to subtract from the scheduled start of the event. The offset essentially moves the start date ahead by the specified amount of time. The end date of the events is unaffected. Essentially this extends the event duration by the offset.

Offset syntax

An offset is a combination of a number and a postfix that indicates the unit of time to move. The supported offset postfixes are the following:

Postfix Example Description
d 2d Make an event start earlier by two days.
h 8h Make an event start earlier by eight hours.
m 15m Make an event start earlier by fifteen minutes.
s 10s Make an event start earlier by ten seconds.

An offset is always negative, e.g. it moves the start to an earlier time. You can specify the minus in front of the offset. Positive offsets (with a plus symbol in front) to move to a later time are not supported.

Sharing an iCloud calender

To give the plugin access to a calender it is advised to create a seperate (iCloud) calender and share it publically. Public sharing provides a read-only view on the calender and a URL that can be used by the plugin to access the calender. No one else can modify a publically shared calender in this way.

Here's good instructions on how to do this. Refer to the public sharing section there.

Contributing

You can contribute to this homebridge plugin in following ways:

  • Report issues and help verify fixes as they are checked in.
  • Review the source code changes.
  • Contribute bug fixes.
  • Contribute changes to extend the capabilities

Pull requests are accepted.

Some asks for friendly gestures

If you use this and like it - please leave a note by staring this package here or on GitHub.

If you use it and have a problem, file an issue at GitHub - I'll try to help.

If you tried this, but don't like it: tell me about it in an issue too. I'll try my best to address these in my spare time.

If you fork this, go ahead - I'll accept pull requests for enhancements.

License

MIT License

Copyright (c) 2018 Michael Fröhlich

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

homebridge-calendar's People

Contributors

grover avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-calendar's Issues

Sensors

Is there’s possibility that instead of sensors also switches are usable. For som scenes and programs it’s for my opinion mor practicable fr the logic to use a switch instead a sensor.

Notifications and automations not working

Does anyone else have the issue that whilst the sensor is working and appears in HomeKit, notifications (when turned on) and automations based on state changes do not trigger? Just wondering if this is down to the plugin or perhaps down to something in my HomeKit setup.

plugin stops working if polling calendar returns an error

It seems the plugin stops working if polling the calendar returns an error. For instance mine is setup to poll every 15 minutes. It works like clockwork, but the moment it fails it doesn't try anymore. Only way to get it unstuck seems to be restarting homebridge:

[20/09/2023, 06:09:30] [homebridge-calendar] Pushing calendar sensor 'LCPS' state 1 - value 1
[20/09/2023, 06:09:31] [homebridge-calendar] Updating calendar Contractors
[20/09/2023, 06:09:32] [homebridge-calendar] Pushing calendar sensor 'Contractors' state 0 - value 0
[20/09/2023, 06:24:30] [homebridge-calendar] Updating calendar LCPS
[20/09/2023, 06:24:31] [homebridge-calendar] Setting LCPS to true
[20/09/2023, 06:24:31] [homebridge-calendar] Pushing calendar sensor 'LCPS' state 1 - value 1
[20/09/2023, 06:24:32] [homebridge-calendar] Updating calendar Contractors
[20/09/2023, 06:24:32] [homebridge-calendar] Pushing calendar sensor 'Contractors' state 0 - value 0
[20/09/2023, 06:39:31] [homebridge-calendar] Updating calendar LCPS
[20/09/2023, 06:39:31] [homebridge-calendar] Setting LCPS to true
[20/09/2023, 06:39:31] [homebridge-calendar] Pushing calendar sensor 'LCPS' state 1 - value 1
[20/09/2023, 06:39:32] [homebridge-calendar] Updating calendar Contractors
[20/09/2023, 06:39:32] [homebridge-calendar] Pushing calendar sensor 'Contractors' state 0 - value 0
[20/09/2023, 06:54:31] [homebridge-calendar] Updating calendar LCPS
[20/09/2023, 06:54:32] [homebridge-calendar] Setting LCPS to true
[20/09/2023, 06:54:32] [homebridge-calendar] Pushing calendar sensor 'LCPS' state 1 - value 1
[20/09/2023, 06:54:32] [homebridge-calendar] Updating calendar Contractors
[20/09/2023, 06:54:33] [homebridge-calendar] Pushing calendar sensor 'Contractors' state 0 - value 0
[20/09/2023, 07:09:32] [homebridge-calendar] Updating calendar LCPS
[20/09/2023, 07:09:33] [homebridge-calendar] Updating calendar Contractors
[20/09/2023, 07:09:42] [homebridge-calendar] Failed to load iCal calender: undefined with error Error: getaddrinfo ENOTFOUND p33-caldav.icloud.com
[20/09/2023, 07:09:42] [homebridge-calendar] Polling calendar LCPS has raised error: Error: getaddrinfo ENOTFOUND p33-caldav.icloud.com
[20/09/2023, 07:09:43] [homebridge-calendar] Failed to load iCal calender: undefined with error Error: getaddrinfo ENOTFOUND p106-caldav.icloud.com
[20/09/2023, 07:09:43] [homebridge-calendar] Polling calendar Contractors has raised error: Error: getaddrinfo ENOTFOUND p106-caldav.icloud.com

And then nothing (that was 2 hours ago)

Plugin error on startup - kills Homebridge

Hi - I just installed this plug-in and I am getting this error in the HB logs:

[6/8/2021, 10:48:34 AM] at new ParserError (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1641:13) at Function.ICAL.parse.parser._handleContentLine (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1829:13) at /usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1671:14 at Function.ICAL.parse.parser._eachLine (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:2130:11) at Object.parser [as parse] (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1670:12) at new IcalExpander (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:15:26) at CalendarPoller._refreshCalendar (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:69:26) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:54:14) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12)

Install Info is:
OS | macOS Catalina Node.js | v14.15.5 npm | v7.5.4

Plug-in config:
{ "platform": "Calendar", "calendars": [ { "name": "Cal 1", "url": "**url copied from Google calendar sharing link**", "pollingInterval": 5, "offset": "-8h", "sensors": [ "Sensor 1", "Sensor 2" ] } ] }

Any help would be appreciated. Thanks!

Homebridge crashes on startup trying to get events from iCal

The log looks like this;

pi@raspberrypi:~ $ homebridge
[12/13/2019, 17:47:26] Loaded config.json with 0 accessories and 1 platforms.
[12/13/2019, 17:47:26] ---
[12/13/2019, 17:47:26] Loaded plugin: homebridge-calendar
[12/13/2019, 17:47:26] Registering platform 'homebridge-calendar.Calendar'
[12/13/2019, 17:47:26] ---
[12/13/2019, 17:47:26] Loading 1 platforms...
[12/13/2019, 17:47:26] [Calendar] Initializing Calendar platform...
[12/13/2019, 17:47:26] [Calendar] CalendarPlatform Plugin Loaded - version 0.4.0
[12/13/2019, 17:47:26] [Calendar] Found calendar in config: "House Calendar"
[12/13/2019, 17:47:26] [Calendar] Pushing calendar sensor 'House Calendar' state 0 - value 0
[12/13/2019, 17:47:26] [Calendar] Pushing calendar sensor 'Heat' state 0 - value 0
[12/13/2019, 17:47:26] [Calendar] Polling calendar House Calendar has started.
[12/13/2019, 17:47:26] [Calendar] Updating calendar House Calendar
[12/13/2019, 17:47:26] [Calendar] Initializing platform accessory 'House Calendar'...
Load homebridge-calendar.Calendar
[12/13/2019, 17:47:26] [homebridge-calendar.Calendar] CalendarPlatform Plugin Loaded - version 0.4.0
Setup Payload:
X-HM://0023ISYWYE733
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ 031-45-154 │     
└────────────┘     

[12/13/2019, 17:47:26] Homebridge is running on port 51826.
[12/13/2019, 17:47:26] TypeError: Cannot read property 'length' of undefined
at Component.getAllSubcomponents (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:2304:48)
at new IcalExpander (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:17:34)
at CalendarPoller._refreshCalendar (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:69:26)
at IncomingMessage. (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:54:14)
at IncomingMessage.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1184:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
[12/13/2019, 17:47:26] Got SIGTERM, shutting down Homebridge...

The config looks like this;

{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "Z-Wave Controller",
"platforms": [
{
"platform": "Calendar",
"calendars": [
{
"name": "House Calendar",
"url": "webcal://",
"pollingInterval": 5,
"sensors": [
"Heat"
]
}]
}]
}

I am using this calendar with Indigo and Cynical Calendars plugin - it usually works - but I am trying to move everything to Homebridge and HomeKit on RPi

Can you include Telegram

Hello Grover,

Is it possible to include Telegram API?

Like if Trigger send a Telegram message to ChatID.
I need it about my Lametric Time. :-) There is no Homebridge-Plugin for it ;-(

If Calender ist Triggert then send me a Telegram message.
IFTTT reads my Telegram Channel and my applet read it and will send a Push notification to my Lametric Time.

P.s. I can´t send it as a Pull request.

Und gerne auch in Deutsch weiter. =)

Keeps getting Parse Error with multiply .ics files

Keeps getting this error. Anyone know a fix or can we please fix it?

6/13/2022, 9:44:44 PM] at new ParserError (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1641:13)
at Function.ICAL.parse.parser._handleContentLine (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1829:13)
at /usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1671:14
at Function.ICAL.parse.parser._eachLine (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:2145:7)
at Object.parser [as parse] (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1670:12)
at new IcalExpander (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:15:26)
at CalendarPoller._refreshCalendar (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:69:26)
at IncomingMessage. (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:54:14)
at IncomingMessage.emit (node:events:532:35)
at endReadableNT (node:internal/streams/readable:1346:12)

Crashes when ics file unavailable

Hello,

I’m encountering a little problem with this module : When the ics file gets unavailable because of a maintenance for example, this module crashes and homebridge too.

IMG_0357

Can you find a way to fix this problem ?

Thank you in advance 😊

Cannot read property 'length' of undefined

Hi,

just updated to the neweset Homebridge Version. Now i get this error every night and my HB crashes:
[01/10/2020, 01:22:29] TypeError: Cannot read property 'length' of undefined at Component.getAllSubcomponents (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:2304:48) at new IcalExpander (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:17:34) at CalendarPoller._refreshCalendar (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:69:26) at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:54:14) at IncomingMessage.emit (events.js:327:22) at endReadableNT (_stream_readable.js:1201:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) [01/10/2020, 01:22:29] Got SIGTERM, shutting down Homebridge... [01/10/2020, 01:22:34] [Deconz] goodbye

UnhandledPromiseRejectionWarning

Every once in a while, I see the following warning in the Log. Is that something that can be fixed in homebridge-calendar?

[27.11.2020, 06:37:53] [Calendar] Polling calendar XXX has raised error: Error: getaddrinfo EAI_AGAIN p51-caldav.icloud.com
(node:559) UnhandledPromiseRejectionWarning: Error: send ENETUNREACH 224.0.1.187:5683
    at doSend (dgram.js:692:16)
    at defaultTriggerAsyncIdScope (internal/async_hooks.js:429:12)
    at afterDns (dgram.js:638:5)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:559) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:559) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

This error crashes the plugin and homebridge must be restarted.

Thanks for looking into it!

Offset for end date

Hi,
Thank you for your work.
For some of my routines, I need my sensors to be closed before the end date comes just like it is for the start date.
So, is it possible for you to create an offset also for the end date ?
Thank you in advance !

Hombridge permanently restarts when calendar source is not reachable

I use nexctcloud calendar on same LAN as source and I didn't recognized at first, that it was down. But my homebridge permanatly restarts with following log. Please fix that.

at new ParserError (/usr/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1641:13)
at Function.ICAL.parse.parser._handleContentLine (/usr/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1829:13)
at /usr/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1671:14
at Function.ICAL.parse.parser._eachLine (/usr/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:2130:11)
at Object.parser [as parse] (/usr/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1670:12)
at new IcalExpander (/usr/lib/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:15:26)
at CalendarPoller._refreshCalendar (/usr/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:69:26)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:54:14)
at IncomingMessage.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1334:12)

After I fixed the nexcloud it worked again, of course.

Is this plug-in working?

Hi. Installed the plug-in, but nothing is showing up in Apple Home. Then I saw some related plugins that seemed to indicate that this plug-in is not working. So wondering whether this plug-in is working or not. Thanks!

Newb setup question

I just installed HomeBridge in order to use this package.
I'm not really understanding how to fire off events with this plugin.
What I'd like to ideally do, is to enable a scene on a specific calendar day and then disable it on another specific day and repeat those days every year.
If I can't do this I'd just like to set a scene for a specific span of days for certain hours that also repeat every year.

Can I accomplish either of those with this plugin?

Error and crash from reading Google calendar

The homebridge instance crashes with the following error log when I start it with my Google Calendar url. I sent you an email with all the rest of the details.

May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [Calendar] Initializing Calendar platform...
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [Calendar] CalendarPlatform Plugin Loaded - version 0.3.
6
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [Calendar] Found calendar in config: "Kalender"
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [Calendar] Pushing calendar sensor 'Kalender' state 0 -
value 0
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [Calendar] Pushing calendar sensor 'Ferie' state 0 - val
ue 0
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [Calendar] Pushing calendar sensor 'Tur' state 0 - value
0
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [Calendar] Polling calendar Kalender has started.
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [Calendar] Updating calendar Kalender
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [Calendar] Initializing platform accessory 'Kalender'...
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] Loading 0 accessories...
May 24 01:13:10 LillePi homebridge[643]: Load homebridge-calendar.Calendar
May 24 01:13:10 LillePi homebridge[643]: [2018-5-24 01:13:10] [homebridge-calendar.Calendar] CalendarPlatform Plugin L
oaded - version 0.3.6
May 24 01:13:14 LillePi homebridge[643]: /var/lib/homebridge-ext/node_modules/homebridge-calendar/src/CalendarActionBu
ilder.js:98
May 24 01:13:14 LillePi homebridge[643]: return events.sort((a, b) => a.date.valueOf() - b.date.valueOf());
May 24 01:13:14 LillePi homebridge[643]: ^
May 24 01:13:14 LillePi homebridge[643]: TypeError: Cannot read property 'valueOf' of undefined
May 24 01:13:14 LillePi homebridge[643]: at events.sort (/var/lib/homebridge-ext/node_modules/homebridge-calendar/
src/CalendarActionBuilder.js:98:60)
May 24 01:13:14 LillePi homebridge[643]: at InternalArray.sort (native)
May 24 01:13:14 LillePi homebridge[643]: at Array.sort (native)
May 24 01:13:14 LillePi homebridge[643]: at CalendarActionBuilder.sortEventsByDate (/var/lib/homebridge-ext/node
modules/homebridge-calendar/src/CalendarActionBuilder.js:98:19)
May 24 01:13:14 LillePi homebridge[643]: at CalendarActionBuilder.generateActions (/var/lib/homebridge-ext/node_mo
dules/homebridge-calendar/src/CalendarActionBuilder.js:28:22)
May 24 01:13:14 LillePi homebridge[643]: at CalendarAccessory._onCalendar (/var/lib/homebridge-ext/node_modules/ho
mebridge-calendar/src/CalendarAccessory.js:136:41)
May 24 01:13:14 LillePi homebridge[643]: at CalendarPoller.emit (events.js:180:13)
May 24 01:13:14 LillePi homebridge[643]: at ical.fromURL (/var/lib/homebridge-ext/node_modules/homebridge-calendar
/src/CalendarPoller.js:48:14)
May 24 01:13:14 LillePi homebridge[643]: at Request._callback (/var/lib/homebridge-ext/node_modules/node-ical/node
-ical.js:11:5)
May 24 01:13:14 LillePi homebridge[643]: at Request.self.callback (/var/lib/homebridge-ext/node_modules/node-ical/
node_modules/request/request.js:187:22)
May 24 01:13:14 LillePi systemd[1]: homebridge-ext.service: Main process exited, code=exited, status=1/FAILURE

May 24 01:13:14 LillePi systemd[1]: homebridge-ext.service: Unit entered failed state.
May 24 01:13:14 LillePi systemd[1]: homebridge-ext.service: Failed with result 'exit-code'.

Setting for „Contains“ instead of „Starts with“

Hi there,

I want to use it as reminder for garbage pick-up. Unfortunately on days with different garbage bins there is only one calendar item for both. So it would be great if I there was a setting for using name „contains“ instead of „Starts with“.

Plugin crashes homebridge (three users of are affected)

Hello @grover ,

since 2 days my homebridge (v.1.3.4, node 14.17.0) crashes when loading this plugin (v 0.4.0).

We are 3 users from smartapfel.de, look at
https://forum.smartapfel.de/forum/thread/1037-homebridge-calendar-kalender-trigger/?action=firstNew

Here my log from starting homebridge:

May 26 12:34:29 raspberrypi homebridge[32319]: Starting to advertise 'Homebridge-cal B6ED' using ciao backend!
May 26 12:34:29 raspberrypi homebridge[32319]: [26/05/2021, 12:34:29] Homebridge v1.3.4 (Homebridge-cal) is running on port 51873.
May 26 12:34:30 raspberrypi homebridge[32319]: [26/05/2021, 12:34:30] at new ParserError (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1702:13)
May 26 12:34:30 raspberrypi homebridge[32319]: at Function.ICAL.parse.parser._handleContentLine (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1890:13)
May 26 12:34:30 raspberrypi homebridge[32319]: at /usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1732:14
May 26 12:34:30 raspberrypi homebridge[32319]: at Function.ICAL.parse.parser._eachLine (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:2191:11)
May 26 12:34:30 raspberrypi homebridge[32319]: at Object.parser [as parse] (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical.js/build/ical.js:1731:12)
May 26 12:34:30 raspberrypi homebridge[32319]: at new IcalExpander (/usr/local/lib/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:15:26)
May 26 12:34:30 raspberrypi homebridge[32319]: at CalendarPoller._refreshCalendar (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:69:26)
May 26 12:34:30 raspberrypi homebridge[32319]: at IncomingMessage. (/usr/local/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:54:14)
May 26 12:34:30 raspberrypi homebridge[32319]: at IncomingMessage.emit (events.js:388:22)
May 26 12:34:30 raspberrypi homebridge[32319]: at endReadableNT (internal/streams/readable.js:1336:12)
May 26 12:34:30 raspberrypi homebridge[32319]: [26/05/2021, 12:34:30] Got SIGTERM, shutting down Homebridge...
May 26 12:34:35 raspberrypi systemd[1]: homebridge-cal.service: Main process exited, code=exited, status=143/n/a
May 26 12:34:35 raspberrypi systemd[1]: homebridge-cal.service: Failed with result 'exit-code'.
^C

I hope you could help.

Greetz Kohle

Better logging?

Good stuff, a simple plugin that does what it says.
The logging contains state and value; State is clear but I have no idea what value means.
It would be clearer if logging contained state and next event in hours or minutes.

And it would be good if one could switch off logging with a "debug" true/false JSON entry like so many other plugins. Once it works, logging is no longer necessary.

iCloud public calendar - repeat daily not working

Hi
great and useful addition to the HomeKit thank you.

However if I create a daily repeat item; then the sensor is NOT triggered.
If I create a single (none-repeating) sensor then that works perfectly.

If I then EDIT the calendar entry to make it repeat daily; it stops working.

By working I mean that the HomeKit sets the sensor Open for the correct duration.
By not working I mean that the sensor remains Closed.

Setting Notification(s) on/off and/or Busy/Free flags makes no differance

iOS 11.3
Calendar Name : Siri
Sensors set up as
Siri
Siri2
Siri3
Siri4
18C
19C
20C

The idea I had was to use the Calendar to enforce heating control; whilst allowing some ability to override by manual intervention in Hive or from HomeKit. Obviously I don't want to make an entry for every day of the year .. Siri...Siri4 for general odds and ends

Comment : The iOS Calendar uses a 5 minute clock; - so to ensure that a 5 minute wide calendar entry (the smallest possible) is detected the homebridge-calendar poll must be set to 4 minutes (unfortunately the timer starts on completion of the check; which can take 4 or 5 seconds; so a 5 minute poll will 'miss' a 5 minute appointment from time to time)

Add an EndOffset

Hi,

i am using the offset to trigger the event earliert.
Can you add an option that this will effect also the end of the event?
(I have daily events and use the plugin to notify me the day before. When the event ends at midnight i causes problems in my automations)

greetz
boehser enkel

Invert the sensor state when calendar invent starts

Is there any way to invert the way the sensor is displayed in the Home app? Currently, if there's a calendar event happening at a specific time (no offset configured), the sensor state will appear as "opened". I'd like it to be "closed", as in the office is closed because a meeting is starting.
Thanks

Crash on iCloud Calendar

Using 0.4.0 on Node 11.9.0 (the latest version supported on ARMv6) I get a crash when trying to load a calendar from iCloud. If I revert to 0.3.6 it works fine. I've downloaded and attached the ics file.

TypeError: Cannot read property 'toJSDate' of null
    at getTimes (/opt/node/lib/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:40:53)
    at events.filter.forEach (/opt/node/lib/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:110:38)
    at Array.forEach (<anonymous>)
    at IcalExpander.between (/opt/node/lib/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:63:57)
    at CalendarPoller._refreshCalendar (/opt/node/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:78:30)
    at IncomingMessage.resp.on (/opt/node/lib/node_modules/homebridge-calendar/src/CalendarPoller.js:54:14)
    at IncomingMessage.emit (events.js:202:15)
    at endReadableNT (_stream_readable.js:1129:12)
    at processTicksAndRejections (internal/process/next_tick.js:76:17)

Doubling calendar error

Hi grover,

I'm really liking this plugin, it's really helping out.

I was trying to have the same trigger twice, once with a 0 offset and once with a -15 minute offset but as soon as I duplicate the calendar I get the following error:

[5/1/2019, 11:45:58 PM] TypeError: Cannot read property 'property' of undefined
	at Function.ICAL.parse.parser._handleContentLine (/homebridge/node_modules/ical.js/build/ical.js:1900:33)
	at /homebridge/node_modules/ical.js/build/ical.js:1732:14
	at Function.ICAL.parse.parser._eachLine (/homebridge/node_modules/ical.js/build/ical.js:2191:11)
	at Object.parser [as parse] (/homebridge/node_modules/ical.js/build/ical.js:1731:12)
	at new IcalExpander (/homebridge/node_modules/ical-expander/index.js:15:26)
	at CalendarPoller._refreshCalendar (/homebridge/node_modules/homebridge-calendar/src/CalendarPoller.js:69:26)
	at IncomingMessage.resp.on (/homebridge/node_modules/homebridge-calendar/src/CalendarPoller.js:54:14)
	at IncomingMessage.emit (events.js:194:15)
	at endReadableNT (_stream_readable.js:1125:12)
	at process._tickCallback (internal/process/next_tick.js:63:19)
[5/1/2019, 11:45:58 PM] Got SIGTERM, shutting down Homebridge...

I tried duping the calendar within the platform and duping the platform in the config and I get the same error.

Any ideas?

Thanks,
Edward

Works like a charm

No issue, just wanted to post some appreciation for this plugin. I use it to automate some actions on school days, it works perfectly.
Thank you!

Support for full-day events?

Hi,
I'm trying to setup some automation based on holiday calendar which contains only full day events (to mark the public holidays). When I start HomeBridge I got the error message. I suspect it is because the plugin doesn't support full day event?
[2/21/2021, 8:47:10 PM] TypeError: Cannot read property 'toJSDate' of null
at getTimes (/homebridge/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:40:53)
at /homebridge/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:110:38
at Array.forEach ()
at IcalExpander.between (/homebridge/node_modules/homebridge-calendar/node_modules/ical-expander/index.js:63:57)
at CalendarPoller._refreshCalendar (/homebridge/node_modules/homebridge-calendar/src/CalendarPoller.js:78:30)
at IncomingMessage. (/homebridge/node_modules/homebridge-calendar/src/CalendarPoller.js:54:14)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

iCloud public calendar regular events are not working

Steps to reproduce:

  1. Create the public iCloud calendar
  2. Add configuration to home bridge:
{
      "platform": "Calendar",
      "calendars": [
        {
          "name": "Cal 1",
          "url": "webcal://<some real url>",
          "pollingInterval": 1,
          "sensors": [
            "Sensor 1",
            "Sensor 2"
          ]
        }
      ]
}

  1. Schedule 2-minute long event in the calendar with the name "Sensor 1"

Expected result:
Sensor 1 should be active when Event "Sensor 1" started.

Actual result:
It's silent

Note If one makes the event all day long then Sensor 1 will work as expected

Deviation from recurring event not handled

I have a calendar with a recurring event at 7AM, let's call it "WakeUp". This works fine and triggers the rule every morning at 7AM. However, when I delete the event for a single day letting it continue after that, the sensor will still trigger at 7AM that day. I guess the sensor will always fire based on the original rule of the recurring event and not based on changes done to single instances of the event done later.
Polling interval is 15 min, homebridge restart every night.

Anfrage vom Kalender funktioniert nicht

Hallo Michael, wir haben den Fehler mit vollen Log gefunden. Das Problem sind wiederkehrende Ereignisse. Wenn ich zb meinen Geburtstagkalender mit Einträgen wie Geburtstage X und der nächste Termin ist dann Geburtstag y fülle, dann bekommt das Plugin Schwierigkeiten und haut den Log voll. Kann man das eventuell ändern? Schön wäre auch wenn man die Abfrage verlängern könnte da zeitweise das Plugin den Schalter nicht schaltet. Es wird dann erst wieder beim nächsten Abfrageintervall geschaltet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.