Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HA not loading currentcost module #21

Open
marc252 opened this issue Jun 8, 2023 · 9 comments
Open

HA not loading currentcost module #21

marc252 opened this issue Jun 8, 2023 · 9 comments

Comments

@marc252
Copy link

marc252 commented Jun 8, 2023


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

  • Device used to run the Custom Component Raspberry pi
  • Method of installation HACS
  • Version of the Custom Component installed? 0.2.4

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
Copy link
Author

marc252 commented Jun 9, 2023

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

Solves the issue

@nacbooth
Copy link

nacbooth commented Jun 9, 2023

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
Copy link

Yes thanks for the tip, that solved it

@masxmedia
Copy link

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

@Coooogz
Copy link

Coooogz commented Jun 19, 2023

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

HarvsG added a commit to HarvsG/CurrentCost_HA_CC that referenced this issue Jun 29, 2023
@HarvsG HarvsG mentioned this issue Jun 29, 2023
@PatrikNorrgard
Copy link

PatrikNorrgard commented Jul 5, 2023

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
Copy link

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

@ThePPL
Copy link

ThePPL commented Dec 31, 2023

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
Copy link

Thanks for the tip, worked for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants