Skip to content

Comments

[linky] Add support for reading index instead of basic value#19147

Merged
lolodomo merged 40 commits intoopenhab:mainfrom
lo92fr:features/linky-index
Nov 1, 2025
Merged

[linky] Add support for reading index instead of basic value#19147
lolodomo merged 40 commits intoopenhab:mainfrom
lo92fr:features/linky-index

Conversation

@lo92fr
Copy link
Contributor

@lo92fr lo92fr commented Aug 11, 2025

Support for reading index instead of basic value,

Description

This PR is about to get consumption index from the api instead of consumption value.
With consumption index, we will be able to dispatch the consumption to a specific tarif, and have graph where you can see consumption of different time area in the day.

For exemple, it will support tarif like:
Heure pleine / Heure creuse.
Tempo tariff with 6 dispatch cadran : Red, White, Blue & HP/HC.

And the first version only implement EnedisWeb gateway.

@lo92fr
Copy link
Contributor Author

lo92fr commented Aug 11, 2025

For exemple, you will obtains graph like this one:

image

@lsiepel lsiepel marked this pull request as draft August 11, 2025 20:05
@lsiepel lsiepel requested a review from Copilot August 11, 2025 20:05
@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Aug 11, 2025

This comment was marked as outdated.

lo92fr added 2 commits August 31, 2025 18:22
…ournisseur and distributor dispatch like heure creuse / heure pleine or tempo tarif).

Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lo92fr lo92fr force-pushed the features/linky-index branch from 1fc1544 to a5b1bfc Compare August 31, 2025 16:22
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
@wborn wborn added the work in progress A PR that is not yet ready to be merged label Sep 8, 2025
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
remove unnecessary code after last fixes

Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
…the binding

Signed-off-by: Laurent ARNAL <laurent@clae.net>
- Will create channel dynamically to represent each available tarif.
- Will split the dataset result to the bound of tarif change.
- Will update each time series accordly.
- Graph will be able to display silmutaneous tarif on the same graph.

Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
… set to 0.

Signed-off-by: Laurent ARNAL <laurent@clae.net>
add verification for tarif change

Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lo92fr
Copy link
Contributor Author

lo92fr commented Oct 18, 2025

Hello @lolodomo,

I've pushed the fixes for your review of this morning.
Sorry for all the typo in the comments of ThingLinkyRemoteHandler, I've check the full file, and will try to better check next time.
You will have to review my comment about label for dynamic channel, we can eventually prefix the label with the group name.
But not sure it is very a good thing as channel label are in french (coming from the data), and group are in English.

Laurent.

@lo92fr lo92fr requested a review from lolodomo October 18, 2025 13:38
@lolodomo
Copy link
Contributor

lolodomo commented Oct 19, 2025

You will have to review my comment about label for dynamic channel, we can eventually prefix the label with the group name.
But not sure it is very a good thing as channel label are in french (coming from the data), and group are in English.

Yes, you're probably right. I have commented as a response to the original comment.

I would prefer to avoid the ERROR log level for the unexpected index mode.
Edit: ERROR level is already (wrongly at my opinion) used in this class, so this is just one more. So I don't know if it has to be changed or not.

Look at my 3 comments that are not yet marked as resolved.
I will finish the review today (last part of changes in class ThingLinkyRemoteHandler).

@lo92fr
Copy link
Contributor Author

lo92fr commented Oct 19, 2025

You will have to review my comment about label for dynamic channel, we can eventually prefix the label with the group name.
But not sure it is very a good thing as channel label are in french (coming from the data), and group are in English.

Yes, you're probably right. I have commented as a response to the original comment.

I would prefer to avoid the ERROR log level for the unexpected index mode. Edit: ERROR level is already (wrongly at my opinion) used in this class, so this is just one more. So I don't know if it has to be changed or not.

Look at my 3 comments that are not yet marked as resolved. I will finish the review today (last part of changes in class ThingLinkyRemoteHandler).

I've finally remove the prefix on channel Label.
This will end up with something like this:

image

About the Error log level, not sure to understand what you want ?
As said, this condition it not really like to occur.
So what will be the good way to handle it:

  • Return silently without logging an error (not sure that is a good thing).
  • Change log level to something else that error.
  • throw an exception, and toggle the thing to offline indicating an internal error ?
    Let me know.

About the 3 last comments, i'm currently looking at them.
Can take a little time as I've will have to check what happen in the different cases.

Laurent.

Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lo92fr
Copy link
Contributor Author

lo92fr commented Oct 19, 2025

@lolodomo,

I've push the changed about this morning review.
For the 3 comments about the null return and the NaN check, have to said that I'm not currently totally sure it's safe.
I will make more review on it, and will come back later this week we a more detailed answer.

Laurent

@lo92fr lo92fr requested a review from lolodomo October 19, 2025 14:29
We don't need anymore this modification, as was already fixed by commit * review data array bound when using index (925585e
) on MeterReading.

Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lo92fr
Copy link
Contributor Author

lo92fr commented Oct 20, 2025

Hello @lolodomo,

See my comment about the two remaining point.
I revert the code to the old one.

Laurent.

…ly support index

Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lolodomo
Copy link
Contributor

lolodomo commented Nov 1, 2025

@lo92fr : I just added 3 last comments. After that, I will merge.

@lo92fr
Copy link
Contributor Author

lo92fr commented Nov 1, 2025

@lo92fr : I just added 3 last comments. After that, I will merge.

Thanks for the review. I will try to fix the last 3 somewhere today.

Laurent.

Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
fix bad test on updateEnergyIndex, always false !

Signed-off-by: Laurent ARNAL <laurent@clae.net>
@lo92fr
Copy link
Contributor Author

lo92fr commented Nov 1, 2025

@lolodomo,

I've just push the 3 fixes.

Laurent.

@lo92fr lo92fr requested a review from lolodomo November 1, 2025 11:25
@lolodomo
Copy link
Contributor

lolodomo commented Nov 1, 2025

I've just push the 3 fixes.

Label is still with a leading space (and different from the one in description - to be confirmed that is really what you want) and still lots of changes in French translations (even more than before).

Signed-off-by: Laurent ARNAL <laurent@clae.net>
Signed-off-by: Laurent ARNAL <laurent@clae.net>
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

@lo92fr
Copy link
Contributor Author

lo92fr commented Nov 1, 2025

LGTM, thank you

Have to said that there will be another pull request by the end of year about linky.
Enedis have said that will do change to the Rest api to also support index consumption on the Api side.
I'm waiting to have test platform on their side to finish to implements this change !

Laurent.

@lolodomo lolodomo merged commit 9a39809 into openhab:main Nov 1, 2025
2 checks passed
@lolodomo lolodomo added this to the 5.1 milestone Nov 1, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants