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

Add growatt server url https://openapi.growatt.com/ #103542

Closed
wants to merge 2 commits into from

Conversation

DerMuffin
Copy link

@DerMuffin DerMuffin commented Nov 6, 2023

Breaking change

Proposed change

Type of change

Add URL
  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: Issues "closed" because no solution
  • This PR is related to issue: Integration does not work because of wrong server.
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DerMuffin

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant bot marked this pull request as draft November 6, 2023 19:34
@home-assistant
Copy link

home-assistant bot commented Nov 6, 2023

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant
Copy link

home-assistant bot commented Nov 6, 2023

Hey there @muppet3000, mind taking a look at this pull request 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 pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign growatt_server Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@jpbede
Copy link
Member

jpbede commented Nov 6, 2023

Please fill out the PR template completely.

@MartinHjelmare MartinHjelmare changed the title add https://openapi.growatt.com/ Add growatt server url https://openapi.growatt.com/ Nov 6, 2023
@jpbede jpbede mentioned this pull request Nov 7, 2023
20 tasks
@muppet3000

This comment was marked as abuse.

@jpbede
Copy link
Member

jpbede commented Nov 8, 2023

I haven't had the time to work on a PR that removed Growatt from HA Core, but I feel that would be a better message to send people (accompanied with appropriate messaging).

I'm happy to help with this if you don't have the time. Otherwise, remember raise a issue 6 months before removing it completely like e.g. #98828

@muppet3000 muppet3000 mentioned this pull request Nov 13, 2023
20 tasks
@frenck
Copy link
Member

frenck commented Nov 13, 2023

There is a HACS alternative

The Home Assistant project does not support, recommend, or endorse the use of custom integrations. As a matter of fact, these are not checked or reviewed by the Home Assistant
team.

as it relies on a reverse engineered python library that interfaces with the Growatt servers

This is a non-reason. More than half of the integrations of Home Assistant use such constructs.

sers that it will be actively maintained here instead of what I've been directing people towards

From our point of view, this integration is in active maintenance and we very much welcome PRs to improve the integration shipped in core.

Again, if you don't want to contribute @muppet3000, that is fine and up to you. But you are now spreading misinformation.

TL;DR: We welcome any PR that improves this integration, including this one.

../Frenck

@muppet3000
Copy link
Contributor

I was simply trying to follow on the recommendations of the HA Core team that I was given last year by @MartinHjelmare here: #81951 (comment) ("If that's not possible, it may be better to move the integration to a custom integration."). I didn't realise the stance from the core maintainers had changed

We (I) have played cat & mouse with Growatt over the last 2 years as they have repeatedly ignored all attempts to engage and have now actively sought methods to block any external API integrations. Hence my reluctance to spend any more time on it.

This PR will be a sticking plaster (at best) until Growatt block API calls to that URL as well (if they haven't already).

The problem that needs to be solved here is in the upstream library that this integration leverages: https://github.com/indykoning/PyPi_GrowattServer
The specific issue that needs to be resolved is this one: indykoning/PyPi_GrowattServer#74
After that has been resolved then the library can be bumped in the HA Core repo to leverage that instead. Currently - nobody has found a way of working around the blocks that have been put in place for that library.

To avoid spreading any more 'misinformation' (I'm not going to even go try and articulate how strongly I disagree with this statement given how hard I've worked to keep this integration alive for the last 2 years), I'll submit a PR to remove myself as the codeowner and I wish whoever decides to take it up the very best of luck and I hope they're able to succeed where I have failed.

@@ -8,6 +8,7 @@
DEFAULT_NAME = "Growatt"

SERVER_URLS = [
"https://openapi.growatt.com/",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to be the default, and was previously put into the config entries as well.

Should we migrate existing config entries to update the stored URL from https://server-api.growatt.com/ to https://server.growatt.com/?

../Frenck

Copy link
Contributor

@muppet3000 muppet3000 Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has never been the default, it is a new entry.
I believe this comment has been copy/pasted from the other PR.

With regards to migrating existing config entries, I don't really mind, it's not something I've ever done historically for this integration as the only way people have ever been able to reconfigure it is by deleting it and then re-adding it anyway (which is generally the first thing people do when they get problems with it).

It's worth remembering that I don't even know if this will fix the issue, that's down to @DerMuffin to confirm as the person that raised the PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frenck I agree that adding this URL without migrating existing entries would be enough for now. That way not all users will switch at once, which probably increases the chance it will quickly be blocked again.

@mr-sab
Copy link

mr-sab commented Dec 10, 2023

Just made the changes by hand to see if this would solve my issue, I was able to connect after. So looks like this indeed solved the issue. Thank you for the work, looking forward to seeing this into master :)

@marcovtwout
Copy link
Contributor

Just to confirm, this has been working for me for 2 weeks stable now.

@CorstianB
Copy link

Just made the changes by hand to see if this would solve my issue, I was able to connect after. So looks like this indeed solved the issue. Thank you for the work, looking forward to seeing this into master :)

Where do i change it myself?

@mr-sab
Copy link

mr-sab commented Dec 28, 2023

Just made the changes by hand to see if this would solve my issue, I was able to connect after. So looks like this indeed solved the issue. Thank you for the work, looking forward to seeing this into master :)

Where do i change it myself?

I am using the docker image running on kubernetes so for you it is maybe different
But here it is:

 /usr/src/homeassistant/homeassistant/components/growatt_server/const.py

@marcovtwout
Copy link
Contributor

@DerMuffin could you convert the draft into a real PR and complete the nessecary steps so this can be merged?

@chenjiayi8
Copy link
Contributor

@DerMuffin I contacted Growatt IT department, they provide these URLs:

"https://openapi-cn.growatt.com", # Chinese server
"https://openapi-us.growatt.com", # North American server
"https://openapi.growatt.com", # Other regional server

@DerMuffin DerMuffin closed this Jan 19, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants