lolouk44 / CurrentCost_HA_CC

CurrentCost Meter Reading Custom Component for Home Assistant
16 stars 7 forks source link

HA not loading currentcost module #21

Open marc252 opened 1 year ago

marc252 commented 1 year ago

name: Bug report about: Create a report to help us improve title: ''home assistant 2023.6.0 refuses to load currentcost component labels: bug assignees: ''


Describe the bug After updating home assistant, currentcost module doesn't work any more

To Reproduce Install currentcost under home assistant 2023.6.0, after adding platfform currentcost to configuration.yaml check configuration and the error will be generated

Desktop/Server/Device (please complete the following information):

Logs This error originated from a custom integration.

Logger: homeassistant.loader Source: custom_components/currentcost/sensor.py:7 Integration: currentcost (documentation, issues) First occurred: 21:47:16 (1 occurrences) Last logged: 21:47:16

Unexpected exception importing platform custom_components.currentcost.sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1206, in _gcd_import File "", line 1178, in _find_and_load File "", line 1149, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/config/custom_components/currentcost/sensor.py", line 7, in import serial_asyncio File "/usr/local/lib/python3.11/site-packages/serial_asyncio/init.py", line 408, in @asyncio.coroutine ^^^^^^^^^^^^^^^^^ AttributeError: module 'asyncio' has no attribute 'coroutine'

marc252 commented 1 year ago

Looks like modifying requirements in custom_components/currentcost/manifest.json from: "pyserial-asyncio==0.4", to "pyserial-asyncio==0.6",

Solves the issue

nacbooth commented 1 year ago

Same problem: the stated solution seems to have got things back in order (after a couple of restarts, as usual!).

Thanks for the tip.

DanielDomB commented 1 year ago

Yes thanks for the tip, that solved it

masxmedia commented 1 year ago

Was also having same problem and changing 'pyserial-asyncio==0.6' fixed it. Thank you!

Coooogz commented 1 year ago

This fix worked for me too thanks. Seems I needed a reboot after change was made.

PatrikNorrgard commented 1 year ago

I tried the fix aswell, but HA won´t let me restart: [140359694122896] The system cannot restart because the configuration is not valid: Platform error sensor.currentcost - Exception importing custom_components.currentcost.sensor

How did you manage to restart?

Edit: Forcing a restart from Proxmox did the job.

vw-kombi commented 1 year ago

Thanks heaps for this - I have no idea how you find out these answers but I am on the latest and working again.

ThePPL commented 8 months ago

Thanks @marc252. Your fix works great. I'm not sure why the commits by @HarvsG have not been merged and released. This caused me hours of headaches today trying to get this to work before I came across your post!

Maybe this project has been abandoned?

BertQuodge commented 4 months ago

Thanks for the tip, worked for me too.