DarwinsBuddy / WienerNetzeSmartmeter

A home-assistant integration supporting WienerNetze Smartmeters as sensors
143 stars 15 forks source link

Error with configuration flow (and manual configuration results in error on startup) #76

Closed simlin86 closed 1 year ago

simlin86 commented 1 year ago

I can not add the wnsm integration through configuration (error configration flow)

Logger: homeassistant.config_entries
Source: config_entries.py:712
First occurred: 12:19:56 PM (1 occurrences)
Last logged: 12:19:56 PM

Error occurred loading configuration flow for integration wnsm: cannot import name 'UnionType' from 'types' (/usr/local/lib/python3.9/types.py)

When I add it manually like the example configuration I get the following error on startup:

Logger: homeassistant.config
Source: custom_components/wnsm/sensor.py:12
Integration: wnsm (documentation, issues)
First occurred: 12:13:16 PM (1 occurrences)
Last logged: 12:13:16 PM

Platform error: sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 891, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 524, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 529, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/wnsm/sensor.py", line 12, in <module>
    from homeassistant.components.sensor import (
ImportError: cannot import name 'SensorDeviceClass' from 'homeassistant.components.sensor' (/usr/src/homeassistant/homeassistant/components/sensor/__init__.py)
DarwinsBuddy commented 1 year ago

which version of wnsm and which version of home assistant are you running?

simlin86 commented 1 year ago

Thanks for the quick reply! home assistant is running on debian 11 (details below) and wnsm version 1.0.3

System Health

version core-2021.9.7
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.0-21-amd64
arch x86_64
timezone Europe/Vienna
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4747 Installed Version | 1.24.5 Stage | running Available Repositories | 1247 Downloaded Repositories | 7
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Lovelace dashboards | 1 -- | -- resources | 6 views | 2 mode | storage
simlin86 commented 1 year ago

I updated to the newest home assistant version and now it seems to work. Thanks!

DarwinsBuddy commented 1 year ago

just wanted to give that advice :sweat_smile:

Have a nice week ;)