davidrapan / ha-solarman

⚡ Solarman Stick Logger integration for 🏠 Home Assistant
MIT License
115 stars 25 forks source link

Cannot connect to inverter using domain #62

Closed hechay closed 3 months ago

hechay commented 3 months ago

Logger: homeassistant.config_entries Source: config_entries.py:586 First occurred: 5:42:07 AM (1 occurrences) Last logged: 5:42:07 AM

Error setting up entry SolarBK-DEYE-Domain for solarman Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/solarman/init.py", line 39, in async_setup_entry if IPv4Address(inverter_host).is_private: ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ipaddress.py", line 1319, in init self._ip = self._ip_int_from_string(addr_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ipaddress.py", line 1206, in _ip_int_from_string raise AddressValueError("Expected 4 octets in %r" % ip_str) ipaddress.AddressValueError: Expected 4 octets in 'mydomain.net'

I hope you can develope the new function that connect to inverter via domain name.

Thanks a lot!

davidrapan commented 3 months ago

Hi @hechay, fix: Could not use with domain name instead of IP

hechay commented 3 months ago

Great. I'll test and let your know immediately

hechay commented 3 months ago

Work great!