# Enedis-Linky integration

**URL:** <https://community.gladysassistant.com/t/integration-enedis-linky/7470>\
**Category:** Développement\
**Created:** [August 7, 2022, 6:50pm UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470 "2022-08-07T18:50:44Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 11, 2023, 11:10am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/101 "2023-05-11T11:10:51Z")

</div>

Hi @_Will_71 @Tlse-vins 🙂

I think I know where the bug comes from — it’s not a bug related to the Enedis integration per se, but to the way the aggregation of values linked to historical data works!

Would you mind sending me your database privately so I can reproduce the issue on my end?

Thanks!

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [May 11, 2023, 11:22am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/102 "2023-05-11T11:22:37Z")

</div>

Hi @pierre-gilles I’ll try to send it to you tonight

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 11, 2023, 11:24am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/103 "2023-05-11T11:24:34Z")

</div>

Thanks @_Will_71, remember to stop Gladys before copying the file 🙂

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [May 11, 2023, 12:50pm UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/104 "2023-05-11T12:50:37Z")

</div>

I can’t promise I’ll have time to do it tonight.  
I’ll take a look.  
It would be nice to be able to retrieve the file directly via Gladys Plus. Wouldn’t that be possible?

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [May 11, 2023, 10:58pm UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/105 "2023-05-11T22:58:27Z")

</div>

I sent you an email with a link to download my database

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 12, 2023, 8:30am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/106 "2023-05-12T08:30:55Z")

</div>

Thanks @_Will_71 for your DB, that confirms what I thought. The Enedis integration works well, you have all the data on your local DB, however the aggregated data are not correct which is causing these display issues

I created a GitHub issue, I’ll keep you posted when it’s fixed 🙂

> <https://github.com/GladysAssistant/Gladys/issues/1782>
>
> Spotted in Enedis integration: https://community.gladysassistant.com/t/integrati…on-enedis-linky/7470/101?u=pierre-gilles

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 12, 2023, 8:33am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/107 "2023-05-12T08:33:58Z")

</div>

> [@Tlse-vins](#):
>
> It would be nice to be able to retrieve the file directly via Gladys Plus. Would that not be possible?

The file on the Gladys Plus side is encrypted with a key only present on the local instance, so in any case there will be a download to the local instance + a decryption; not sure that’s the best option

But a «&nbsp;Download my database&nbsp;» button in Gladys locale, why not (to see if it’s a recurring need)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 18, 2023, 6:36am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/108 "2023-05-18T06:36:22Z")

</div>

@Tlse-vins @_Will_71 I worked this morning on this issue to resolve this display problem on your instances.

I fixed the bug in this PR:

