CALDAV-Binding für Müllkalender

Einrichtung der openHAB Umgebung und allgemeine Konfigurationsthemen.

Moderatoren: seppy, udo1toni

Hoggle
Beiträge: 213
Registriert: 16. Dez 2017 10:49

CALDAV-Binding für Müllkalender

Beitrag von Hoggle »

Hallo.
Ich versuche mich mal wieder mit dem anlegen eines Müllkalenders, aber es kommen Fehler, die ich nicht verstehe.

Code: Alles auswählen

2019-08-19 10:07:01.628 [WARN ] [.io.caldav.internal.CalDavLoaderImpl] - Unable to parse configuration parameter: charset

2019-08-19 10:07:01.632 [ERROR] [org.apache.felix.configadmin        ] - [org.osgi.service.cm.ManagedService, org.openhab.io.caldav.CalDavLoader, id=329, bundle=235/mvn:org.openhab.io/org.openhab.io.caldav/1.13.0]: Updating property CalDAV IO of configuration org.openhab.caldavio caused a problem: Unable to parse configuration parameter: charset

org.osgi.service.cm.ConfigurationException: CalDAV IO : Unable to parse configuration parameter: charset

	at org.openhab.io.caldav.internal.CalDavLoaderImpl.updated(CalDavLoaderImpl.java:183) ~[?:?]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker$1.run(ManagedServiceTracker.java:177) ~[9:org.apache.felix.configadmin:1.9.4]

	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:173) ~[9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1389) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.UpdateThread$1.run(UpdateThread.java:126) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.UpdateThread$1.run(UpdateThread.java:123) [9:org.apache.felix.configadmin:1.9.4]

	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]

	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:122) [9:org.apache.felix.configadmin:1.9.4]

	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [9:org.apache.felix.configadmin:1.9.4]

	at java.lang.Thread.run(Thread.java:748) [?:?]
in der caldavio.cfg steht:

Code: Alles auswählen

# Charset which should be used for reading an event.
caldavio:Muellkalender:charset=UTF-8
caldavio:Muellkalender:url=https://calendar.google.com/calendar/ical/abcdefg567812344556%40group.calendar.google.com/public/basic.ics
caldavio:Muellkalender:username=holger
caldavio:Muellkalender:password=123456567822
caldavio:Muellkalender:reloadInterval=1
caldavio:Muellkalender:preloadTime=200000
caldavio:Muellkalender:disableCertificateVerification=true
und als items:

Code: Alles auswählen

//Müllkalender
String CalDav_Muelltonne   "Tonne [%s]"  <calendar> { caldavPersonal="calendar:Muellkalender type:EVENT eventNr:1 value:NAME" }
DateTime    CalDav_Date "Datum der Abholung [%1$td.%1$tm.%1$tY]"    <calendar>    { caldavPersonal="calendar:Muellkalender type:EVENT eventNr:1 value:START" }
Den Googlekalender habe ich "Muellkalender" genannt.

Kann mir da jemand weiterhelfen?
Google Kalender - November 2019.jpg
Im Kalender sind die Abfuhrtermine hinterlegt.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
RPI4/8GB RAM mit openhabian (bullseye) - Kernel Linux 6.1.21-v8+ - openhab 4.0.2 - Release Build - HM-CCU3 - ZWave UZB-USB Stick - Wifi-LED-Stripes - Logitech Harmony Hub - AVM Fritzbox - Enigma2-Box - Gardena HUB - Fronius-Binding - Miele@Home

eiGelbGeek
Beiträge: 226
Registriert: 11. Aug 2019 06:39
Answers: 4

Re: CALDAV-Binding für Müllkalender

Beitrag von eiGelbGeek »

Ändere mal die Zeile

Code: Alles auswählen

caldavio:Muellkalender:charset=UTF-8
in

Code: Alles auswählen

caldavio:Muellkalender:charset=utf8

Vielleicht reicht das ja schon :-)

Ansonsten hier noch ein Tutorial :-)

https://www.eidelsburger.de/hobbys_und_ ... n-openhab/

Hoggle
Beiträge: 213
Registriert: 16. Dez 2017 10:49

Re: CALDAV-Binding für Müllkalender

Beitrag von Hoggle »

Hallo.
Habe ich mal geändert. Jetzt kommt eine andere Fehlermeldung:

Sardine error while loading calendar entries: Unexpected response (405 - Method Not Allowed)

Hier der Bereich aus dem Log, direkt nach dem speichern der caldavio.cfg:

Code: Alles auswählen

2019-08-19 14:57:26.043 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - CalDAV IO is properly configured.

019-08-19 14:57:27.170 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine error while loading calendar entries: Unexpected response (405 - Method Not Allowed)

com.github.sardine.impl.SardineException: Unexpected response

	at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:40) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:35) ~[235:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218) ~[235:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:962) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:417) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:409) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:386) ~[235:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) ~[235:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) [235:org.openhab.io.caldav:1.13.0]

	at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]

	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]
