Lurchi70 / ha-solvis-heating

Integrate your Solvis heating (e.g. SolvisMax) via solvis remote extension into home assistant
MIT License
5 stars 2 forks source link

HACS compatibility/Install PIP module in HA OS #1

Closed moster11 closed 1 year ago

moster11 commented 1 year ago

First of all - thank you so much for putting effort in making such an integration!

The integration states with a HACS badge that it is integrated in "HACS - Default" which I don't believe it actually is. "HACS - Default" should bring up the integration by just searching for it in HACS, but it doesn't show up there. Trying to add the repo as a custom repo doesn't work as well, as I always receive the error message that the repository structure is non compliant. The repository is missing basic stuff like the hacs.json file.

When trying to manually install the integration I also encounter problems. You state that the pypi package sc2xmlreader must be installed as a prerequisite. Installing Python packages via pip install is possible in Home Assistant Core, but not a valid option in Home Assistant OS, which I use. Pip install would have to manually been executed for the package after each update of Home Assistant - and there are monthly updates with multiple minor releases in between.

I am not an expert and have never created a custom component myself, but shouldn't there be a manifest.json file coming with the custom component which includes the python package as a dependency? This dependency should automatically get fetched by Home Assistant as I understand. See here.

Lurchi70 commented 1 year ago

Thank you for the feedback. I did not install it via HACS - may be it doesn't work proper. I'll check that and either will remove the tag until it works proper or fix this issue. Sorry for the unconvinience.
I've developed the custom component on my own development environment - and just copied it to my productive system.

If you want to get it running, just copy the content of the directory "custom-component/solvis_heating" into a directory "custom-component/solvis_heating" below your cofnig directory and restart home assistant. After this search for "solvis" in "Settings"->"Integrations"->"add integration".

Afaik, the missing pypi component will be installed automatically, when you select the solvis integration - in the mamifest.json the requirement is in. (if this does not work, you can just run a "pip install sc2xmlreader==0.1.2")

If you need more assistance, let me know. And i will update the code and try to get the issues solved.

moster11 commented 1 year ago

Amazing... now it works via HACS after I added it as a custom repo! You were right - the pypi component seemed to install itself without any issues.

I don't know what exactly went wrong, but I did have to reinstall and configure the component 4 times before it started to work. I always filled in the same vonfig details for IP, username, password. 3 times (one restart of HA in between) I always got this error message in the log. Can you read something out of it?

While the error message came up I was able to read the string out from URL http://192.168.50.90/sc2_val.xml in my browser.

Logger: homeassistant.config_entries Source: config_entries.py:947 First occurred: 22:16:58 (1 occurrences) Last logged: 22:16:58 Config entry 'Solvis Remote' for solvis_heating integration not ready yet: HTTPConnectionPool(host='http', port=80): Max retries exceeded with url: //192.168.50.90/sc2_val.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f58456e7610>: Failed to establish a new connection: [Errno -2] Name does not resolve')); Retrying in background

Lurchi70 commented 1 year ago

Cool. Always good that other people also have fun with this.

To your problem: url: //192.168.50.90/sc2_val.xml look not valid. this should be url: http://192.168.50.90/sc2_val.xml In the config dialog, you should enter only the ip adress '192.168.50.90'. I've checked this on a complete new HA installation (docker). It worked out of the box. I don't hope there are differences to the "OS-Version'.

Let me know, if this has helped.

moster11 commented 1 year ago

I wouldn't dare to remove the integration again to try this out. But I can assure you that I just entered the IP 192.168.50.90 in the config flow. Once I tried with http:// before, but that did not make a difference in the resulting error message. I really have no clue what went wrong, but the fourth time it just worked.

So far everything is running smoothly with just minor issues (will create a new issue for that). It is such a relief to finally be able to see my Solvis Max 6 in Home Assistant. I can't thank you enough for developing this integration!

Lurchi70 commented 1 year ago

Thank you for the feedback. Good to hear, that that it works. I'll close this issue. Between: I also struggle with the config options. It seems that the "configure" code does not save the changed values. It is a bit challanging to find out where the config values will be stored and to check if the given config is active or not.