dirkhe / ioBroker.webcal

fetch events from WEBDAV, CALDAV, CARDDAV Calendar or Google Calendar for ioBroker
MIT License
1 stars 3 forks source link
caldav-client calendar google-calendar iobroker smarthome webdav-client

Logo

ioBroker.webcal

NPM version Downloads Number of Installations Current version in stable repository

NPM

Tests: Test and Release

webcal adapter for ioBroker

with this ioBroker adapter you can

Calendar Accounts

Nextcloud
use basic auth and following Url (you can get it by shared link)

https://<domain>/<optional basePath>/remote.php/dav/calendars/<username>/<optional displaName>

Google
see using Google API

Download iCal you can download an ical calendar for calendar, which not support dav. But this is than readonly, means no Calendar items could be added

Datapoints

add new Event

you can add a new Calender Entry based on the Event. Please use the following Syntax:

relDays[@calendar] | date|datetime[ - date|datetime][@calendar]

relDays - number of days from today
or date/datetime as parsable date or datetime
@calendar is optional the name of the calendar, default is first defined calendar

also possible via Script:

sendTo("webcal.0", "addEvents", {
    calendar: "smarthome",
    events: [
      {
        summary: "test",
        start: "9.8.23 23:00",
        end: "10.08.2023 14:00"
      },      
      {
        summary: "failed test",
        description: "long description",
        start: "9.8"
      }
    ]
  },function(events){
    /* callback function 
       object events will be repeat from input, 
       with additional status or error field, 
       also startDate and endDate are provided as Object data   
    */
    log(events);    
  })

output from log will be:

[
  {
    "summary": "test",
    "start": "9.8.23 23:00",
    "end": "10.08.2023 14:00",
    "startDate": {
      "year": 2023,
      "month": 8,
      "day": 9,
      "hour": 23,
      "minute": 0,
      "second": 0,
      "isDate": false
    },
    "endDate": {
      "year": 2023,
      "month": 8,
      "day": 10,
      "hour": 14,
      "minute": 0,
      "second": 0,
      "isDate": false
    },
    "status": "successfully added"
  },
  {
    "summary": "failed test",
    "description": "long description",
    "start": "9.8",
    "startDate": {
      "year": 0,
      "month": 1,
      "day": 2,
      "hour": 0,
      "minute": 0,
      "second": 0,
      "isDate": false
    },
    "error": "start: invalid date"
  }
]

if calendar not given, defaultCalender will used

on event field end and description is optional

delete Event possible via Script:

sendTo("webcal.0", "deleteEvents", {
    calendar: "smarthome",
    events: [
      {
        id: "e3fcbf3b-651c-470f-b307-9d20be5902eb"
      },      
      {
        id: "failed test"
      }
    ]
  },function(events){
    /* callback function 
       object events will be repeat from input, 
       with additional status or error field,   
    */
    log(events);    
  })

output from log will be:

[
  {
    "id": "e3fcbf3b-651c-470f-b307-9d20be5902eb
    "status": "successfully deleted"
  },
  {
    "id": "failed test",
    "error": "not found"
  }
]

Visualization

if you want to use iobroker vis-material-design, you can use this script

known errors

breaking (exception) a serie of events will be ignored

DISCLAIMER

This project uses the following components:

Changelog

1.3.8 (2024-07-02)

1.3.7 (2024-05-20)

1.3.6 (2024-05-18)

1.3.5 (2024-05-05)

1.3.3 (2024-04-07)

1.3.2 (2024-02-23)

1.3.0 (2023-10-31)

1.2.0 (2023-08-15)

1.1.0 (2023-08-09)

1.0.7 (2023-08-06)

1.0.6 (2023-08-06)

1.0.5 (2023-04-26)

1.0.4 (2023-04-08)

1.0.2 (2023-04-07)

1.0.0 (2023-04-07)

0.4.0 (2023-03-05)

0.3.0 (2023-02-22)

0.2.0 (2023-02-21)

0.1.0 (2023-02-16)

License

MIT License

Copyright (c) 2024 dirkhe

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.