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 Server - Can not add integration #84184

Closed
parhedberg opened this issue Dec 18, 2022 · 16 comments
Closed

Growatt Server - Can not add integration #84184

parhedberg opened this issue Dec 18, 2022 · 16 comments

Comments

@parhedberg
Copy link

The problem

When trying to add integration i get the following error.

I have used the integration before, but since a while it does not work, so I tried to remove and reinstall the integration and got this error.

My username for growatt is "Par Hedberg" (with a space between names) and maybe that is a problem for the integration?

What version of Home Assistant Core has the issue?

2022.12.7

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

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

`Logger: aiohttp.server
Source: custom_components/growatt_server/config_flow.py:50
Integration: Growatt Server
First occurred: 13:37:42 (1 occurrences)
Last logged: 13:37:42

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 222, 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/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 "/config/custom_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 119, 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)`

Additional information

No response

@home-assistant
Copy link

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)

@BobC76
Copy link

BobC76 commented Dec 19, 2022

I see the same error, attempting to install into Home Assistant Core

@muppet3000
Copy link
Contributor

Hi Guys,

Would those of you that are experiencing this consider sending me your credentials so that I can attempt to debug it locally?
If you're willing to share your credentials, please email me with them, my email address is on my Github page.

NOTE - Today/Tonight is the last chance I have to work on this integration until after the Christmas break as I'm taking some time out to be with my family.
If I don't get it looked at/fixed today then I can assure you it will be at the top of the list when I pick things up again next year.

@parhedberg
Copy link
Author

You got mail!

@BobC76
Copy link

BobC76 commented Dec 20, 2022 via email

@muppet3000
Copy link
Contributor

Hi, Sorry, mine isnt accessible outside the home at the moment so that won't help you. I have limited experience setting this up as just started with HA. I should point out also my installation is an older version of 'core' via a package built for Synology NAS devices that don't support docker (e.g. my ds215j) over on Synocommunity https://github.com/SynoCommunity/spksrc/wiki/FAQ-HomeAssistant/ Some other integrations do work but there are limitations of that environment as it's not a full Linux environment. I got the growatt integration working fine on a more recent version of HA os I installed on a laptop VM. My guess is it's a question of the dependencies it needs which may have to be installed separately in my case. Happy to have a go at trying anything to help but appreciate I'm in an unsupported env. Just thought it worth noting it occurred elsewhere. Cheers Bob

On Tue, 20 Dec 2022, 07:43 Chris Straffon, @.> wrote: Hi Guys, Would those of you that are experiencing this consider sending me your credentials so that I can attempt to debug it locally? If you're willing to share your credentials, please email me with them, my email address is on my Github page. NOTE - Today/Tonight is the last chance I have to work on this integration until after the Christmas break as I'm taking some time out to be with my family. If I don't get it looked at/fixed today then I can assure you it will be at the top of the list when I pick things up again next year. — Reply to this email directly, view it on GitHub <#84184 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZRUFYLS7HFILL3BONCGU3WOFPS3ANCNFSM6AAAAAATCQGA54 . You are receiving this because you commented.Message ID: @.>

I was referring to the credentials you use to sign in to Growatt, I don't need access to your Home Assistant instance, I just need to replicate the issue on my local system with your credentials in order to see what's going wrong.

@BobC76
Copy link

BobC76 commented Dec 20, 2022 via email

@muppet3000
Copy link
Contributor

Ahh I see, well I have the same growatt integration to the same growatt server/system working fine on another installation of HA OS. So at least in my case it looks to be about the step of installing the integration into HA Core as it is running on my Synology ds215j NAS, in the special way they built it to be able to load under Synology's package installer (e.g. this is at v2021.9.7). I was just hoping that if a fix can be found to this on a more supported installation I could work out if that can be ported into mine. But I'll send you them in case. On Tue, 20 Dec 2022 at 08:56, Chris Straffon @.> wrote:

