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

[enphase] Add Entrez/JWT support for newer software versions of Envoy #15077

Merged
merged 5 commits into from
Oct 5, 2023

Conversation

Hilbrand
Copy link
Member

Adds support for newer Envoy software version that currently is not supported by the binding.
See also https://community.openhab.org/t/new-binding-enphase-envoy-solar-system-gateway/44449/113

@Hilbrand Hilbrand added the enhancement An enhancement or new feature for an existing add-on label Jun 10, 2023
@joseil
Copy link

joseil commented Jun 13, 2023

Hallo Hilbrand,
i noticed that you have been working on the Enphase binding to support version 7 of the envoy with the JWT.
Is there away that i can tryout this enhancement?, or will it be publiched in the next release of Openhab
Jos

@Hilbrand
Copy link
Member Author

@joseil You can find the jar file in this community message: https://community.openhab.org/t/new-binding-enphase-envoy-solar-system-gateway/44449/94

@joseil
Copy link

joseil commented Jun 13, 2023 via email

@Hilbrand Hilbrand added the external bug A problem or unintended behavior of an external library label Jun 28, 2023
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

Thank you for taking care! I have added some minor comments.

I believe update instructions are needed because of the channel group changes.

Also, it seems connection is now hybrid or cloud rather than local?

@Hilbrand
Copy link
Member Author

I've changed connection to hybrid, although it's only a small part. Because only for certain versions of the Enphase software it's needed to get the authorization, which only needs to be done after certain period of time. All reading of the data is still local.

It doesn't seem to need a migration update. Because the group type id has changed and that information is not stored in the json database. Therefor after installing the new version of the binding the channels created in the ui keep working.

@jlaur
Copy link
Contributor

jlaur commented Aug 24, 2023

It doesn't seem to need a migration update. Because the group type id has changed and that information is not stored in the json database. Therefor after installing the new version of the binding the channels created in the ui keep working.

👍 Still, items need to be relinked, right? So probably should be mentioned after:

https://github.com/openhab/openhab-distro/blob/a3e95096144a2b867f67a29cb1f542f9ffd42f57/distributions/openhab/src/main/resources/bin/update.lst#L95-L119

@jlaur
Copy link
Contributor

jlaur commented Aug 24, 2023

I've changed connection to hybrid, although it's only a small part. Because only for certain versions of the Enphase software it's needed to get the authorization, which only needs to be done after certain period of time. All reading of the data is still local.

Does this mean that without the cloud, it will not be possible to get the authorization and read data locally? Or is this cloud authorization not needed for using the local API?

@Hilbrand
Copy link
Member Author

Still, items need to be relinked, right?

Items should be automatically relinked, because the channel names itself didn't change. Therefor I would not expect an issue. I did test this, and it did just relink the items. Although someone on the forum did mention problems with the items linking when updating the binding, but I don't understand what is the cause or if/how that is related to the rename of the group type id.

Does this mean that without the cloud, it will not be possible to get the authorization and read data locally? Or is this cloud authorization not needed for using the local API?

The Envoys with the newer software version require authorization. It is required to get the jwt from the portal, either by login to the portal and get the jwt and configure the jwt or config login and than the jwt will be obtained from the portal by the binding. After setting the jwt it can use the local API and no cloud connection is needed. So yes the jwt from the portal is needed. But once one has the jwt the binding doesn't need cloud connection.

@jlaur
Copy link
Contributor

jlaur commented Aug 25, 2023

Still, items need to be relinked, right?

Items should be automatically relinked, because the channel names itself didn't change. Therefor I would not expect an issue. I did test this, and it did just relink the items. Although someone on the forum did mention problems with the items linking when updating the binding, but I don't understand what is the cause or if/how that is related to the rename of the group type id.

Sorry, I mixed changed id with changed group name. Since the id is changed, I would have suspected issues for managed things without update instructions, but since you tested this, apparently there is no issue. Channel relinking was a brainfart - that would only be needed if channel group name changed.

Does this mean that without the cloud, it will not be possible to get the authorization and read data locally? Or is this cloud authorization not needed for using the local API?

The Envoys with the newer software version require authorization. It is required to get the jwt from the portal, either by login to the portal and get the jwt and configure the jwt or config login and than the jwt will be obtained from the portal by the binding. After setting the jwt it can use the local API and no cloud connection is needed. So yes the jwt from the portal is needed. But once one has the jwt the binding doesn't need cloud connection.

Hmm, I never heard of such a solution before. If the cloud services will be shut down (for any reason), the integration will stop working, even though it actually runs locally. By the definition it's actually cloud now rather than local or hybrid, since cloud is required and not optional. But since it only applies to newer software, I guess some users will still run entirely local. So I guess we can use hybrid as some kind of compromise (if you agree).

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

LGTM

Hilbrand and others added 5 commits September 22, 2023 09:21
…of Envoy

Co-authored-by: Joe Inkenbrandt <joe@inkenbrandt.com>
Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
…Enphase portal.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
@jlaur
Copy link
Contributor

jlaur commented Oct 5, 2023

So I guess we can use hybrid as some kind of compromise (if you agree).

I'm sorry, this PR somehow got off my radar. I guess I was waiting for a reply here - but assuming silent agreement now. 😉

@jlaur jlaur added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Oct 5, 2023
@jlaur jlaur changed the title [enphase] Added Entrez/JWT support for newer software versions of Envoy [enphase] Add Entrez/JWT support for newer software versions of Envoy Oct 5, 2023
@jlaur jlaur merged commit d58d8b0 into openhab:main Oct 5, 2023
@jlaur jlaur added this to the 4.1 milestone Oct 5, 2023
@Hilbrand Hilbrand deleted the enphase-version7 branch October 5, 2023 21:16
pat-git023 pushed a commit to pat-git023/openhab-addons that referenced this pull request Oct 13, 2023
…openhab#15077)

Co-authored-by: Joe Inkenbrandt <joe@inkenbrandt.com>
Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
querdenker2k pushed a commit to querdenker2k/openhab-addons that referenced this pull request Oct 21, 2023
…openhab#15077)

Co-authored-by: Joe Inkenbrandt <joe@inkenbrandt.com>
Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
querdenker2k pushed a commit to querdenker2k/openhab-addons that referenced this pull request Oct 29, 2023
…openhab#15077)

Co-authored-by: Joe Inkenbrandt <joe@inkenbrandt.com>
Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: querdenker2k <querdenker2k@gmx.de>
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
…openhab#15077)

Co-authored-by: Joe Inkenbrandt <joe@inkenbrandt.com>
Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on external bug A problem or unintended behavior of an external library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants