muppet3000 / homeassistant-growatt_server_api

Home Assistant Integration for Growatt - Upstream repo for the growatt_server integration that is part of the Core Home Assistant repository
MIT License
54 stars 7 forks source link

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

Open slingshot74 opened 1 year ago

slingshot74 commented 1 year ago

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

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)

muppet3000 commented 1 year ago

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

slingshot74 commented 1 year ago

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.

Saentist commented 1 year ago

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

slingshot74 commented 1 year ago

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

muppet3000 commented 1 year ago

@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