Mhh, welche Methode ist denn nicht erlaubt?
RPI4/8GB RAM mit openhabian (bullseye) - Kernel Linux 6.1.21-v8+ - openhab 4.0.2 - Release Build - HM-CCU3 - ZWave UZB-USB Stick - Wifi-LED-Stripes - Logitech Harmony Hub - AVM Fritzbox - Enigma2-Box - Gardena HUB - Fronius-Binding - Miele@Home

eiGelbGeek
Beiträge: 226
Registriert: 11. Aug 2019 06:39
Answers: 4

Re: CALDAV-Binding für Müllkalender

Beitrag von eiGelbGeek »

Code: Alles auswählen

Sardine error while loading calendar entries: Unexpected response (405 - Method Not Allowed)
Die Anfrage an den Google Kalender würde ich behaupten...

eiGelbGeek
Beiträge: 226
Registriert: 11. Aug 2019 06:39
Answers: 4

Re: CALDAV-Binding für Müllkalender

Beitrag von eiGelbGeek »



eiGelbGeek
Beiträge: 226
Registriert: 11. Aug 2019 06:39
Answers: 4

Re: CALDAV-Binding für Müllkalender

Beitrag von eiGelbGeek »

Ich teste das gleich mal mit meinen Kalender (Synology) Mal sehen ob das funktioniert ;-)

Hoggle
Beiträge: 213
Registriert: 16. Dez 2017 10:49

Re: CALDAV-Binding für Müllkalender

Beitrag von Hoggle »

Hallo.

Vielen Dank für deine Denkanstöße.
Ich hatte schon gedacht: "Na klar, hab ja die 2-step Verification".
Hab dann jetzt mal nen app-Passwort angelegt und im ersten Moment kam:

Code: Alles auswählen

2019-08-20 07:54:57.031 [INFO ] [.io.caldav.internal.CalDavLoaderImpl] - CalDAV IO is properly configured.
Leider kam kurze Zeit später wieder diese Meldung:

Code: Alles auswählen

2019-08-20 07:57:27.150 [WARN ] [caldav.internal.job.EventReloaderJob] - Sardine error while loading calendar entries: Unexpected response (405 - Method Not Allowed)

com.github.sardine.impl.SardineException: Unexpected response

	at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:48) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:40) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.handler.MultiStatusResponseHandler.handleResponse(MultiStatusResponseHandler.java:35) ~[235:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218) ~[235:org.openhab.io.caldav:1.13.0]

	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:962) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:417) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:409) ~[235:org.openhab.io.caldav:1.13.0]

	at com.github.sardine.impl.SardineImpl.list(SardineImpl.java:386) ~[235:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.loadEvents(EventReloaderJob.java:246) ~[235:org.openhab.io.caldav:1.13.0]

	at org.openhab.io.caldav.internal.job.EventReloaderJob.execute(EventReloaderJob.java:137) [235:org.openhab.io.caldav:1.13.0]

	at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]

	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [107:org.eclipse.smarthome.core.scheduler:0.10.0.oh240]
Aber es ist schon richtig, das man als "username" seinen login-Namen nimmt, oder?
Beim anlegen des App-Passworts steht auf der letzten Seite eine andere Mail-Adresse. Soll das nur ein Beispiel sein?
Siehe Bild:
App-Passwort.jpg
Was mich stört ist die Meldung: "Method not Allowed".

Wenn das Passwort nicht passen würde, dann sollte doch irgend etwas mit "authentication error", oder so stehen.

Kann da vielleicht etwas mit den Kalendereinträgen nicht passen?
Hier mal die ersten Einträge aus der ics-Datei, die ich von meiner Stadt bekommen hatte:

Code: Alles auswählen

BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:Digitaler Umweltkalender
PRODID:-//Digitaler Umweltkalender//iCal 2.0//EN
X-WR-TIMEZONE:Europe/Berlin
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
LOCATION:Abfuhrbezirk 3
DTSTART;VALUE=DATE:20190823
UID:ve-at-2019001
SUMMARY:Gelber Sack
DTEND;VALUE=DATE:20190824
SEQUENCE:1
DESCRIPTION:Abfuhr der gelben Säcke im Abfuhrbezirk 3. Die Behältnisse müssen am Abholtag ab 6.00 Uhr bereitstehen!
END:VEVENT
BEGIN:VEVENT
LOCATION:Abfuhrbezirk 3
DTSTART;VALUE=DATE:20190823
UID:ve-at-2019002
SUMMARY:Komposttonne
DTEND;VALUE=DATE:20190824
SEQUENCE:1
DESCRIPTION:Abfuhr der Komposttonne im Abfuhrbezirk 3. Die Behältnisse müssen am Abholtag ab 6.00 Uhr bereitstehen!
END:VEVENT
Mir fehlen auf Grund von Spezial-wissen die Ideen.
Du hast keine ausreichende Berechtigung, um die Dateianhänge dieses Beitrags anzusehen.
RPI4/8GB RAM mit openhabian (bullseye) - Kernel Linux 6.1.21-v8+ - openhab 4.0.2 - Release Build - HM-CCU3 - ZWave UZB-USB Stick - Wifi-LED-Stripes - Logitech Harmony Hub - AVM Fritzbox - Enigma2-Box - Gardena HUB - Fronius-Binding - Miele@Home

