Giter VIP home page Giter VIP logo

ical-sensor-homeassistant's People

Contributors

basschipper avatar cybersmurfen avatar freddy1020 avatar jcgoette avatar olen avatar quentinsf avatar teknisksupport avatar tiaanv avatar tybritten 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  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  avatar

ical-sensor-homeassistant's Issues

Owncloud/Nextcloud ICS

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?

[FEATURE REQ] Ability to adjust sensor "update" time

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.

ETA will always be "0"

Have installed the newset (1.3) version and discoverd, that all ETAs are "0".
Any ideas whats going wrong here?

image

New RRULES error after last update

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

Version key

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'

Duplicate sensors for the same event

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).

ical_problem

Logs are here

Unable to add integration

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

Mimic exposed sensors of the CalDav integration

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!

How to change timezone

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 not read correctly

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.

24:00:00 isn't a valid time

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

Exception can't compare datetime.datetime to datetime.date in starts/ends

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']})

integration doesnt appear on configuration->integration

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:

Screen Shot 2021-05-25 at 13 10 18

Screen Shot 2021-05-25 at 13 09 59

According to Home Assistant there is no version key

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

ENHANCEMENT - Date Format

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)

image

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.

image

iCal Calendar times are showing in the incorrect time format

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.

Full day events disappear on the day of

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?

Feature request: option to remove year and hour in sensor

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.
image

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.

Updating for preferred HA location/naming and Custom Updater

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.

RRULES errors after last update

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']}),

Sensors are always the first four items in my calendar

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?

Skip passed event and add descriptons

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', '')

Home Assistant 2021.12 Warning - components implements device_state_attributes

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.

Localisation

Hi there,

Any way to choose the language of the date displayed in the sensor?

Thanks.

TypeError: can't compare offset-naive and offset-aware datetimes

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

macOS 10.15 Calendar

Hey! Testing out the ical integration

  • when I create and share a Calendar with calendar.app from ´macos 10.15 catalina, I get a link like webcal://p31-caldav.icloud.com/published/2/ODg3MzYwMTY4ODczNjAxNvEb6BxHp_EwfT8xPuCo2KePwfb0esszVX62STeuIWy280sMD7Nf_x3m7CkFdtlgLd83BMgrC8R5C3W7EGjh`
  • protocol is webcal: but ical requires http:
    tips? I tried replacingwebcalwithhttp` but no go

Error

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"

Recurring events doesn't show

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?

add attribute days untill event start

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")
            )

[Feature Request] Next Event

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.

[Feature Request] Event Filters

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.

Integration Flow : {"message": "Invalid handler specified"}

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"}

Weird bug with rrules

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.

No integration

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?

No sensors when using Google Calendar

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?

HACS updates

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

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.