tybritten / ical-sensor-homeassistant Goto Github PK
View Code? Open in Web Editor NEWan iCal Sensor for Home Assistant
an iCal Sensor for Home Assistant
Hi, when i try to import the Calendar from my Nextcloud installation i get the following error:
17-02-27 22:05:37 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform ical Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform entity_platform.add_entities, discovery_info File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__ yield self # This tells Task to wait for completion. File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup future.result() File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result raise self._exception File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "/root/.homeassistant/custom_components/sensor/ical.py", line 38, in setup_platform data_object.update() File "/usr/local/lib/python3.5/dist-packages/homeassistant/util/__init__.py", line 296, in wrapper result = method(*args, **kwargs) File "/root/.homeassistant/custom_components/sensor/ical.py", line 126, in update events = dateparser(cal,today) File "/root/.homeassistant/custom_components/sensor/ical.py", line 59, in dateparser if type(event['DTEND'].dt) is dt.date: File "/usr/local/lib/python3.5/dist-packages/icalendar/caselessdict.py", line 45, in __getitem__ return super(CaselessDict, self).__getitem__(key.upper()) KeyError: 'DTEND'
Any chance to avoid this?
The default update time is the start of the next day (midnight). But unfortunately trying to set automations today for automations tomorrow cant be set until the next days sensor update.
example. I have a daily changing schedule every day. some days have 3 events, others have 7. So, when i pull today/tomorrow events, i get the usual sensor.ical_cal_0 , 01, 02, etc. So, tomorrow's first event of the day might end up being sensor.ical_cal_6
so any attempt at setting any automation today for tomorrow's first sensor event won't work; because at midnight sensor 06 becomes sensor_0.
if i could manually set the "update time" to something like 6hrs, 12hrs, 18hrs etc i could run automations at a time where i know sensor_0 is the first one in the list and all events for today are finished.
i could template the hell out of it, but a manual update function would be much easier.
I moved my lunch block from 11:30 to 1 pm for today due to other meeting conflicts, but the iCal has the appointment in there twice, once for orig time and once for the new time.
Also as Thurs/Friday is a holiday, and I'm off Monday I removed all meetings as to not be disturbed while away, and in this case the recurring meetings don't show for those days.
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
2019-09-20 23:15:40 ERROR (SyncWorker_4) [custom_components.ical.sensor] RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware,
was not before last version
and not in /custom_components/sensors :)
This shows in log:
WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'ical'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'ical'
Hi there. Somehow I'm getting 2 sensors showing for the exact same event on the same date, and one of them has the wrong ETA. iCal component is installed via HACS and configured via the integrations GUI. Running latest version. Here are the states of my sensors (have been wrong for days).
Logs are here
I just installed this component via HACS.
After restart of HA I followed the directions and went to Configuration -> Integrations -> Add Integration. I'm unable to find any integration called ical
HA version: core-2021.4.1
Is this possible? And if so, can you point me in the right direction?
Hi!
Thanks for creating this!
A thought: perhaps it might make sense to expose the same sorts of sensors that the CalDav integration does?
This way they could be drop in compatible with each other.
Additionally, the sorts of things I would like to automate from a ical feed are current and upcoming meetings.
Thanks!
I am in seeing that the UTC timecode are wrong. I see this timezone in the start time for an event, for example, start: 2019-09-07T15:30:00-04:00 this means that UTC time is 15:30 and -4hrs. Yet I am in CST which should have 5 instead of 4. I notice that all the times that are set in the state are 1hr ahead of my TZ. Is this modifiable?
Repeating dates that are marked as "all day" have the start time 00:00 and the end date from the next occuring date.
So e.g. if I am adding a date that repeats every week monday the date is shown in home assistant as a date from monday to next monday.
Exception can't compare offset-naive and offset-aware datetimes in starts/ends: XXXXXXXXXXX - Start: 2020-07-03 12:05:00+02:00 - End: 2020-07-03 13:25:00+02:00, RRule: vRecur({'FREQ': ['WEEKLY'], 'BYDAY': ['FR']})
Any chance you can use a valid or even better - user definable start and end times for all-day events you find.
Start January 12, 2022, 24:00:00
End January 13, 2022, 24:00:00
Valid times run from 00:00:00 - 23:59.59
The state for the events is the name of the event and the date/time it starts. Is it possible to change it to show on or off depending on if the event has started?
Something is going wrong with this recurring full-day item. I get a lot of the following errors in my log file. I'm not knowledgeable enough yet to understand what is causing it, though.
2021-05-19 13:40:00 ERROR (MainThread) [custom_components.ical] Exception can't compare datetime.datetime to datetime.date in starts/ends: Gym - Start: 2020-11-03 00:00:00+01:00 - End: 2020-11-04 00:00:00+01:00, RRule: vRecur({'FREQ': ['WEEKLY'], 'WKST': ['MO'], 'INTERVAL': [1], 'BYDAY': ['TH', 'FR']})
Hi,
I'm running HA 2021.5.5 on docker and just installed the ical sensor using hacs. The integration seem to be installed, but trying to add/configure it using the configuration -> integrations -> add integration doest not work as it's not listed on the "set up new integration menu". The following images shows the problem:
I'm seeing the following in my HA logs which I was looking over trying to figure out why when I just installed this I can't find an 'ical' type when I go to add integrations (still haven't figured that out!)
2021-04-09 14:48:43 WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'ical'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintain
er of 'ical'
HA version: core-2021.4.1
If there could be a way to customise the date format through the config_flow interface and be included in the sensor's state.
The default is showing as (Event Summary - %-d %B %Y)
For example, personally, I prefer to have the state as (Event Summary %A %b %-d, %Y), and I had to create a new sensor with customised date format. In the case of having many iCal sensors, then I will have to create a new sensor for each event rather than have it configured in UI.
I have my integration working and my bookings are showing but the time format is incorrect, i have time zones enabled on iCloud and when i move a booking it moves but seems to be the wrong time format.
I have time_zone: Eurpoe/London within the configuration.yaml file.
it also seems to be 1 hour behind. for example i have the booking in my calendar at 16:00 but on my calendar within Home assistant its showing at 03:00.
Can someone please point me in the right direction to update this.
If I have an appointment like this:
Start June 24, 2021, 12:00:00 AM
End June 24, 2021, 12:00:00 AM
All day true
It will disappear at about 12:01am on the day of.
Is this a problem with my feed or all day events?
Could this support two calendars ?
Hi, I made a little holiday sensor with this and it works really nicely, but showing it on my dashboard it contains a too bit much information.
Would it be possible to have some options to decide which part of the data ends up in the sensor value? I'd like to remove the year and hour to make it more concise.
add support for the new calender ?
Maybe im missing something maybe im dumb. but seems like a bug as it seems to install fine but theres no way through the UI to add a url and name of the calendar.
I just added a few commits to clean up the instructions (HA wants the custom _components directory to be /<custom component name>/<entity type>.py
instead of the opposite.
I've also added versioning (at 0.1.1 currently) to both the sensor.py file as a var, to the releases, and to the json file the custom_component updater uses to update.
@quentinsf take a look. make sure to rev the versions with any additional changes in the future.
Hi,
Again this component fails with a lot of errors after the latest update and integration by UI instead of yaml.
Once you solved this in #23 , but now the same errors are returned.
I did try to use the same sensor.py, as you provided earlier, but this time it isn't helping.
Logging:
Traceback (most recent call last):,
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup,
result = await component.async_setup_entry(hass, self) # type: ignore,
File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 67, in async_setup_entry,
return await hass.data[DOMAIN].async_setup_entry(entry),
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 140, in async_setup_entry,
platform = await async_prepare_setup_platform(,
File "/usr/src/homeassistant/homeassistant/setup.py", line 298, in async_prepare_setup_platform,
platform = integration.get_platform(domain),
File "/usr/src/homeassistant/homeassistant/loader.py", line 424, in get_platform,
cache[full_name] = self._import_platform(platform_name),
File "/usr/src/homeassistant/homeassistant/loader.py", line 429, in _import_platform,
return importlib.import_module(f"{self.pkg_path}.{platform_name}"),
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module,
return _bootstrap._gcd_import(name[level:], package, level),
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import,
File "<frozen importlib._bootstrap>", line 991, in _find_and_load,
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked,
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked,
File "<frozen importlib._bootstrap_external>", line 779, in exec_module,
File "<frozen importlib._bootstrap_external>", line 916, in get_code,
File "<frozen importlib._bootstrap_external>", line 846, in source_to_code,
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed,
File "/config/custom_components/ical/sensor.py", line 7,
<!DOCTYPE html>,
^,
SyntaxError: invalid syntax,
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted] - Start: 2021-01-21 13:00:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 28, 12, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [1], 'BYDAY': ['TH'], 'WKST': ['MO']}),
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted] - Start: 2021-01-22 08:00:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 29, 7, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [1], 'BYDAY': ['FR'], 'WKST': ['MO']}),
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted] - Start: 2021-01-23 12:00:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 30, 11, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [1], 'BYDAY': ['SA'], 'WKST': ['MO']}),
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted]- Start: 2021-01-25 08:00:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 25, 7, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [1], 'BYDAY': ['MO'], 'WKST': ['MO']}),
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted] - Start: 2021-01-26 06:30:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 26, 5, 30, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [1], 'BYDAY': ['TU'], 'WKST': ['MO']}),
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted] - Start: 2021-01-26 08:00:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 26, 7, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [1], 'BYDAY': ['TU'], 'WKST': ['MO']}),
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted] - Start: 2021-01-26 09:00:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 26, 8, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [1], 'BYDAY': ['TU'], 'WKST': ['MO']}),
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted] - Start: 2021-01-26 13:00:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 26, 12, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [1], 'BYDAY': ['TU'], 'WKST': ['MO']}),
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted] - Start: 2021-01-26 20:00:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 26, 19, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [1], 'BYDAY': ['TU'], 'WKST': ['MO']}),
2021-01-24 16:22:40 ERROR (MainThread) [custom_components.ical] Exception RRULE UNTIL values must be specified in UTC when DTSTART is timezone-aware in start_rules.rrule: [redacted] - Start: 2021-01-30 09:45:00 - RRule: vRecur({'FREQ': ['WEEKLY'], 'UNTIL': [datetime.datetime(2021, 1, 30, 8, 45, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))], 'INTERVAL': [6], 'BYDAY': ['SA'], 'WKST': ['MO']}),
From the description:
This integration will create sensors for the next few future calendar events, called:
sensor.ical_my_calendar_event_0
sensor.ical_my_calendar_event_1
sensor.ical_my_calendar_event_2 (...)
I would assume Next Few would mean that event 0 would become the value of event 1 once event 0 was over, is this not the way it should occur?
As it is now, the component lists passed events if they are on the same day. As I use automations to check next event it is quite hard to switch between different sensors if the event is passed. Unfortunately I havent figured out the code for this.
So, if the end time for the event is passed, it is better to just let it fall out from the sensors list.
It would be a good idea to change the eta to minutes or seconds (Not very important)
Also - it is a good idea to also have the description (or notes) added:
I just added this to the code:
if 'DESCRIPTION' in event:
event_dict['description'] = event['DESCRIPTION']
and
self._event_attributes = {
'name': None,
'location': None,
'description': None,
'start': None,
'end': None,
'eta': None
}
and
self._event_attributes['location'] = location
description = val.get('description', '')
Is there a trigger event available for when the calendar items update/change?
Hi, I'm trying to use this component on this feed:
http://www.mozilla.org/media/caldata/CzechHolidays.ics
But instead of correctly displaying the holiday name as:
Velký pátek
It's displayed as:
Velký pátek
Another example is:
Velikonoční pondělí
Which is displayed as
VelikonoÄ�nà pondÄ�lÃ
I'm guessing it's just using ACSII instead of Unicode? Could Unicode support be added?
I think the Component needs to be updated to accommodate Home Assistant 2021.12 Changes:
Log Message:
2021-12-12 21:59:14 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.ical_xxx_event_0 (<class 'custom_components.ical.sensor.ICalSensor'>) implements device_state_attributes. Please report it to the custom component author.
Is it possible to convert this or make it compatible with the built-in calendar component that HASS has now? If it adopted that, it would be equivalent to the caldav/google calendar integrations, and work with the Lovelace Calendar Card for example.
Hi there,
Any way to choose the language of the date displayed in the sensor?
Thanks.
Any idea how to solve this error:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/etc/homeassistant/custom_components/sensor/ical.py", line 36, in setup_platform
data_object.update()
File "/usr/local/lib/python3.4/dist-packages/homeassistant/util/__init__.py", line 296, in wrapper
result = method(*args, **kwargs)
File "/etc/homeassistant/custom_components/sensor/ical.py", line 114, in update
events = dateparser(cal,today)
File "/etc/homeassistant/custom_components/sensor/ical.py", line 57, in dateparser
if start <= date <= end:
File "/etc/homeassistant/deps/arrow/arrow.py", line 774, in __ge__
return self._datetime >= self._get_datetime(other)
TypeError: can't compare offset-naive and offset-aware datetimes
````
Thanks,
Frank
So far it has only been possible to read an ics file via URL (http://mydomain.to/ical). Reading in via file path (/myfile/ical.ics) would also make sense. Is it possible to install this?
many Greetings
Michael
Hey! Testing out the ical
integration
calendar.app
from ´macos 10.15 catalina, I get a link like
webcal://p31-caldav.icloud.com/published/2/ODg3MzYwMTY4ODczNjAxNvEb6BxHp_EwfT8xPuCo2KePwfb0esszVX62STeuIWy280sMD7Nf_x3m7CkFdtlgLd83BMgrC8R5C3W7EGjh`webcal:
but ical requires http:
tips? I tried replacing
webcalwith
http` but no goCan't see this in the readme, but does this overwrite event_0, for example? Or how does it handle old events that past? Does it always create new events with event_n; where n = 0, 1, 2, .....
I do got Some errors often:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 261, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 441, in async_device_update
await self.hass.async_add_executor_job(self.update)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/ical/sensor.py", line 151, in update
self.data_object.update()
File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/ical/sensor.py", line 195, in update
events = dateparser(cal, today)
File "/config/custom_components/ical/sensor.py", line 62, in dateparser
start = arrow.get(event['DTSTART'].dt)
File "/usr/local/lib/python3.7/site-packages/arrow/api.py", line 21, in get
return _factory.get(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/arrow/factory.py", line 193, in get
return self.type.fromdatetime(arg)
File "/usr/local/lib/python3.7/site-packages/arrow/arrow.py", line 220, in fromdatetime
tzinfo,
File "/usr/local/lib/python3.7/site-packages/arrow/arrow.py", line 71, in __init__
tzinfo = parser.TzinfoParser.parse(tzinfo.zone)
File "/usr/local/lib/python3.7/site-packages/arrow/parser.py", line 380, in parse
raise ParserError('Could not parse timezone expression "{}"'.format(string))
arrow.parser.ParserError: Could not parse timezone expression "Customized Time Zone"
I retreiving ical-events from Zoho mail and "all day" events are ignored. The structure of "all day" events in the downloaded file are as followed:
BEGIN:VCALENDAR
PRODID:-//Zoho Corporation//Zoho Calendar-US//EN
VERSION:2.0
X-WR-CALNAME:henrik
X-WR-TIMEZONE:Europe/Stockholm
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
SUMMARY:xxxxxxxx
DESCRIPTION:
DTSTART;VALUE=DATE:20170215
DTEND;VALUE=DATE:20170218
LOCATION:
CLASS:PUBLIC
IMPORTANT:1
STATUS:CONFIRMED
UID:[email protected]
TRANSP:OPAQUE
PRIORITY:5
CREATED:20170206T142912Z
LAST-MODIFIED:20170206T142912Z
DTSTAMP:20210226T053138Z
ORGANIZER;CN=xxxxxxxxx
END:VEVENT
What is wrong, why don't they show up as sensor?
I know this can be done with a template sensor but that would add an other sensor
def update(self):
"""Get the latest update and set the state and attributes."""
# Defaults:
self._state = "No event"
# I guess the number and details of attributes probably
# shouldn't change, so we should really prepopulate them.
self._event_attributes = {
'name': None,
'start': None,
'end': None,
'eta': None
}
# Get the data
self.data_object.update()
event_list = self.data_object.data
if event_list and (self._eventno < len(event_list)):
val = event_list[self._eventno]
start = val['start'].datetime
self._event_attributes['start'] = start
self._event_attributes['eta'] = (start - dt.datetime.now(start.tzinfo )+ timedelta(days=1)).days
name = val.get('name', 'unknown')
self._event_attributes['name'] = name
self._state = "{} - {}".format(
name,
start.strftime("%-d %B %Y %H:%M")
)
Currently we get the following information from the ical entity:
message: Sprint Review
all_day: false
start_time: '2021-11-30 09:30:00'
end_time: '2021-11-30 10:00:00'
location: Microsoft Teams Meeting
description: null
offset_reached: false
friendly_name: ICal Calendar
Since this event occurs in the future and there is no current event this is technically the next event. What I would like to see added is the properties above in bold with next_evet_PropertyName added.
So before 9:30 the above and next_event would all have the same values, but between 9:30 & 10;00 the next_event would show the values for the next calendar item to appear after 10 am.
I'm loving this custom integration - great work!
One feature that would be much appreciated would be the ability to filter events by different attributes.
Version 1.2
HA core-2021.1.4
supervisor-2021.01.4
Fresh install using HACs.
When selecting ICAL in integration the flow does not kick in. All other flows in integrations seem to work fine.
Header
`Request URL: http://hassio.local:8123/api/config/config_entries/flow
Request Method: POST
Status Code: 404 Not Found
Remote Address: 10.1.1.100:8123
Referrer Policy: same-origin
Content-Encoding: deflate
Content-Length: 48
Content-Type: application/json
Date: Sun, 17 Jan 2021 19:44:34 GMT
Server: Python/3.8 aiohttp/3.7.3
Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmNzFmN2ViNmM3NmE0MDIxYTZjNGY4ZGFjZWU2MWM2NyIsImlhdCI6MTYxMDkxMDkyOCwiZXhwIjoxNjEwOTEyNzI4fQ.a1cJE6XTY43vmH-uO-FalWTkh5u_G2MNc6GQg8XG-tc
Connection: keep-alive
Content-Length: 46
Content-Type: application/json;charset=UTF-8
DNT: 1
HA-Frontend-Base: http://hassio.local:8123
Host: hassio.local:8123
Origin: http://hassio.local:8123
Referer: http://hassio.local:8123/config/integrations
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75
{handler: "ics", show_advanced_options: true}
handler: "ics"
show_advanced_options: true`
Response
{"message": "Invalid handler specified"}
Tried to debug this myself with no success. Seems to be some wierd issue with the icalendar rrules library. The lists that get returned (starts & ends) both have the same number of items in it however about halfway through the iterations, they get off so they dont match up anymore. I can solve this partially by popping off from the ends list initially but that only fixes some of the events and then mismatches the other half.
Hi,
I followed this guide to find the URL for the component settings: https://www.techrepublic.com/article/how-to-find-your-icloud-calendar-url/
But was asked for log in information. Is there anywhere this can be entered to link my iCloud calendar with this module?
Thanks,
Home Assistant 2021.12.8
Home Assistant OS 7.1
supervisor-2021.12.2
HACS 1.19.1
I have a calendar with authentication with user and password, can i solve?
hi all,
In Google Calendar I created a publically accessible URL (does it need to be public?) I can put this in a browser and access the calendar ok.
ical is installed in home assistant, but it is not picking up any events. I have some all-day events and also a timed event, all in the coming 7 days.
I've turned on logging e.g.:
logger:
default: critical
logs:
custom.components.ical: debug
But am not receiving any errors at all.
Anyone else have Google Cal working?
Hi
You recent changes are not visable in HACS store. I beleive this is due the fact that it is not tagged with a version newer then 0.3. In HACS the lates version is 0.3 now, and missing your latest commits.
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.