core: Error while setting up growatt_server platform for sensor

The problem

Growatt error in log again, also no data available,

reloading the integration (couple of times) works sometimes HA cant login in Growatt servers again?

What version of Home Assistant Core has the issue?

2023.2.3

What was the last working version of Home Assistant Core?

2023.2.3

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?

Logger: homeassistant.components.sensor
Source: components/growatt_server/sensor.py:56
Integration: Sensor (documentation, issues)
First occurred: 12:00:09 (2 occurrences)
Last logged: 12:00:34

Error while setting up growatt_server platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 293, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor.py", line 87, in async_setup_entry
    devices, plant_id = await hass.async_add_executor_job(get_device_list, api, config)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/growatt_server/sensor.py", line 56, in get_device_list
    devices = api.device_list(plant_id)
  File "/usr/local/lib/python3.10/site-packages/growattServer/__init__.py", line 516, in device_list
    return self.plant_info(plant_id)['deviceList']
  File "/usr/local/lib/python3.10/site-packages/growattServer/__init__.py", line 529, in plant_info
    data = json.loads(response.content.decode('utf-8'))
  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)

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 26 (12 by maintainers)

Most upvoted comments

Because this is not possible via WebGUI maybe a stupid question, but how or where can I change the server URL manually back from https://server-api.growatt.com/ to https://server.growatt.com/? What is the name und path to the file? Thanks.

You have to hack it in the python code. It’s not recommended unless you really know what you’re doing, even then it’s probably still against the usage guides and it’s wrong for me to suggest it.

I have been warned in the past about directing people towards the HACS/custom_component version of this Integration which I very much consider as the “upstream” version of this integration. However, if you happened to find that and installed it (and accepted the risk of running a custom component in Home Assistant) then the current ‘dev’ build of it contains the ability to select this from the UI.

I will likely get in trouble again for directing people towards it (hence why I haven’t provided a link to it), however, given the continued instabilities with this Integration and the Growatt Servers, I can’t see me bundling up the changes and getting them into HA Core any time soon.

I will be making efforts over the coming weeks to formally remove this integration from HA Core and direct people either towards the HACS version of it (which I’m also trying to deprecate) or, even better, the Grott implementation which is infinitely more stable: https://github.com/muppet3000/homeassistant-grott

Speaking with Growatt (via their WhatApp, in Australia) and they’ve were performing server maintenance. They had me do the password reset, and the app was the only thing locking me out. Web no issue.

But the did say following “Please ensure your internet environment is secure, and do not use python, java or other programming to draw data from our website”

So they are actively blocking it now, I’m sure. Also cannot even setup the integration as it’s blocking with error [KeyError: ‘user’]. Worse is that they used to have an active API https://growatt.pl/wp-content/uploads/2020/01/Growatt-Server-API-Guide.pdf

If it’s getting on your nerves imagine what it’s doing to mine trying to support this Integration!! 😋

I can’t remember the precise path to the file you need to modify, plus it changes depending on your installation.

If you wanted to reach out to me via email, my address is on my GitHub page and I can discuss options further.