mbuchber / ha_heliotherm

Home Assistant Custom Component for Heliotherm Heatpumps
14 stars 5 forks source link

Enter config in YAML? #4

Closed partach closed 1 year ago

partach commented 1 year ago

Hi

First of all thanks for solving issue #3! Trying to test but am not able to. In first instance i installed this component manually. Later decided to go for HACS to more easily update new versions. Removed the manual installation completely and installed via HACS. Seems to work fine! But... I am not able to configure it anymore. When, after install in HACS and reboot you want to add the integration it generates:

Config flow could not be loaded: {"message":"Invalid handler specified"}

Seems no UI can be loaded to add the configuration. Any new coding on your side to be done? When searching for the error in google: seems to happen more often recently Question: Where and how to add the config manually via YAML directly? This is what is suggested to be done with the error. But no clue where to enter this manually (IP address and port). Any tips?

mbuchber commented 1 year ago

Hmm... are you on the latest version of Home Assistant? Yes, you can also specify config in configuration.yaml as:

ha_heliotherm:
  name: "My Heatpump"
  host: 192.168.0.183
  port: 502
partach commented 1 year ago

Yes am on the very last version of HA (i think) Home Assistant 2023.1.7 Supervisor 2023.01.1 Operating System 9.4 Frontend 20230110.0 - latest

Added to configuration.yaml your suggestion and restarted HA which brings an error: Error occurred loading configuration flow for integration ha_heliotherm: cannot import name 'ModbusTcpClient' from 'pymodbus.client' (/usr/local/lib/python3.10/site-packages/pymodbus/client/__init__.py) I remember i got this after i manually updated earlier and thought, let's go HACS. In the mean time in HACS also went from 1.0.7 to 1.0.9 of the HaHeliotherm which does not improve above error.

Do i need to rebuild something with python?

mbuchber commented 1 year ago

can you try to manually install pymodbus 3.1.0 with: pip install pymodbus==3.1.0

partach commented 1 year ago

Thanks. Seems more people experience modbus problems: https://github.com/home-assistant/core/issues/85869

Installed as suggested (can only happen via SSH add-on in root mode on VM which gives a warning about installing via PIP in that mode). Restart after install indicates new problem: ERROR: Setup failed for modbus: Unable to import component: No module named 'pymodbus.client.sync'. Could it be that pymodbus new version has new interface?

partach commented 1 year ago

After running latest core update of HA this morning (Operating System 9.5) the error is now: Setup failed for custom integration ha_heliotherm: Unable to import component: cannot import name 'ModbusTcpClient' from 'pymodbus.client' (/usr/local/lib/python3.10/site-packages/pymodbus/client/__init__.py)

mbuchber commented 1 year ago

now you should install with: pip install pymodbus==3.1.0

mbuchber commented 1 year ago

HA should install pymodbus 3.1.0 automatically when the component is initialized. This is somehow not happening - you should now install pymodbus yourself with: pip install pymodbus==3.1.0 Aftre rebooting HA it should work.

mbuchber commented 1 year ago

With the release of HA 2023.2, the pyModbus library was upgraded in https://github.com/home-assistant/core/pull/85961 , and that will resolve the version conflict.

partach commented 1 year ago

installed specifically 3.1.0 as stated. If i add haheliotherm to configuration.yaml i cannot restart:

Configuration invalid!

Component error: ha_heliotherm - cannot import name 'ModbusTcpClient' from 'pymodbus.client' (/usr/local/lib/python3.10/site-packages/pymodbus/client/__init__.py)

Alternatively the error of Config flow could not be loaded: {"message":"Invalid handler specified"} is still there if i try to add integration directly (not via config) via UI

mbuchber commented 1 year ago

Hmm... i have it up and running without any problems here - and also know others that have the component successfully installed. Maybe you have some version conflict with pymodbus library on your installation?

partach commented 1 year ago

It was due to home assistant. With the new update (2023.2.0) it is automatigically solved. Now all is working again. Can now also confirm issue #3 is solved on my end. Thanks and this one can be closed too!