Stefan Otten
Beiträge: 73
Registriert: 11. Nov 2018 06:51

Re: CALDAV-Binding für Müllkalender

Beitrag von Stefan Otten »

Hallo,

ich habe vor einiger Zeit ebenfalls Erfolglos mit diesem Binding experimentiert.
Ich habe dann dieses Binding gefunden, das funktioniert bei mir tadellos.
https://www.openhab.org/addons/integrations/gcal/

Meine gcal.cfg sieht folgendermaßen aus:

Code: Alles auswählen

############################### GCal configuration ################################
#
# Before using GCal, you need to have a Google API
# Console project. The Wiki describes in detail the steps necessary to set 
# up your Google API Console project, as well as how to obtain the credentials 
# necessary to complete the information in this file. Once the project is created, 
# and you've completed the steps described in the Wiki, you need to copy 
# the "Client ID" and "Client secret" from the Credentials page on 
# console.developers.google.com
#
#
# Copied from the "Client ID" field on the Credentials page. (required)
client_id=Client-ID

# Copied from the "Client secret" field on the Credentials page (required)
client_secret=Secret-Code

# This is the name you gave to your Google Calendar, or the word 'primary' if you
# want to use your default Google calendar.  GCal will download calendar events 
# from this calendar (required)
calendar_name=Openhab

# The filter criteria by which calendar events are searched. The Google Calendar 
# API will do a text search to find calendar events that match the supplied terms. 
# All calendar event fields are searched, except for extended properties (optional)
filter=

# Refresh interval (in milliseconds) is the frequency with which the
# Google calendar will be checked for calendar events (optional, defaults 
# to 900000 [15 minutes])
refresh=900000
In das Kalenderereignis schreibe ich z.B. in die Beschreibung:
send Licht_Wohnzimmer OFF

Mann kann aber auch Ereignisse zum Start und zum Ende des Termines festlegen.
Also bei einem Termin von 10:00 bis 13:00 Uhr
wird um 10:00 Uhr das Licht und die Pumpe im Garten eingeschaltet und um 13:00 Uhr wieder aus.

start {
send Light_Garden ON
send Pump_Garden ON
}
end {
send Light_Garden OFF
send Pump_Garden OFF
}

Grüße
Stefan

P.S.
Das AddOn "Google Calendar Scheduler" findest Du bei den AddOn's unter "MISC"

Hoggle
Beiträge: 213
Registriert: 16. Dez 2017 10:49

Re: CALDAV-Binding für Müllkalender

Beitrag von Hoggle »

Hallo.
So, die Konfiguration und das anmelden hat schon mal geklappt, aber jetzt fehlt es mir an Ideen, was ich machen kann.
In meinem Kalender stehen die Abholtermine der Mülltonnen.
Wie bekomme ich die jetzt mit dem Scheduler nach Openhab?
Muß ich die erst noch "umformatieren"?
Wie fülle ich ein Item mit den Infos?

Hier mal meine gcal.cfg

Code: Alles auswählen

#
# Copied from the "Client ID" field on the Credentials page. (required)
client_id=ID.apps.googleusercontent.com

# Copied from the "Client secret" field on the Credentials page (required)
client_secret=Client-Secret

# This is the name you gave to your Google Calendar, or the word 'primary' if you
# want to use your default Google calendar.  GCal will download calendar events
# from this calendar (required)
calendar_name=Muellkalender

# The filter criteria by which calendar events are searched. The Google Calendar
# API will do a text search to find calendar events that match the supplied terms.
# All calendar event fields are searched, except for extended properties (optional)
#filter=

# Refresh interval (in milliseconds) is the frequency with which the
# Google calendar will be checked for calendar events (optional, defaults
# to 900000 [15 minutes])
#refresh=
Habe den Code auch in Google eingegeben und kann mich anmelden.

Jetzt kommt der folgende Fehler:

Code: Alles auswählen

2019-08-20 10:58:32.708 [ERROR] [openhab.io.gcal.auth.GCalGoogleOAuth] - authentication I/O exception: 403 Forbidden

{

  "code" : 403,

  "errors" : [ {

    "domain" : "usageLimits",

    "message" : "Project 887315350516 is not found and cannot be used for API calls. If it is recently created, enable Calendar API by visiting https://console.developers.google.com/apis/api/calendar-json.googleapis.com/overview?project=887315350516 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",

    "reason" : "accessNotConfigured",

    "extendedHelp" : "https://console.developers.google.com/apis/api/calendar-json.googleapis.com/overview?project=887315350516"

  } ],

  "message" : "Project 887315350516 is not found and cannot be used for API calls. If it is recently created, enable Calendar API by visiting https://console.developers.google.com/apis/api/calendar-json.googleapis.com/overview?project=887315350516 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
RPI4/8GB RAM mit openhabian (bullseye) - Kernel Linux 6.1.21-v8+ - openhab 4.0.2 - Release Build - HM-CCU3 - ZWave UZB-USB Stick - Wifi-LED-Stripes - Logitech Harmony Hub - AVM Fritzbox - Enigma2-Box - Gardena HUB - Fronius-Binding - Miele@Home

Antworten