> <https://github.com/GladysAssistant/Gladys/pull/1789>
>
> \### Pull Request check-list
> 
> To ensure your Pull Request can be accepted as fa…st as possible, make sure to review and check all of these items:
> 
> \- \[x\] If your changes affects code, did your write the tests?
> \- \[x\] Are tests passing? (\`npm test\` on both front/server)
> \- \[x\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[x\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[x\] If you are adding a new features/services, did you run integration comparator? (\`npm run compare-translations\` on front)
> \- \[x\] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to \[the community\](https://community.gladysassistant.com/) for testing before merging.
> 
> \### Description of change
> 
> Fix #1782

And I coded a database migration to fix the existing data on your instances:

> <https://github.com/GladysAssistant/Gladys/pull/1790>
>
> \### Pull Request check-list
> 
> To ensure your Pull Request can be accepted as fa…st as possible, make sure to review and check all of these items:
> 
> \- \[x\] If your changes affects code, did your write the tests?
> \- \[x\] Are tests passing? (\`npm test\` on both front/server)
> \- \[x\] Is the linter passing? (\`npm run eslint\` on both front/server)
> \- \[x\] Did you run prettier? (\`npm run prettier\` on both front/server)
> \- \[x\] If you are adding a new features/services, did you run integration comparator? (\`npm run compare-translations\` on front)
> \- \[x\] Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to \[the community\](https://community.gladysassistant.com/) for testing before merging.
> 
> NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
> 
> \### Description of change
> 
> Reset aggregate on existing Enedis devices

All of this will be included in the next version of Gladys 🙂

Thanks @_Will_71 for the DB, it helped me a lot!

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 22, 2023, 3:39am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/109 "2023-05-22T03:39:05Z")

</div>

@Tlse-vins @_Will_71 The fix was released last week in Gladys Assistant v4.23.3 — is the bug properly resolved for you? 🙂

> **[Release v4.23.3 · GladysAssistant/Gladys](https://github.com/GladysAssistant/Gladys/releases/tag/v4.23.3)**
>
> What's Changed
> 
> fix(front): Fix integrations search by @cicoub13 in #1783
> Upgrade react-big-calendar & fix caldav styles by @bertrandda in #1777
> Broadlink TV changes by @atrovato in #1738
> feat(gate...

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [May 22, 2023, 5:04am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/110 "2023-05-22T05:04:47Z")

</div>

Yes, I confirm.

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [May 22, 2023, 5:24am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/111 "2023-05-22T05:24:47Z")

</div>

Yes, I confirm as well.  
However, on the 7-day view only 5 days are displayed — is that normal? On the chart above I can see 7 days

 ![IMG_20230522_072148](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/4/4b249279278ae62e444851e39eddd3bbd826f7ed.jpeg)

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 22, 2023, 5:29am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/112 "2023-05-22T05:29:37Z")

</div>

> [@\_Will\_71](#):
>
> However on the 7-day view only 5 days are displayed, is that normal? On the chart above I can see 7 days

Yes it’s normal, the latest value I see from Enedis is dated May 20, it should update during the morning with fresher values 🙂

Also, I have the impression that on weekends that include public holidays, Enedis isn’t always

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [May 22, 2023, 5:35am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/113 "2023-05-22T05:35:04Z")

</div>

Ok I’ll look later

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [May 22, 2023, 2:38pm UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/114 "2023-05-22T14:38:16Z")

</div>

@pierre-gilles So I did get an Enedis update because now I have 6 days on the graph. The 21st has been added.

 ![IMG_20230522_162735](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/3/35a5f29fb076fc707a4f6ff4a4ca33993edee3ab.jpeg)

However I only have 6 days displayed from May 16 to 21

 ![IMG_20230522_162802](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/c389a97783381dc013450448fccd40e73c42cc81.jpeg)

On another graph (non-Enedis) in the 7-day view the graph shows May 15 to 21

 ![IMG_20230522_162829](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/d/dead2c61757dc2e53eb8ac0e85d9198301d0dfbf.jpeg)

I can find the value if needed on the 30-day graph, but is it normal to only have 6 days then?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [May 23, 2023, 2:31am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/115 "2023-05-23T02:31:34Z")

</div>

This may be confusing, but when this chart displays the last 7 days, it will fetch the last 7 24-hour periods.

So if you look at your chart on Sunday at 3:00 PM, it will fetch states up to the previous Sunday at 3:00 PM, which makes sense if you’re looking at a line chart with lots of sensor values.

The Enedis case is special, because there is only one state per day (since it’s a daily consumption), an event which is inserted on the day’s date (with 00:00 for the time → midnight)

So if you check during the day, indeed it will only display 6 days because the state at midnight is too old for this view

Several options are possible:

- Either we change for everyone so that «&nbsp;last 7 days&nbsp;» = «&nbsp;the last 7 days starting at midnight of the day 7 days ago&nbsp;»
- Or we change only for a selected set of sensor types (of which Enedis will be part)
- Otherwise, due to the unique nature of the Enedis integration, the next step of this development (if there is demand for it) was to develop a custom graphical display specifically for «&nbsp;electricity consumption&nbsp;»; I had made mockups on the subject:

> [@Intégration Enedis-Linky](https://community.gladysassistant.com/t/integration-enedis-linky/7470/20?u=pierre-gilles):
>
> Salut à tous ! Au final c’est moi qui avance sur ce sujet, et j’aimerais vous présenter mes différentes réflexions. La partie connexion/récupération de données dans Gladys est quasiment fonctionnelle, et j’aimerais lancer en parallèle la réflexion sur l’affichage de ces données dans l’interface. Voilà quelques maquettes du sujet. Connexion avec l’API Enedis Affichage des différents compteurs détectés, et déclaration du contrat / tarif

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [May 23, 2023, 6:18am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/116 "2023-05-23T06:18:10Z")

</div>

Ok now it’s clearer, thanks @pierre-gilles.

It was confusing to see

---

<div class="post-metadata">

**Author:** ![Psoy](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/psoy/32/9005_2.png) [@Psoy](https://community.gladysassistant.com/u/Psoy)\
**Post date:** [September 14, 2023, 2:16pm UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/118 "2023-09-14T14:16:41Z")

</div>

Hello,  
I haven’t been receiving my Enedis data for about a week. When I click on the Gladys plus link to Enedis I get this page.

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/b/b19d2955cedfebc5cdc096e9c92f852e087b67e4.jpeg)

Yet in my Enedis account the data sharing is checked. Do you have any idea what’s going on? Thanks in advance

---

<div class="post-metadata">

**Author:** ![Will\_71](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/will_71/32/9582_2.png) [@Will\_71](https://community.gladysassistant.com/u/Will_71)\
**Post date:** [September 14, 2023, 2:21pm UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/119 "2023-09-14T14:21:50Z")

</div>

Same here, no data for a week.

---

<div class="post-metadata">

**Author:** ![b3n.0](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/b3n.0/32/3458_2.png) [@b3n.0](https://community.gladysassistant.com/u/b3n.0)\
**Post date:** [September 14, 2023, 2:23pm UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/120 "2023-09-14T14:23:18Z")

</div>

Same here: latest value as of Sept. 7.

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [September 15, 2023, 8:48am UTC](https://community.gladysassistant.com/t/integration-enedis-linky/7470/121 "2023-09-15T08:48:11Z")

</div>

Thank you for your feedback, I’ll investigate.

[Previous page](https://community.gladysassistant.com/t/integration-enedis-linky/7470.md?page=5)

[Next page](https://community.gladysassistant.com/t/integration-enedis-linky/7470.md?page=7)
