Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Growatt timeout - Error while setting up growatt_server platform for sensor: 'user' #141357

Open
EvgenyZ89 opened this issue Mar 25, 2025 · 9 comments

Comments

@EvgenyZ89
Copy link

The problem

Hello
I created a new user in Growatt - this user prescribed an integration - everything worked excellently as an apot received a user block for 24 hours
Perhaps the plugin sends many requests?
Here is the error code
(I have 2 inverters)

Error while setting up growatt_server platform for sensor: 'user'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in _async_setup_platform
await asyncio.shield(awaitable)
File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/init.py", line 88, in async_setup_entry
devices, plant_id = await hass.async_add_executor_job(get_device_list, api, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/init.py", line 51, in get_device_list
user_id = login_response["user"]["id"]
~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'user'

Image

What version of Home Assistant Core has the issue?

core-2025.3.4

What was the last working version of Home Assistant Core?

never

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

rror while setting up growatt_server platform for sensor: 'user'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in _async_setup_platform
await asyncio.shield(awaitable)
File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/init.py", line 88, in async_setup_entry
devices, plant_id = await hass.async_add_executor_job(get_device_list, api, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/init.py", line 51, in get_device_list
user_id = login_response["user"]["id"]
~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'user'

Image

Example YAML snippet

025-03-25 11:23:08.976 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up growatt_server platform for sensor: 'user'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/__init__.py", line 88, in async_setup_entry
    devices, plant_id = await hass.async_add_executor_job(get_device_list, api, config)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/__init__.py", line 51, in get_device_list
    user_id = login_response["user"]["id"]
              ~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'user'
2025-03-25 11:23:08.984 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up growatt_server platform for sensor: 'user'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/__init__.py", line 88, in async_setup_entry
    devices, plant_id = await hass.async_add_executor_job(get_device_list, api, config)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/__init__.py", line 51, in get_device_list
    user_id = login_response["user"]["id"]
              ~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'user'

Anything in the logs that might be useful for us?

Additional information

No response

@home-assistant
Copy link

@foxdj12
Copy link

foxdj12 commented Mar 28, 2025

Hi, i got the same error. Shine app is working correctly.

@thomas-hass
Copy link

Same here.

Mar 29 21:13:30 home-assistant homeassistant[761]: 2025-03-29 21:13:30.791 ERROR (MainThread) [aiohttp.server] Error handling request from 192.168.3.36
Mar 29 21:13:30 home-assistant homeassistant[761]: Traceback (most recent call last):
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
Mar 29 21:13:30 home-assistant homeassistant[761]: resp = await request_handler(request)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
Mar 29 21:13:30 home-assistant homeassistant[761]: return await handler(request)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
Mar 29 21:13:30 home-assistant homeassistant[761]: return await handler(request)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
Mar 29 21:13:30 home-assistant homeassistant[761]: return await handler(request)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
Mar 29 21:13:30 home-assistant homeassistant[761]: return await handler(request)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
Mar 29 21:13:30 home-assistant homeassistant[761]: return await handler(request)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
Mar 29 21:13:30 home-assistant homeassistant[761]: return await handler(request)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
Mar 29 21:13:30 home-assistant homeassistant[761]: return await handler(request)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
Mar 29 21:13:30 home-assistant homeassistant[761]: response = await handler(request)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
Mar 29 21:13:30 home-assistant homeassistant[761]: result = await handler(request, **request.match_info)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
Mar 29 21:13:30 home-assistant homeassistant[761]: return await func(self, request, *args, **kwargs)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 232, in post
Mar 29 21:13:30 home-assistant homeassistant[761]: return await super().post(request, flow_id)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
Mar 29 21:13:30 home-assistant homeassistant[761]: return await method(view, request, data, *args, **kwargs)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 121, in post
Mar 29 21:13:30 home-assistant homeassistant[761]: result = await self._flow_mgr.async_configure(flow_id, data)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 340, in async_configure
Mar 29 21:13:30 home-assistant homeassistant[761]: result = await self._async_configure(flow_id, user_input)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 387, in _async_configure
Mar 29 21:13:30 home-assistant homeassistant[761]: result = await self._async_handle_step(
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: flow, cur_step["step_id"], user_input
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: )
Mar 29 21:13:30 home-assistant homeassistant[761]: ^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 490, in _async_handle_step
Mar 29 21:13:30 home-assistant homeassistant[761]: result: _FlowResultT = await getattr(flow, method)(user_input)
Mar 29 21:13:30 home-assistant homeassistant[761]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: File "/usr/src/homeassistant/homeassistant/components/growatt_server/config_flow.py", line 69, in async_step_user
Mar 29 21:13:30 home-assistant homeassistant[761]: self.user_id = login_response["user"]["id"]
Mar 29 21:13:30 home-assistant homeassistant[761]: ~~~~~~~~~~~~~~^^^^^^^^
Mar 29 21:13:30 home-assistant homeassistant[761]: KeyError: 'user'

@Schuumstra
Copy link

Same here, since a couple of day. Switching off the Growatt integration allows me to log on to the app and web interface without the message that my account has been blocked for 24 hours. The integration with HomeWizard also was not working. With the integration switched off in HA, all three (HomeWizard integration, the app and web interface) are working fine.

It looks like the HA integration sends to many requests...

@thomas-hass
Copy link

Solved now. It was my container that restarted several times because of an other error. Then I got locked out because of to many requests.

@knoepfchendruecker
Copy link

Short story: After multiple attempts, I finally removed the configuration, re-added the same configuration - instantly entities became available with proper values.

Long story: last night, my HA instance (core-2025.4.1 running on HAOS 15.1) started misbehaving as well in the same way after restart HA (due to a config change). Rebooting the HAOS-instance didn't help as well, temporarily disabling any kind of activity towards Growatt's servers (disabling both growatt_server and noah2mqtt running at a 300-second-polling interval) before re-enabling growatt_server didn't help as well.

2025-04-07 19:15:58.545 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up growatt_server platform for sensor: 'user'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in _async_setup_platform
await asyncio.shield(awaitable)
File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/init.py", line 88, in async_setup_entry
devices, plant_id = await hass.async_add_executor_job(get_device_list, api, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor/init.py", line 51, in get_device_list
user_id = login_response["user"]["id"]
~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'user'
2025-04-07 19:17:33.166 DEBUG (SyncWorker_1) [homeassistant.components.growatt_server.sensor] Updating data for (total)
2025-04-07 19:17:33.430 DEBUG (SyncWorker_1) [homeassistant.components.growatt_server.sensor] Finished updating data for (total)
2025-04-07 19:17:33.433 DEBUG (MainThread) [homeassistant.components.growatt_server.sensor] Data request for: UndefinedType._singleton
[...]
2025-04-07 19:17:33.608 DEBUG (SyncWorker_0) [homeassistant.components.growatt_server.sensor] Updating data for (tlx)
2025-04-07 19:17:33.717 DEBUG (SyncWorker_0) [homeassistant.components.growatt_server.sensor] Finished updating data for (tlx)
2025-04-07 19:17:33.723 DEBUG (MainThread) [homeassistant.components.growatt_server.sensor] Data request for: UndefinedType._singleton
[...]

Out of curiosity, I also temporarily disabled any growatt-related services and restarted them a few minutes after a full restart of HA (to wait until everything has settled after startup) - this didn't help as well.

After multiple attempts, I finally removed the configuration, re-added the same configuration: and instantly entities started working again.

@erlendoyen
Copy link

my account is stil getting locked out.

i used homey before with that homey integration, that stopped working months back, but now it seems that growatt has taken new measures to block data retrieval unless you have an agreement with them like some utility providers etc.

what server address did you use?

@knoepfchendruecker
Copy link

I‘m located in Europe and use the corresponding default (openapi.growatt.com). Maybe some of us are affected by different issues that still share the same symptoms.

Recreating the configuration did work for me, but won’t work if your account is really locked or requests from your IP are temporarily rejected by Growatt’s Web Application Firewall.

Those WAF-related responses may also cause a “failure to login”-symptom, though the actual account is possibly not locked and the exact error message is different from an actually locked account.

@erlendoyen
Copy link

erlendoyen commented Apr 7, 2025

i get the locked out message in shinephone 5-6 hours ago
i disabled the growatt addin in HA 2-4 hours ago

when i enabled it now 22:35 it started working again, did not have to remove and re-add.

i also logged back into shinephone.

they are just taking more and more measures to block everyone without a agreement to retrieve data.
tibber in Norway is getting data from them so they must have an agrement with them

i have asked tibber if they could expose this data in their api, but last time i asked them they would not do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants