bruxy70 / Garbage-Collection

🗑 Custom Home Assistant sensor for scheduling garbage collection (or other regularly re-occurring events - weekly on given days, semi-weekly or monthly)
MIT License
387 stars 90 forks source link

It doesn't work on HA 2021.4.1 #261

Closed damiano75 closed 3 years ago

damiano75 commented 3 years ago

Describe the bug

No sensors image

Configuration

Do you configure the integration in YAML or Config Flow (GUI)? : In YAML

garbage_collection:
  sensors:
########################################
### Raccolta differenziata
########################################
  - name: Indifferenziato (giallo) # Each week on Monday
    frequency: "weekly"
    collection_days:
    - mon

  - name: Multimateriale (blu) # Each week on Tuesday and Saturday
    frequency: "weekly"
    collection_days:
    - tue
    - sat

  - name: Carta # Each week on Thursday
    frequency: "weekly"
    collection_days:
    - thu

Error log/debug information

Logger: homeassistant.util.logging
Source: util/logging.py:101
First occurred: 18:00:41 (3 occurrences)
Last logged: 18:00:42

Exception in discovery_platform_listener when dispatching 'discovery.platform_discovered_load_platform.sensor': ({'service': 'load_platform.sensor', 'platform': 'garbage_collection', 'discovered': OrderedDict([('name', 'Indifferenziato (giallo)'), ('frequency', 'weekly'), ('collection_days', ['mon']), ('first_month', 'jan'), ('holiday_move_offset', 1), ('verbose_format', 'on {date}, in {days} days'), ('verbose_state', False), ('date_format', '%d-%b-%Y'), ('observed', True), ('icon_today', 'mdi:delete-restore'), ('offset', 0), ('hidden', False), ('period', 1), ('holiday_in_week_move', False), ('first_week', 1), ('icon_normal', 'mdi:trash-can'), ('last_month', 'dec'), ('icon_tomorrow', 'mdi:delete-circle')])},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/discovery.py", line 120, in discovery_platform_listener await task File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 133, in component_platform_discovered await self.async_setup_platform(platform, {}, info) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 222, in async_setup_platform platform = await async_prepare_setup_platform( File "/usr/src/homeassistant/homeassistant/setup.py", line 325, in async_prepare_setup_platform platform = integration.get_platform(domain) File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform cache[full_name] = self._import_platform(platform_name) File "/usr/src/homeassistant/homeassistant/loader.py", line 490, 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 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/config/custom_components/garbage_collection/sensor.py", line 7, in <module> import holidays File "/usr/local/lib/python3.8/site-packages/holidays/__init__.py", line 13, in <module> from holidays.countries import * File "/usr/local/lib/python3.8/site-packages/holidays/countries/__init__.py", line 45, in <module> from .israel import Israel, IL, ISR File "/usr/local/lib/python3.8/site-packages/holidays/countries/israel.py", line 15, in <module> from convertdate import gregorian, hebrew File "/usr/local/lib/python3.8/site-packages/convertdate/__init__.py", line 22, in <module> from . import bahai File "/usr/local/lib/python3.8/site-packages/convertdate/bahai.py", line 29, in <module> from pymeeus.Angle import Angle File "/usr/local/lib/python3.8/site-packages/pymeeus/Angle.py", line 23, in <module> from pymeeus.base import TOL ValueError: source code string cannot contain null bytes
Exception in discovery_platform_listener when dispatching 'discovery.platform_discovered_load_platform.sensor': ({'service': 'load_platform.sensor', 'platform': 'garbage_collection', 'discovered': OrderedDict([('name', 'Multimateriale (blu)'), ('frequency', 'weekly'), ('collection_days', ['tue', 'sat']), ('first_month', 'jan'), ('holiday_move_offset', 1), ('verbose_format', 'on {date}, in {days} days'), ('verbose_state', False), ('date_format', '%d-%b-%Y'), ('observed', True), ('icon_today', 'mdi:delete-restore'), ('offset', 0), ('hidden', False), ('period', 1), ('holiday_in_week_move', False), ('first_week', 1), ('icon_normal', 'mdi:trash-can'), ('last_month', 'dec'), ('icon_tomorrow', 'mdi:delete-circle')])},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/discovery.py", line 120, in discovery_platform_listener await task File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 133, in component_platform_discovered await self.async_setup_platform(platform, {}, info) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 222, in async_setup_platform platform = await async_prepare_setup_platform( File "/usr/src/homeassistant/homeassistant/setup.py", line 325, in async_prepare_setup_platform platform = integration.get_platform(domain) File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform cache[full_name] = self._import_platform(platform_name) File "/usr/src/homeassistant/homeassistant/loader.py", line 490, 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 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/config/custom_components/garbage_collection/sensor.py", line 7, in <module> import holidays File "/usr/local/lib/python3.8/site-packages/holidays/__init__.py", line 13, in <module> from holidays.countries import * File "/usr/local/lib/python3.8/site-packages/holidays/countries/__init__.py", line 45, in <module> from .israel import Israel, IL, ISR File "/usr/local/lib/python3.8/site-packages/holidays/countries/israel.py", line 15, in <module> from convertdate import gregorian, hebrew File "/usr/local/lib/python3.8/site-packages/convertdate/__init__.py", line 22, in <module> from . import bahai File "/usr/local/lib/python3.8/site-packages/convertdate/bahai.py", line 29, in <module> from pymeeus.Angle import Angle File "/usr/local/lib/python3.8/site-packages/pymeeus/Angle.py", line 23, in <module> from pymeeus.base import TOL ValueError: source code string cannot contain null bytes
Exception in discovery_platform_listener when dispatching 'discovery.platform_discovered_load_platform.sensor': ({'service': 'load_platform.sensor', 'platform': 'garbage_collection', 'discovered': OrderedDict([('name', 'Carta'), ('frequency', 'weekly'), ('collection_days', ['thu']), ('first_month', 'jan'), ('holiday_move_offset', 1), ('verbose_format', 'on {date}, in {days} days'), ('verbose_state', False), ('date_format', '%d-%b-%Y'), ('observed', True), ('icon_today', 'mdi:delete-restore'), ('offset', 0), ('hidden', False), ('period', 1), ('holiday_in_week_move', False), ('first_week', 1), ('icon_normal', 'mdi:trash-can'), ('last_month', 'dec'), ('icon_tomorrow', 'mdi:delete-circle')])},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/discovery.py", line 120, in discovery_platform_listener await task File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 133, in component_platform_discovered await self.async_setup_platform(platform, {}, info) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 222, in async_setup_platform platform = await async_prepare_setup_platform( File "/usr/src/homeassistant/homeassistant/setup.py", line 325, in async_prepare_setup_platform platform = integration.get_platform(domain) File "/usr/src/homeassistant/homeassistant/loader.py", line 485, in get_platform cache[full_name] = self._import_platform(platform_name) File "/usr/src/homeassistant/homeassistant/loader.py", line 490, 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 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/config/custom_components/garbage_collection/sensor.py", line 7, in <module> import holidays File "/usr/local/lib/python3.8/site-packages/holidays/__init__.py", line 13, in <module> from holidays.countries import * File "/usr/local/lib/python3.8/site-packages/holidays/countries/__init__.py", line 45, in <module> from .israel import Israel, IL, ISR File "/usr/local/lib/python3.8/site-packages/holidays/countries/israel.py", line 15, in <module> from convertdate import gregorian, hebrew File "/usr/local/lib/python3.8/site-packages/convertdate/__init__.py", line 22, in <module> from . import bahai File "/usr/local/lib/python3.8/site-packages/convertdate/bahai.py", line 29, in <module> from pymeeus.Angle import Angle File "/usr/local/lib/python3.8/site-packages/pymeeus/Angle.py", line 23, in <module> from pymeeus.base import TOL ValueError: source code string cannot contain null bytes

Screenshots

Version

Integration version: 3.17

Home Assistant version: 2021.4.1

bruxy70 commented 3 years ago

I have copied your configuration and it runs fine. I have the same version of HA and integration. image

It looks like some of the dependencies probably conflict with some other integration that you have. Possibly the holidays. Any idea what other integration might be using it?

damiano75 commented 3 years ago

Well, I have another integration that doesn't work: workday. So it seems my issues with your integration and workday integration are related to python-holidays, but this is an internal component of HA...

damiano75 commented 3 years ago

Fixed on 2021.4.2