core icon indicating copy to clipboard operation
core copied to clipboard

Problem with the Solax integration

Open tarrinho opened this issue 1 year ago • 8 comments

The problem

I'm having an issue with the solax integration: I'm able to connect to solax (http://ip/api/realTimeData.htm - error code 200), but when I try to add the device in the Integration part (SolaX Power), I receive the note that it doesn't work (Unexpected error). So I decided to had a reverse proxy (Apache), and what I see is: "GET /api/realTimeData.htm HTTP/1.1" 503 506 "-" "Python/3.12 aiohttp/3.9.3"

What version of Home Assistant Core has the issue?

core-2024.3.1

What was the last working version of Home Assistant Core?

not sure, but 1 year ago, it was working

What type of installation are you running?

Home Assistant OS

Integration causing the issue

SolaX Power

Link to integration documentation on our website

https://www.home-assistant.io/integrations/solax

Diagnostics information

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1120, in create_connection raise exceptions[0] File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1102, in create_connection sock = await self._connect_sock( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1005, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 641, in sock_connect return await fut ^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 681, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') ConnectionRefusedError: [Errno 111] Connect call failed ('<solax IP>', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/solax/inverter.py", line 61, in get_data data = await self.make_request() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/solax/inverter.py", line 75, in make_request raw_response = await self.http_client.request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/solax/inverter_http_client.py", line 56, in request return await self.get() ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/solax/inverter_http_client.py", line 61, in get async with session.get(url, headers=self.headers) as req: File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1194, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 578, in _request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 911, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1235, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection transp, proto = await self._wrap_create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1000, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host <solax IP>:80 ssl:default [Connect call failed ('192.168.2.5', 80)]

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/solax/config_flow.py", line 56, in async_step_user serial_number = await validate_api(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/solax/config_flow.py", line 38, in validate_api response = await api.get_data() ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/solax/init.py", line 50, in get_data return await rt_request(self.inverter, 3) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/solax/init.py", line 26, in rt_request return await inv.get_data() ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/solax/inverter.py", line 64, in get_data raise InverterError(msg, str(self.class.name)) from ex solax.inverter.InverterError: ('Could not connect to inverter endpoint', 'XHybrid')

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

tarrinho avatar Mar 17 '24 18:03 tarrinho

Hey there @squishykid, mind taking a look at this issue as it has been labeled with an integration (solax) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of solax can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign solax Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


solax documentation solax source (message by IssueLinks)

home-assistant[bot] avatar Mar 17 '24 18:03 home-assistant[bot]

Hello, any news? Is there any other information that I can supply that would help? Thanks

tarrinho avatar Apr 16 '24 17:04 tarrinho

Hello Robin (@squishykid ),

did this integration stop working?

Thanks, Pedro

tarrinho avatar May 01 '24 15:05 tarrinho

2024.5.0 has solax 3.1.0 which improves the discovery process by, among other things, consolidating identical requests.

The version of the library in your older HA instance could very well have spammed the inverter to the point it becomes unresponsive for a bit.

Consider updating, or creating a test instance with 2024.5.0 and see if that helps.

Darsstar avatar May 02 '24 15:05 Darsstar

Did the upgrade: image

Same error: image

tarrinho avatar May 03 '24 09:05 tarrinho

Same error as tarrinho. Would be grateful for a fix?

dretful avatar Jun 22 '24 11:06 dretful

should be fixed with https://github.com/home-assistant/core/pull/115129

lstolcman avatar Jul 11 '24 18:07 lstolcman

should be fixed with #115129

Same problem here why #115129 was closed? muppets.

japeral avatar Oct 08 '24 10:10 japeral

i get in home-assistent.log a

WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.solax_srxn47sqgg_daily_yield (<class 'homeassistant.components.solax.sensor.InverterSensorEntity'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total', 'total_increasing'; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+solax%22

what can i do?

clevermarketing avatar Nov 11 '24 11:11 clevermarketing

Did the upgrade: image

Same error: image

I got it after the last update solax cloud. you can find the password under: Devices - "your Inverter" - klick the tree points and Backup password. That`s the password you need and the correct IP of course. port 80 is ok.

harry051266 avatar Nov 27 '24 19:11 harry051266

Same problem, won't connect to X1-Hybrid-G3

JoeleJB avatar Jan 15 '25 08:01 JoeleJB

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.