Hi, Sorry, mine isnt accessible outside the home at the moment so that won't help you. I have limited experience setting this up as just started with HA. I should point out also my installation is an older version of 'core' via a package built for Synology NAS devices that don't support docker (e.g. my ds215j) over on Synocommunity https://github.com/SynoCommunity/spksrc/wiki/FAQ-HomeAssistant/ Some other integrations do work but there are limitations of that environment as it's not a full Linux environment. I got the growatt integration working fine on a more recent version of HA os I installed on a laptop VM. My guess is it's a question of the dependencies it needs which may have to be installed separately in my case. Happy to have a go at trying anything to help but appreciate I'm in an unsupported env. Just thought it worth noting it occurred elsewhere. Cheers Bob … <#m_3631459610222402536_> On Tue, 20 Dec 2022, 07:43 Chris Straffon, @.
> wrote: Hi Guys, Would those of you that are experiencing this consider sending me your credentials so that I can attempt to debug it locally? If you're willing to share your credentials, please email me with them, my email address is on my Github page. NOTE - Today/Tonight is the last chance I have to work on this integration until after the Christmas break as I'm taking some time out to be with my family. If I don't get it looked at/fixed today then I can assure you it will be at the top of the list when I pick things up again next year. — Reply to this email directly, view it on GitHub <#84184 (comment) <#84184 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZRUFYLS7HFILL3BONCGU3WOFPS3ANCNFSM6AAAAAATCQGA54 https://github.com/notifications/unsubscribe-auth/AHZRUFYLS7HFILL3BONCGU3WOFPS3ANCNFSM6AAAAAATCQGA54 . You are receiving this because you commented.Message ID: @.
> I was referring to the credentials you use to sign in to Growatt, I don't need access to your Home Assistant instance, I just need to replicate the issue on my local system with your credentials in order to see what's going wrong. — Reply to this email directly, view it on GitHub <#84184 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHZRUFZJCCUEU6577XDC7QLWOFYD7ANCNFSM6AAAAAATCQGA54 . You are receiving this because you commented.Message ID: @.
**>

In which case this is almost certainly related to the fact you're using an old version of Home-Assistant, there have been issues this year with changes to the API which requires a user-agent field to be provided, as such you need to be using 2022.12.1 or higher of Home Assistant.

If you want to try and 'hack it' there is some documentation here on how to do it for Docker: #80950 (comment) if you follow further through the comments there is help on how to do it for other types of installations.

@BobC76
Copy link

BobC76 commented Dec 20, 2022

Thanks, I'll take a look. There's a pull request pending to update the Syno package to a more recent HA version but its not up to that recent. Starting to feel like its not worth my time fighting with the ds215 vs shelling out for some dedicated hw that can run a more supported version!

@muppet3000
Copy link
Contributor

Can I advise anyone that believes they are experiencing this issue to ensure they are testing against 2022.12.1 version of HA or higher and report back if it's still an issue.
I tested with @parhedberg's credentials on my local installation earlier and they worked fine. I have a direct email chain going with him about that.

@bardahlm
Copy link

bardahlm commented Dec 20, 2022

You can add additional accounts on the Growatt server that can be used for HA and/or sharing for troubleshooting. Go to Setting -> Browse Account and click on "add".

@muppet3000
Copy link
Contributor

You can add additional accounts on the Growatt server that can be used for HA and/or sharing for troubleshooting. Go to Setting -> Browse Accound and click on "add".

That's awesome, thanks, I was wondering how to do that, it's a good way to separate the 'automation' account from the primary account used on your phone for example. I may switch to doing that for my setup!

@parhedberg
Copy link
Author

You were correct @muppet3000. In my files there where some old files in /custom_component/growatt_server directory. That made the integration fail to setup. Wiping that folder and restarting made integration setup work properly again!

With that I am closing this ticket, and wants to thank you for your time on this matter!

@muppet3000
Copy link
Contributor

Excellent, glad I could help out, I was worried it was something REALLY obscure like they'd blocked access from specific regions etc.

@azirion
Copy link

azirion commented Jan 2, 2023

Hi.
Like a week ago, Growatt stopped sending data to my H.A. (which is up to date) so I deleted the integration and attempted to install it again, but it has been impossible, with a message saying: "Unknown error occurred". I can visit the web page at https://server-api.growatt.com/ and I can log in and I can see all my data. I'm running Home Assistant 2022.12.8
Supervisor 2022.12.1 Operating System 9.4 Frontend 20221213.1
Oh and I also tried creating another user, but same message :(

@muppet3000
Copy link
Contributor

@azirion - This is a closed bug for something completely unrelated. You are seeing the issue described in #84600 which is also fixed and all you need to do is upgrade to the latest beta or wait for the next full release.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants