KoljaWindeler / ics

Integration that displays the next event of an ics link (support reoccuring events)
50 stars 13 forks source link

sensor.ics_1 state = failure #1

Closed pbosker closed 4 years ago

pbosker commented 4 years ago

Hello Kolja

I'm at Home Assistant 0.107.4. I've installed ICS from HACS and updated configuration.yaml with the following (URL key masked below):

sensor:
  - platform: ics
    name: Marys_birthday
    url: https://calendar.google.com/calendar/ical/pbosker%40gmail.com/private-1fxxxx3b/basic.ics
    startswith: Mary
    id: 1

The sensor consistently fails to connect. Below is the sensor state:

sensor.ics_1 | failure | description: - 
                         remaining: -1 
                         friendly_name: Marys_birthday 
                         icon: mdi:calendar

There is nothing that indicates problems in the log

[192.168.1.241:8009] Failed to connect, retrying in 5.0s
10:19:41 AM – /usr/local/lib/python3.7/site-packages/pychromecast/socket_client.py (ERROR)
You are using a custom integration for ics which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
10:19:39 AM – loader.py (WARNING) - message first occurred at 10:19:28 AM and shows up 4 times
Resources need to be specified in your configuration.yaml. Please see the docs.
10:19:28 AM – Lovelace (WARNING)

Thank you for any assistance pbosker@gmail.com

PatMei commented 4 years ago

Hello Kolja,

I get the same error message, but with our trashcalendar: https://awido.cubefour.de/Customer/awb-duerkheim/KalenderICS.aspx?oid=00000000-0000-0000-0001-000000000706&jahr=2020

Maybe its a problem cause it´s a full day event like birthday in post above^^ I implemented your examples, they worked pretty well!

Thanks in advance! Cheers

xiidoz commented 4 years ago

Same here with our garbage collection calendar: https://www.abfallwirtschaft.fuerth.eu/termine.php?icalexport=84281001 Sensor is displaying 'failure', but no error in log.

KoljaWindeler commented 4 years ago

hi @xiidoz your link is working now, that was fixed by this request https://github.com/KoljaWindeler/ics/pull/2 thanks to @apoc4lyps

PatMei commented 4 years ago

Manual update of "sensor.py" in hacs fixed it for me. There was a fix two days ago https://github.com/KoljaWindeler/ics/pull/2

xiidoz commented 4 years ago

Can confirm! Thank you very much! 😄

KoljaWindeler commented 4 years ago

@pbosker: I've uploaded a new version with a lot more error tracking .. that should give us some information. I've tested the integration with my private google calendar and it worked right away, so I'm not sure what causes the issue at the moment. could you update and restart HA to check if you'll get some output? I should look like this:

============= ISC Integration Error ================ unfortunately ICS hit an error, please open a ticket at https://github.com/KoljaWindeler/ics/issues and paste the following output:

Traceback (most recent call last): File "/opt/ics/testing/sensor.py", line 58, in rem = date - datetime.datetime.now(pytz.utc) TypeError: unsupported operand type(s) for -: 'datetime.date' and 'datetime.date time'

thanks, Kolja ============= ISC Integration Error ================

Thanks.

pbosker commented 4 years ago

Hi Kolja The fix provided resolved the issue. Thank you for the quick turnaround. Great job!

KoljaWindeler commented 4 years ago

perfect thanks. please be aware that there was a bug in the calculation of the remaining days that is now also fixed. see https://github.com/KoljaWindeler/ics/issues/3#issuecomment-602680955