SonnenladenGmbH / APsystems-EZ1-API-HomeAssistant

The APsystems EZ1 Integration offers a streamlined interface for interacting with the local API of APsystems EZ1 Microinverters using Home Assistant.
MIT License
77 stars 11 forks source link

Unable to prepare setup for platform apsystemsapi_local.sensor: Platform not found #15

Closed Nelson666 closed 3 months ago

Nelson666 commented 4 months ago

The HACS installation (2.0.1) are ok, but I have this error after a restart from HA. Note: This is my first installation of this plugin.

Logger: homeassistant.setup
Source: setup.py:379
First occurred: 14:29:28 (3 occurrences)
Last logged: 14:29:28

Unable to prepare setup for platform apsystemsapi_local.sensor: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
Unable to prepare setup for platform apsystemsapi_local.number: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
Unable to prepare setup for platform apsystemsapi_local.switch: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).
mawoka-myblock commented 4 months ago

Could you please tell me your HomeAssistant version?

Nelson666 commented 4 months ago

Sure, here are the versions.

Home Assistant 2023.8.3 Frontend 20230802.1 - latest

mawoka-myblock commented 4 months ago

Unfortunately I can't provide support for such an outdated version of Home Assistant. Please update HA and tell MSF of the issue persists.

Nelson666 commented 4 months ago

Ok, i update my HA installation and we will see.

Thank you

hmueller01 commented 2 months ago

I have to use Home Assistant 2023.7.3 on my Synology nas, as https://github.com/hgy59/spksrc/tree/master/spk/homeassistant/src doesn't support a newer version.

But if you replace

-from homeassistant.helpers.device_registry import DeviceInfo
+from homeassistant.helpers.entity import DeviceInfo

in sensor.py, switch.py, number.py it works.

mawoka-myblock commented 2 months ago

Keeping backwards compatibility isn't something I want to do, as the HA ecosystem seems to not care for that as well.

hmueller01 commented 2 months ago

Totally agreed. I just documented here how to solve the problem in case someone else needs it. Thanks for your work!

mawoka-myblock commented 2 months ago

No problem, also thank you for providing the solution!