hultenvp / solis-sensor

HomeAssistant integration for the SolisCloud PV Monitoring portal via SolisCloud API
Apache License 2.0
191 stars 42 forks source link

Error during setup of component solis #230

Closed TooBri closed 1 year ago

TooBri commented 1 year ago

Describe the bug Error during setup of component solis

Hi,

I am trying to add a solis inverter according to the solis sensor integration. The integration is installed via HACS. It are 2 inverters on one location. Both via soliscloud and ginlong the names of the inverters turn up, after filling in the initial details. Directly HA shows an error saying the integration cannot be loaded, and HA must be restarted. After restart, the underneath error turns up in the logs, the same for soliscloud and ginlong. Im wondering if there is anything I should change or adapt.

Versions HA Version an deployment: Home Assistant 2022.12.3 Supervisor 2022.11.2 Operating System 9.3

HACS version 1.28.4 Integration version 3.1.1.

Debug logs

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 253, in _async_setup_component result = await task File "/config/custom_components/solis/init.py", line 44, in async_setup if DOMAIN.lower() == entry["platform"]: TypeError: string indices must be integers

Screenshots If applicable, add screenshots to help explain your problem.

hultenvp commented 1 year ago

Hey @TooBri,

It almost looks like a malformed config.

If you know how to edit files you could remove the whole for-loop (line 43-53), restart and see what happens then. The code only throws a warning message if you did not yet remove your configuration from configuration.yaml, so not important.

TooBri commented 1 year ago

Hi @hultenvp,

thanks for your fast feedback, this seems to be the issue. After deleting the lines mentioned and restarting, both inverters and their entities show up. Tomorrow when the inverters come online I will check again if the vallues are coming trough as supposed, and will let you know :)

TooBri commented 1 year ago

Hi @hultenvp,

it worked like a charm, all values for both inverters coming trough as supposed. Thanks for your fast reply and support :)

hultenvp commented 1 year ago

Great! I'll catch the error in the new version so that you do not have to edit after every release ;-)

matthewbyrne commented 1 year ago

@hultenvp , i'm getting this after upgrading to HA 2023.3.6. Any thoughts?

hultenvp commented 1 year ago

Hi @matthewbyrne, not sure. Code should just ignore any issues. Can you post the logs?

matthewbyrne commented 1 year ago

@hultenvp , sorry, it magically fixed itself. 🤷