homeassistant-growatt_server_api icon indicating copy to clipboard operation
homeassistant-growatt_server_api copied to clipboard

BUG - The integrattion doesn't work anymore after update of Home Assistant

Open slingshot74 opened this issue 2 years ago • 5 comments

Describe the bug The integration worked fine and I am really happy with it. Today I updated HA and it just found out the inegration doesn't work anymore. The account is not locked out. I think it might has something to do with the update?

To Reproduce Go to the integration and look at the values. The are unavailable

Growatt Device Type Device(s): Inverter

Home Assistant information

  • Home Assistant version: Core 2023.11.2 Supervisor 2023.11.0 Operating System 11.1 Frontend 20231030.2
  • Growatt Server API Integration version: v1.0.3 (I think)

Additional context Log dumo: Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:359 Integration: Sensor (documentation, issues) First occurred: 20:51:07 (1 occurrences) Last logged: 20:51:07

Error while setting up growatt_server_api platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/growatt_server_api/sensor.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.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/growatt_server_api/sensor.py", line 44, in get_device_list login_response = api.login(config[CONF_USERNAME], config[CONF_PASSWORD]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/growattServer/init.py", line 132, in login data = json.loads(response.content.decode('utf-8'))['back'] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/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)

slingshot74 avatar Nov 10 '23 20:11 slingshot74

This will have just been because you did a restart of home assistant nothing to do with the upgrade. When you restart home assistant or the integration it re-authenticates and generates a new cookie so it's probably that the API is blocking again or they've blocked your account. As I keep telling everyone - grott is the way to go here: https://github.com/muppet3000/homeassistant-grott

muppet3000 avatar Nov 10 '23 21:11 muppet3000

Hi @muppet3000 , Thanks for you reply. Unfortunaltly I run HA on a server which runs un HA OS. So no windows, so I can't run Grott if I believe to collect the data. Otherwise I would love to do that. I have no other windows server or something that is always online.

slingshot74 avatar Nov 12 '23 12:11 slingshot74

@slingshot74 No problem to install Grott in HAOS but then in my case https://github.com/muppet3000/homeassistant-grott/issues/62

Saentist avatar Nov 12 '23 18:11 Saentist

Oke so you don;t need a windows machine or run docker to host thhe python part to collect the data?

In the documentation here it says you need windows or linux to host grott https://github.com/johanmeijer/grott

slingshot74 avatar Nov 12 '23 19:11 slingshot74

@slingshot74 - I recently updated the documentation with steps on how to configure the grott 'addon' for HassOS users: https://github.com/muppet3000/homeassistant-grott/blob/main/docs/setup/grott.md#grott-add-on

I recommend reading through all of the 'prerequisites' documentation though: https://github.com/muppet3000/homeassistant-grott/blob/main/docs/prerequisites.md

muppet3000 avatar Nov 13 '23 16:11 muppet3000