Add a module to retrieve electricity use from Linky

I use your code, and it works great
Bravo!


I did not see the Halfhourly sensor in order to get real time comsumption and calculate the Off-Peak and Peak Consumptions and Prices. so I made some Template sensors to get them.

Halfhourly sensor is useless because it’s a -1d not the current day :frowning:

Yes, but the -1d gives you a cumulative of the day consumption while half-hourly gives you exactly that, a half-hourly description of the day’s consumption so you could calculate the off-peak and peak hours by the exact valor of your consumption.
Ex. in my region the Off peak hours are from 3:30 am to 8:00 am and from 13:30 to 16:00 so you could do a sum of those hours (KWh) and get your real off-Peak consumption then you substract that from your -1d and you get your real peak hours.

Maybe I am overcomplicating this thing :slight_smile:

make sense. I update my repos with Halfhourly sensor

Hi, could you share your configuration because. I don’t see how you obtain split between Heures Pleines and Heures Creuses. Thanks by advance

It all depends on your contract. The Heures pleines and creuses changes by region so in mine the creuses are from 3:30 am to 8am and 1:30 pm to 4:00 pm

So this is my linky.yaml:
Thanks to Pirionfr!

https://pastebin.com/mW56SZmQ

then after creating the sensors, I just did all the operations with some template sensors:

https://pastebin.com/5wkN6BeZ

And here is my groups conso section:

https://pastebin.com/VRvB8uQv

If you need more info, just ask!
:wink:

Thank you, i will adapt your script with my own hours (from 11:00 pm to 7:00am fo Heures creuses) and test it. i use home assistant since a few time and i haven’t test templating yet. It seems to be very useful. In your files you indicate some sensors for grafana. You use grafana inside home assistant to display global graph of your consumption ?

No I use Grafana as a stand-alone solution to graph the HA sensors.

I forgot to put the HA view.
This is my HA conso view :

Using the custom sensor for linky by Pirionfr, I am able to retrieve my linky conso in HA.
I have however some questions (for ursus69)

  • How do you change the name of linky variables (using the name of the day or the month)
  • To graph the daily consumption using grafana, I store the variable linky_daily_1d_consumption in influxdb. However when I display the variable with grafana, the timeline is shifted by 1day. How do you correct the timeline (it required a negative time shift, which is not allowed with grafana)

Hello,

I do not change the names for the sensors, HA is the one that put the right names.
I only change the names of my Template sensors.

And this is what I have on Grafana with no problems at all
graf

Sorry I cannot help you more.

@ursus69
Thanks for your reply

  • in your HA conso view , you display template sensor and note directly the linky variables
  • for grafana, i can draw my daily consumption curve using linky_daily_1d_consumption but the the day is not correct: i.e. the consumption display for today correspond to the consumption of yesterday (which is logical because linky_daily_1d_consumption is the yesterday consumption).

Hi @Pirionfr, I have started to use your custom component recently, and it works great, but retrieving the data fails very often, displaying Unknown on the front end (a few hours every day)

Am I the only one having this issue?

Here are some screenshots with the details

Front-end

front front

States

Log

Thanks a lot :+1:

I only have problem when site are down

I’ve just tried to setup this custom component, but in my ENEDIS account there is no data. Do you know the standard duration before having cunsumption data ? My linky was installed in April this year.

Bonjour,
You should activate the Charge Courve, to do this,

Tu dois cocher :
J’autorise expressément Enedis à enregistrer ma courbe de charge afin de pouvoir la consulter pendant 12 mois.

dans Consomation > Gérer ma courbe de charge

Cordially

Jose

Thank you for the tip but I don’t have yet this option. I think my linky is not yet fully integrated in the Enedis service.
ENDEDIS

I’ve opened a ticket yesterday to have some explaination from the website support.

Hi everyone !

I’ve worked with this interesting script to retrieve data from Linky, and builded some template sensors based on the raw data. I’ve also build a custom card for the new Lovelace UI, that shows some informations about your Linky stats (in French, of course).

image

I don’t know if some people can be interested in this type of resources, but I can share it if needed :slight_smile:

Feel free to ask some questions about it !

4 Likes

Hey! I am really interested in it, can you share your project?

Très intéressé aussi ! :wink:

Très intéressé aussi !