home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.81k stars 30.9k forks source link

Growatt server connection #83919

Closed carloalbertorossi closed 1 year ago

carloalbertorossi commented 1 year ago

The problem

At the installation of the Growatt server integration, I can't connect, the message is -Unknown error occurred- following the log

Logger: aiohttp.server Source: components/growatt_server/config_flow.py:50 First occurred: 11 dicembre 2022 19:04:50 (14 occurrences) Last logged: 08:37:22

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 82, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, *args, *kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 280, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/growatt_server/config_flow.py", line 50, in async_step_user login_response = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/growattServer/init.py", line 121, in login data = json.loads(response.content.decode('utf-8'))['back'] File "/usr/local/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

What version of Home Assistant Core has the issue?

2022.12.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

growatt server

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

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

Code owner commands Code owners of `growatt_server` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign growatt_server` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


growatt_server documentation growatt_server source (message by IssueLinks)

muppet3000 commented 1 year ago

Could you please let me know what type of Growatt system you have by logging into the growatt server and sending me a screen grab of this section: image

If there are multiple types in the drop-down please can you send a list/screengrab of all of them?

We do not yet have support for all of the system types so it may be that your system isn't supported yet.

carloalbertorossi commented 1 year ago

immagine

muppet3000 commented 1 year ago

Thanks @carloalbertorossi looking through the code we do have support for that system. The only way I can really debug this any further is if you're willing to share your credentials with me so that I can try and log in myself and track down where the error is coming from. If you're happy to do that (I know it's placing a lot of trust in me) then please email me (my contact information is on my github page).

dynamite9585 commented 1 year ago

Hi @muppet3000 I seem to have the exact same issue.

Disregard, All working again after HA update

Hr46ph commented 1 year ago

Unfortunately I am running into the issue too. I just installed HA onto a rPi 3 and configured different integrations for electricity, gas and water meters. When trying to install the Growatt integration I get the unknown error. Using different urls doesn't work (auth failure). I tried logging into the website directly and that works fine. I also changed my password to remove special characters to rule that out.

Any ideas?

Thanks!

Log file:

Logger: aiohttp.server
Source: components/growatt_server/config_flow.py:50
First occurred: 11:00:21 AM (5 occurrences)
Last logged: 11:07:47 AM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
    result = await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 281, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/growatt_server/config_flow.py", line 50, in async_step_user
    login_response = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/growattServer/__init__.py", line 132, in login
    data = json.loads(response.content.decode('utf-8'))['back']
  File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
pieterpalmers commented 1 year ago

I have the same error, and it is caused by the response given by the server:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html>
<head><title>403 Forbidden</title></head>
<body><h1>403 Forbidden</h1>
<p>You don't have permission to access the URL on this server.</p>
<p>denied by UA ACL = blacklist</p>
<hr/>Powered by Tengine <br/>
CDN Request Id: 2ff6309c16723144292044373e</body></html>
Hr46ph commented 1 year ago

Will/might be fixed with #84628

muppet3000 commented 1 year ago

@pieterpalmers @Hr46ph - The current issue that you're seeing is related to this: https://github.com/home-assistant/core/issues/84600 Not related to this issue.

Schelin78 commented 1 year ago

Problem again with HA growatt. Restarted many times but did not work. Reinstall and now I cant login šŸ¤”

Logger: aiohttp.server Source: components/growatt_server/config_flow.py:50 First occurred: 11:13:28 (25 occurrences) Last logged: 11:18:59

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, *args, *kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 281, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/growatt_server/config_flow.py", line 50, in async_step_user login_response = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/growattServer/init.py", line 132, in login data = json.loads(response.content.decode('utf-8'))['back'] File "/usr/local/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

muppet3000 commented 1 year ago

Problem again with HA growatt. Restarted many times but did not work. Reinstall and now I cant login šŸ¤”

Logger: aiohttp.server Source: components/growatt_server/config_flow.py:50 First occurred: 11:13:28 (25 occurrences) Last logged: 11:18:59

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, *args, *kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 281, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/growatt_server/config_flow.py", line 50, in async_step_user login_response = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, self.kwargs) File "/usr/local/lib/python3.10/site-packages/growattServer/init.py", line 132, in login data = json.loads(response.content.decode('utf-8'))['back'] File "/usr/local/lib/python3.10/json/init**.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Have you tried updating to the latest beta that was released yesterday which fixed the bug that's causing this issues? See #84600 for more info

Hr46ph commented 1 year ago

Have you tried updating to the latest beta that was released yesterday which fixed the bug that's causing this issues? See #84600 for more info

I have and its working again.

Thanks!

sccssf commented 1 year ago

Have you tried updating to the latest beta that was released yesterday which fixed the bug that's causing this issues? See https://github.com/home-assistant/core/issues/84600 for more info

I have and its working again.

Gillies49 commented 1 year ago

Hi. I am aware of the fix #84628 for growatt integration that requires changes to a couple of files but I am unable to locate the GrowattServer folder to access the files.. Using home assistant os on windows 10 virtual box. Can someone advise..

muppet3000 commented 1 year ago

Hi. I am aware of the fix #84628 for growatt integration that requires changes to a couple of files but I am unable to locate the GrowattServer folder to access the files.. Using home assistant os on windows 10 virtual box. Can someone advise..

Just upgrade to the latest beta release from yesterday

Gillies49 commented 1 year ago

Hi. I am aware of the fix #84628 for growatt integration that requires changes to a couple of files but I am unable to locate the GrowattServer folder to access the files.. Using home assistant os on windows 10 virtual box. Can someone advise..

Just upgrade to the latest beta release from yesterday

Thanks for help, it worked.

Schelin78 commented 1 year ago

Thanks but will wait for official release. Guess next week šŸ™

Coooogz commented 1 year ago

Since 30th December I am not even getting my data to upload to Growatt, can't see it in app or on website.. Anyone else having the same issue? Did not change anything my side..

Schelin78 commented 1 year ago

Updated to 2022.12.9, but still problems

Logger: aiohttp.server Source: components/growatt_server/config_flow.py:50 First occurred: 10:02:04 (48 occurrences) Last logged: 12:06:55

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, *args, *kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 281, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/growatt_server/config_flow.py", line 50, in async_step_user login_response = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/growattServer/init.py", line 132, in login data = json.loads(response.content.decode('utf-8'))['back'] File "/usr/local/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

carloalbertorossi commented 1 year ago

same error

Logger: aiohttp.server Source: components/growatt_server/config_flow.py:50 First occurred: 2 gennaio 2023 11:16:28 (5 occurrences) Last logged: 14:11:36

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, *args, *kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 281, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/growatt_server/config_flow.py", line 50, in async_step_user login_response = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/growattServer/init.py", line 132, in login data = json.loads(response.content.decode('utf-8'))['back'] File "/usr/local/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

startingLate commented 1 year ago

Same problem ... just tried add my Growatt system to Home Assistant and get a message "Unknown error occurred".

image
Schelin78 commented 1 year ago

Same login problem for me

muppet3000 commented 1 year ago

As I've said multiple times already, you need to take the latest beta release of Home Assistant to get the fix for this, the latest "2022.12" release doesn't include it.

Over the next week or so I'm going to start moving this integration out of HA and into a community plugin so that fixes can be delivered quicker for this issue in the future

Schelin78 commented 1 year ago

Installed beta, sadly now I have to reinstall a backup. Cant connect anymore. beta is very beta šŸ˜Š

Coooogz commented 1 year ago

Installed 2023.1.0 and back up and running. (my issue mentioned above was unrelated and resolved itself eventually)

muppet3000 commented 1 year ago

Thanks for confirming @Coooogz

I'll close this ticket at the end of the day once I've seen no more updates from people.

Schelin78 commented 1 year ago

Installed 2023.1.0 and back up and running. (my issue mentioned above was unrelated and resolved itself eventually)

After install it works fine šŸ‘

carloalbertorossi commented 1 year ago

Thanks for develope this addon, I have one question: I can't find the entity "import from grid" can you help me? Thanks in advance

Il giorno gio 5 gen 2023 alle ore 11:52 Schelin78 @.***> ha scritto:

Installed 2023.1.0 and back up and running. (my issue mentioned above was unrelated and resolved itself eventually)

After install it works fine šŸ‘

ā€” Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/83919#issuecomment-1372062681, or unsubscribe https://github.com/notifications/unsubscribe-auth/A26PQWXMY7QKWAOV635YQJDWQ2RXNANCNFSM6AAAAAAS5BRNZQ . You are receiving this because you were mentioned.Message ID: @.***>

frenck commented 1 year ago

Considering this issue is solved, I'll go ahead and close this issue.

../Frenck