jpcornil-git / HA-sma

SMA Sunny Webbox integration for Home Assistant
10 stars 5 forks source link

Error occurred loading flow #12

Closed CameronMease closed 9 months ago

CameronMease commented 9 months ago

I cannot get HA-sma working. I've tried both editing configuration.yml and adding in the GUI. Same results either way. The error log consists of the following:

2024-01-22 12:02:16.647 ERROR (MainThread) [homeassistant.config_entries] Error occurred loading flow for integration sma_webbox: cannot import name 'WEBBOX_PORT' from 'custom_components.sma_webbox.sma_webbox' (/config/custom_components/sma_webbox/sma_webbox/init.py)

If adding SMA Webbox from the GUI the popup displays (before entering any data):

error

My version of Home Assistant is 2024.1.4 and it is running in Docker, on Linux.

Thank you

jpcornil-git commented 9 months ago

Hi Cameron, Could you try to run the following command from your docker instance already and report results:

docker exec -it homeassistant /bin/bash
bash-5.1# python3 custom_components/sma_webbox/sma_webbox.py <webbox ip_address>

Cheers, jpc

CameronMease commented 9 months ago

Hello, JPC. Thank you for the quick response! Bash command works like a charm:

@.***

Regards, Cameron

jpcornil-git commented 9 months ago

OK, i.e. you see meaningful data logs I guess (was expected unless there was an issue with your hacs/custom_components install for some reasons or a webbox interop issue) => can you try with a 2023.12.3 test instances (version I'm currently running on) iso 2024.1.4 ?

If OK with the former but not the latter I'll investigate further.

CameronMease commented 9 months ago

That may take me a bit of time, but yes I will.

Thank you, Cameron

jpcornil-git commented 9 months ago

Hi Cameron, I did a fresh docker install using 2024.1.4, installed HACS within the container then this integration and I didn't saw any issue. I also upgraded my own HA to 2024.1.5 without issues either. How did you install the SMA Webbox component ? Could you also upload logs from the bash command above ? Cheers, jpc

CameronMease commented 9 months ago

I installed by copying the custom_components/sma_webbox directory to custom_components/web_box in my configuration directory.

Regards, Cameron

jpcornil-git commented 9 months ago

It should be sma_webbox (not web_box), that's why the import fails

├── custom_components
...
│   └── sma_webbox/
│       ├── config_flow.py
│       ├── const.py
│       ├── __init__.py
│       ├── manifest.json
│       ├── sensor.py
│       ├── sma_webbox.py
│       ├── strings.json
│       └── translations
│           ├── en.json
│           └── fr.json
...

You should consider to use HACS to manage component installation but also update from the UI

Cheers, jpc

CameronMease commented 9 months ago

I'm not sure why I wrote web_box. I actually did put it in sma_webbox. I removed this and installed HACS. Using HACS, the integration is now working.

Thank you, Cameron

jpcornil-git commented 9 months ago

Great to hear this and thanks for the feedback. Not sure then why it makes a difference (HACS is basically checking out a repo in custom_components as well) but as I said moving forward it will help you to manage this/other integrations more effectively. Cheers, jpc