Skip to content

Conversation

lo92fr
Copy link
Contributor

@lo92fr lo92fr commented Sep 6, 2025

Hello @lolodomo, @clinique, @isiepel,

This is a new patch to Linky addons that is due to somes new changes on Enedis Web API that occurs a few days ago.
The measure entry point move from the v1 api to v2 api.
There is also a few changes in the URL format :

  • The userId is now using the new idPersonne return by USER_INFO_CONTRACT_URL uri.
  • The URL must contains the segment to work properly.

Laurent.

- add segment to URL
- use new userId in URL
- fix entry point from v1 to v2

Signed-off-by: Laurent ARNAL <laurent@clae.net>
@jlaur jlaur changed the title Fix new url schema for getMeasures() related to September Enedis changes to WebAPI [linky] Fix new url schema for getMeasures() related to September Enedis changes to WebAPI Sep 6, 2025
Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label Sep 7, 2025
@wborn wborn requested a review from Copilot September 8, 2025 05:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Linky binding to accommodate changes made by Enedis to their Web API in September 2025. The main purpose is to fix the URL schema for the getMeasures() method due to API version migration and URL format changes.

  • Updates API URLs from v1 to v2 for the PRM (Point de Référence de Mesure) measurement endpoints
  • Introduces the use of idPersonne instead of the previous user ID format
  • Adds segment parameter support to measurement API calls

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
ThingLinkyRemoteHandler.java Adds segment field, updates user ID retrieval logic, and modifies measurement method calls to include segment parameter
BridgeRemoteEnedisWebHandler.java Updates API URLs from v1 to v2, adds segment parameter to URL templates, and implements idPersonne retrieval
EnedisHttpApi.java Modifies getMeasures method signature to include segment parameter and updates all measurement data retrieval methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

- hard coded segment
- code simplification on RemoteHandler.

Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lo92fr lo92fr requested a review from lolodomo September 14, 2025 05:45
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@lolodomo lolodomo merged commit 93cc3ab into openhab:main Sep 14, 2025
2 checks passed
@lolodomo lolodomo added this to the 5.1 milestone Sep 14, 2025
@lolodomo
Copy link
Contributor

It has to be backported to 5.0.x but not to 4.3.x because there were many changes in the binding in 5.0. I asusme a specific PR would be required for 4.3.x. @lo92fr do you agree ?

lolodomo pushed a commit that referenced this pull request Sep 14, 2025
…dis changes to WebAPI (#19289)

* fix new url schema for getMeasures():
- add segment to URL
- use new userId in URL
- fix entry point from v1 to v2

Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lolodomo lolodomo added the backported A PR that has been cherry-picked to a patch release branch label Sep 14, 2025
@lo92fr
Copy link
Contributor Author

lo92fr commented Sep 17, 2025

Yes, I agree that it will need separate PR.
I've realized also that we have not backport the fix from last August.
I will try to make it as soon as possible.

@lsiepel
Copy link
Contributor

lsiepel commented Sep 17, 2025

Yes, I agree that it will need separate PR. I've realized also that we have not backport the fix from last August. I will try to make it as soon as possible.

Not sure where you refer to, but if that PR should also be backported, a conflict of this PR might already be fixed when they are both applied.

@lo92fr
Copy link
Contributor Author

lo92fr commented Sep 17, 2025

I refer to your last message on this PR #19142 that I don't see before.
About the fact that you do not have backport to 4.3 because of conflicts, and that "so if you can provide a fix in a seperate PR targeting 4.3.x it would be appreciated.".

@lsiepel
Copy link
Contributor

lsiepel commented Sep 17, 2025

Ah yes, if you create a PR for #19142 targeting 4.3 branch, it might be possible to backport this PR here by cherry-picking.

lo92fr added a commit to lo92fr/openhab-addons that referenced this pull request Sep 22, 2025
- Remove jsoup dependency.

- Fully backport  initialize() methods to implements new login process.

- Backport URL changes :
    - PR openhab#19289 (September change) :
           - move PRM_INFO_BASE_URL to v2.
           - add segment to measure URL.
           - add new idPersonne in place of internalId.
    - PR openhab#19144 (August change) :
           - move USER_INFO_CONTRACT_URL to v2.

Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lsiepel lsiepel added the backported4 Backported patches to the 4.x branch. Used for constructing release notes. label Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported A PR that has been cherry-picked to a patch release branch backported4 Backported patches to the 4.x branch. Used for constructing release notes. bug An unexpected problem or unintended behavior of an add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants