Open riegera2412 opened 1 month ago
ModuleNotFoundError: No module named 'icalendar.windows_to_olson'
Sounds like icalendar >= 6.0.0 is installed, but icalevents (Libraary we use to parse ICS files) currently only supports icalender < 6.0.0 (see https://github.com/jazzband/icalevents/pull/145).
I'm not quite sure how this happens, as icalevents dependency should be respected when HA installs components dependencies
Just guessing: the manifest.json has no version identifier for icalendar. Could be that the user has a fresh install and the highest version was installed... Looks like the ics_v1 service is using icalendar.
Not exactly sure how HA resolves dependencies but as icalevents requires icalendar==5.0.13 so HA (I think the se uv now) should not install icalendar 6....
I doubt ics_v1 is the problem here, as it does not use the changed functions/modules of icalendar 6 (the stack trace also shows File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 7, in <module> from icalevents import icalevents
)
It seems to be issue with multiple instances as there a few source not found
issues reported here.
The error message is pretty bad as every import error inside a source will trigger this error message. I fixed this in #2908 (will test and merge it later)
... When I install in a clean venv environment with pip:
pip install icalendar icalevents!=0.1.28
icalendar gets installed with version
icalendar-5.0.13 icalevents-0.1.29
when I use uv with:
uv pip install icalendar icalevents!=0.1.28
the result is:
+ icalendar==6.0.1
+ icalevents==0.1.25
see that icalevents get installed with 0.1.25
I'll check it in a fresh HA environement now.
Update: No this is not the reason:
after a fresh install ha install and adding WCS via UI the result is:
icalendar 5.0.13
icalevents 0.1.29
@riegera2412 : Could you share the list of other custom_components that you have installed? And please share some context about your environment. This would help us to create a solution description as this is not a code more an environment problem.
@5ila5 : Besides my comments above...
It could happen that icalendar >5 gets installed when you try to install/use a custom_component with a hard dependency to icalendar>=6.0.0.
Flow:
pip list
)5.0.13
is installed6.0.1
is installed and WCS is failing@riegera2412 : Could you share the list of other custom_components that you have installed? And please share some context about your environment. This would help us to create a solution description as this is not a code more an environment problem.
I am running HassOS 2024.10.3 on a HP T620 Thin Client.
Also using the RaspberryMatic Addon to integrate Hometic IP hardware. For Ikea hardware I use a igbee 3 USB Dongle.
Not sure what other information you might need. If you require any specific information please ask.
EDIT: I have ics_calendar installed. Just checked the manifest.json and it specifies the following requirements:
"requirements": ["icalendar>=6.0.0","python-dateutil>=2.9.0.post0","pytz>=2024.1","recurring_ical_events>=3.3.2","ics>=0.7.2","arrow"],
Guess that could be the problem?
thx, please check the solution that I added above.
Worked like a charm! Thanks a lot!
icalevents 0.1.25 did not define a specific version of icalendar as dependency, this is why it installs it like this
We could set icalevents>=0.1.26,!=0.1.28 as dependency this would also force icalendar<6 as long as https://github.com/jazzband/icalevents/pull/145 is not resolved and a new version of icalevents is released.
But this approach would lead to dependency conflicts with integrations like ics_calendar.
But this is probably still the way to go, so users need to decide and check what they want.
I opened a PR for this (#2911)
@ReneNulschDE what do you think?
This will not have an impact based on my tests. Whenever the user are upgrading to ics_calendar 5.0.4, the icalendar >=6 will be installed. I checked all HACS-published integrations and only ics_calendar has this dependency.
My opinion: Let it as it is, say do not upgrade ics_calendar higher then 5.0.3, in case you have it done, use the process that I published - and wait for a new version of icalevents. And, you should pin the icalendar version in the manifest.json.
Maybe you could ask the maintainer of ics_calendar to revert to 5.0.3 or go back to the old icalendar lib? your component has 10x more users than ics_calendar. (could be offending... :-()
btw the command that I used to download the hacs-repos (found on discord some month before, can't remember who gets the credit) :
for repo in $(curl -sSL https://data-v2.hacs.xyz/integration/repositories.json | jq -r '.[]'); do if [ ! -d "${repo}" ]; then echo mkdir "${repo%%/*}" && git clone "git@github.com:${repo}" "${repo}"; else git -C "${repo}" pull origin; fi; done
Pinning icalevents>=0.1.26 should have the same effect as pinning icalendar, as icalevents>=0.1.26 defines a fixed version of icalevents as dependency. But if icalevents publishes a new version with support for icalendar=6 the dependency conflict should vanish without the need for a release of WCS
I Have A Problem With:
A specific source, The integration in general
What's Your Problem
After updating wcs to 2.30 my manual configuration in the config.yaml doesn't work. I tried downgrading to 2.2.0 and 2.1.0 but neither does the trick. I used a downloaded ics from my waste collection company that worked flawlessly for years. The config is shown in the config section.
I get three log messages:
Next, I commented out the configuration and tried the setup via the GUI, but when choosing Germany and then my source (EKM Mittelsachsen (ics)), I get an unknown error message.
In the logs the following warning appears:
There is also an HA error message at the moment of setting up wcs.
Any help and/or advice is greatly appreciated.
A.
Source (if relevant)
No response
Logs
Relevant Configuration
Checklist Source Error
Checklist Sensor Error
Required