Issue: Gladys has low responsiveness for a few minutes every hour. Could it be Enedis's fault?

For a few weeks now, I’ve been experiencing a latency of a few seconds in my scenes and in the dashboard display. For example, I press a Zigbee button, and the Zigbee lamp only turns on 3-4 seconds later. But this isn’t systematic, and generally, everything is quite responsive. In fact, it seems to happen for a few minutes every hour…

I think my mini-PC running Gladys is overloaded, but I’m not sure how to identify which process is causing the issue.

I observe this in the information sent every minute from my probes in Node-RED (ignore the label ‹ raspberri-pi4 ›, I just didn’t rename it after switching to a mini-PC):


You can see significant RAM usage (increasing it would probably help…) and especially a CPU spike from 15% to 35%, corresponding to the period when Gladys loses its responsiveness.

What can I analyze to identify the source of the problem?

Nothing else but Gladys is running on my mini-PC.

I think I’ve found the culprit: Every hour, at the time when I observe the significant slowdown of the dashboard and Gladys scenes, the « Enedis Data Synchronization » task starts and lasts more than 10 minutes!

I downloaded Gladys logs to try to spot lines related to Enedis, but I only get about 20 minutes of logs in a 330 KB file, while the Gladys system page indicates that logs will be truncated at 20 MB. That’s strange because my last Gladys restart was 17 hours ago…
And when I run « docker logs -t gladys » via SSH on my mini-PC, I don’t get any more logs.

So several questions:

  • How can I configure Gladys to keep logs longer? 24 hours would seem better to be able to analyze in case of issues, right?
  • How can I ensure that the culprit of my slowdowns is indeed related to Enedis?
  • If the issue is indeed from there, what can I do to fix it? I thought about removing the Enedis integration and then adding it back, but:
    • do I risk losing my data history, or will everything come back? I have Enedis data in Gladys since August 2022…
    • will deleting and recreating the Enedis integration force me to reconfigure the hierarchy of devices in the energy tracking, since Enedis is the root of everything?

Thanks in advance for your advice!

Hello Stéphane,

I just checked at my end, I also have these sync tasks every hour and unlike you, I don’t have any issues, they run in less than 5 seconds.

Thanks for the feedback. This confirms that I must have an issue with my installation :wink:

Hi @StephaneB,

Thanks for the screenshot, it confirms the symptom. But beware of an important trap: this task does two things, and the 12 minutes displayed cover both.

  1. Downloading and inserting Enedis data. Contrary to what one might think, Gladys does not re-download the entire history each time: it normally starts from the last synchronized date minus 7 days (Enedis sometimes corrects its data a posteriori). That’s ~7 points for daily consumption, and ~336 points if you have the 30-minute load curve. A few seconds, normally — that’s what @PhilippeMA sees.
  2. Recalculating energy costs, triggered right after, inside the same task. It therefore does not appear as a separate task in the list, but its time is indeed counted in the 12 minutes. And this recalculation scans all your devices with « energy » features, not just Enedis: for each cost feature, it deletes and then re-inserts the values over the entire period.

The real question is therefore: which of the two phases takes the 12 minutes? Your logs will decide in a minute.

How to know

Go to Settings → System → Download logs. You get a file with the logs of your instance, in one click.

The right time to do this: Enedis sync runs every hour between HH:30 and HH:50 (the exact minute is drawn at random when Gladys starts, to avoid all users hitting the API at the same time). So if you download the logs right after noticing a slowdown, the cycle you’re interested in is definitely in there — no need for 24 hours of history, that’s what answers your first question.

Then, in the file, look for these three lines:

Enedis: Syncing 12345678901234 after 2026-08-13
Calculating cost in timezone Europe/Paris
Found 14 energy devices

Three things to look at:

  • The date after after. If it’s indeed ~7 days ago, phase 1 is doing its normal job. If it’s 2000-01-01 or an old date (2022, 2024…), we’ve found the bug: your sync starts from zero every hour instead of starting from the last known date. It then replays tens of thousands of load curve points every hour, and triggers a cost recalculation on your entire history. That would perfectly match 12 minutes.
  • The time gap between Enedis: Syncing and Calculating cost: that’s the exact duration of phase 1. If most of the 12 minutes are after Calculating cost, it’s the cost recalculation that’s the culprit.
  • The Found N energy devices: that’s the number of devices the recalculation scans each cycle. If N is high (large hierarchy with many sub-meters), that’s where the time goes.

Additional clue, even faster and without logs: the task’s progress bar only follows phase 1. If it reaches 100% in a few seconds and then the task remains « in progress » for several minutes, it’s the cost recalculation.

Why you only have 20 minutes of logs

This is not a Gladys limit: Gladys does not write a log file, everything goes to the container’s standard output and it’s Docker that stores it. The official installation command contains --log-opt max-size=10m without max-file, so Docker only keeps one file: as soon as it reaches 10 MB, it starts a new empty file and the old one is lost. You just happened to fall shortly after a rotation.

For your diagnosis, this is not blocking — download the logs right after a slowdown and you’ll have the window you need. If one day you recreate your container (manual update, config change…), you can add --log-opt max-file=5 to your docker run command to keep up to 5 files, but it’s not necessary to recreate it just for that now.

Delete / reinstall the integration: definitely not

Your fears are justified, and even below reality:

  • Deleting a device deletes in cascade its features and all their history. Your data since August 2022 would indeed be lost, and unrecoverable: Enedis only gives back at best ~3 years of daily consumption, and much less on the 30-minute load curve.
  • You would also break your entire energy hierarchy, to be rebuilt manually.
  • And above all it would serve no purpose: you don’t need to delete anything to resynchronize. The « Refresh » button at the top of the Enedis integration page already starts a complete synchronization from the beginning. (Warning, this one is long by nature, several tens of minutes — it’s normal, and each click restarts the entire history, so no click in a loop.)

So don’t delete anything, we’ll find out.

OK, I’ll analyze all this tomorrow and come back with the result. Thanks for the help :+1:

So I observed what was happening during a slowdown this morning from 11:36 a.m. to 11:48 a.m. I then retrieved the logs (docker logs gladys) from 11:30 a.m. to 11:50 a.m.

The full logs are here: log-gladys-pendant-surcharge.log - pCloud

If I filter the info lines concerning the prohand, melcloud, and netatmo extensions, I get this:

2026-08-22T09:30:00.225943779Z 2026-08-22T11:30:00+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:26 (EnergyMonitoringHandler.calculateEnergyFromIndex) Calculating consumption from index in timezone Europe/Paris for window Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:01.121704771Z 2026-08-22T11:30:01+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:35 (EnergyMonitoringHandler.calculateEnergyFromIndex) Found 79 energy devices
2026-08-22T09:30:01.122944109Z 2026-08-22T11:30:01+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:66 (EnergyMonitoringHandler.calculateEnergyFromIndex) Found 31 devices with both INDEX and thirty-minutes-consumption features
2026-08-22T09:30:01.792318089Z 2026-08-22T11:30:01+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Compteur Zlinky at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:01.886579600Z 2026-08-22T11:30:01+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Compteur Zlinky at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:01.970218917Z 2026-08-22T11:30:01+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Compteur Zlinky at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:02.047875441Z 2026-08-22T11:30:02+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Compteur Zlinky at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:02.132442036Z 2026-08-22T11:30:02+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Compteur Zlinky at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:02.211205756Z 2026-08-22T11:30:02+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Compteur Zlinky at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:02.293403017Z 2026-08-22T11:30:02+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Compteur Zlinky at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:02.435322988Z 2026-08-22T11:30:02+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Mesure conso PaC et General at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:02.606255344Z 2026-08-22T11:30:02+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0.08999999999991815 for device Mesure conso PaC et General at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:02.811307301Z 2026-08-22T11:30:02+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0.37999999999999545 for device Mesure conso four et plaques at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:03.032964821Z 2026-08-22T11:30:03+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Mesure conso four et plaques at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:03.388952271Z 2026-08-22T11:30:03+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise Circulateur plancher chauffant at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:03.456959142Z 2026-08-22T11:30:03+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0.3000000000001819 for device Prise Panneaux solaires at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:03.538274251Z 2026-08-22T11:30:03+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0.03000000000002956 for device Prise VMC at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:03.648167433Z 2026-08-22T11:30:03+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise ampli 5.1 at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:03.792599092Z 2026-08-22T11:30:03+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise appareils multimédias at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:04.080448191Z 2026-08-22T11:30:04+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise chargeurs vélo at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:04.231232041Z 2026-08-22T11:30:04+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise chauffe-eau at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:04.332767096Z 2026-08-22T11:30:04+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise circulation bassin at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:04.538412271Z 2026-08-22T11:30:04+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0.030000000000086402 for device Prise congel sous-sol at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:05.562600627Z 2026-08-22T11:30:05+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise controleur PaC at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:05.642213673Z 2026-08-22T11:30:05+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0.009999999999999787 for device Prise fontaine at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:05.747737223Z 2026-08-22T11:30:05+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0.009999999999990905 for device Prise freebox at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:05.894420962Z 2026-08-22T11:30:05+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0.01999999999998181 for device Prise frigo-congel cuisine at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:06.075765006Z 2026-08-22T11:30:06+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise lave-vaisselle at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:06.249029169Z 2026-08-22T11:30:06+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise ordi bureau at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:06.522794882Z 2026-08-22T11:30:06+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise pompe eau de pluie at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:06.844778433Z 2026-08-22T11:30:06+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise pompe à chaleur at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:06.923382110Z 2026-08-22T11:30:06+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise sèche-linge at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:07.096358178Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise vidéo-projecteur at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:07.204719038Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:153 () Saved consumption 0 for device Prise yaourtière at Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:07.217546687Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:164 (EnergyMonitoringHandler.calculateEnergyFromIndex) Finished calculating consumption from index for 31 devices
2026-08-22T09:30:07.253029354Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:26 (EnergyMonitoringHandler.calculateEnergyFromIndex) Calculating production from index in timezone Europe/Paris for window Sat Aug 22 2026 11:30:00 GMT+0200 (Central European Summer Time)
2026-08-22T09:30:07.279138340Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:35 (EnergyMonitoringHandler.calculateEnergyFromIndex) Found 0 energy devices
2026-08-22T09:30:07.280068380Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:66 (EnergyMonitoringHandler.calculateEnergyFromIndex) Found 0 devices with both INDEX and thirty-minutes-production features
2026-08-22T09:30:07.281260041Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateEnergyFromIndex.js:164 (EnergyMonitoringHandler.calculateEnergyFromIndex) Finished calculating production from index for 0 devices
2026-08-22T09:30:07.307269461Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateCostFrom.js:34 (EnergyMonitoringHandler.calculateCostFrom) Calculating cost in timezone Europe/Paris
2026-08-22T09:30:07.657529925Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateCostFrom.js:38 (EnergyMonitoringHandler.calculateCostFrom) Found 25 energy devices
2026-08-22T09:30:07.727225210Z 2026-08-22T11:30:07+0200 <info> energy-monitoring.calculateCostFrom.js:126 () Device 90ce8dc9-b3ac-48fe-8940-841d6aeee0c1 has tempo prices and Map is empty, getting EDF tempo historical
2026-08-22T09:30:07.730060633Z 2026-08-22T11:30:07+0200 <info> contracts.buildEdfTempoDayMap.js:19 (buildEdfTempoDayMap) Building EDF tempo historical map from 2026-08-21
2026-08-22T09:30:07.740101623Z 2026-08-22T11:30:07+0200 <info> contracts.buildEdfTempoDayMap.js:52 (buildEdfTempoDayMap) All 2 EDF tempo days found in cache (from 2026-08-21 to 2026-08-22)
2026-08-22T09:30:07.811619887Z 2026-08-22T11:30:07+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 40dd1280-6d50-4580-83c8-e494c08f37dc.
2026-08-22T09:30:07.978401793Z 2026-08-22T11:30:07+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 1ede5f2e-7789-4964-9bc0-9b00ef8cfbe1.
2026-08-22T09:30:08.133414395Z 2026-08-22T11:30:08+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = ced1c552-2d2a-4119-a9fe-7be34f5a6d17.
2026-08-22T09:30:08.347691854Z 2026-08-22T11:30:08+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = aaba2941-6ff0-49a5-9204-d5018fc7b0bd.
2026-08-22T09:30:08.667566479Z 2026-08-22T11:30:08+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 4b5f49fb-70f6-4a95-ab71-0b5cbaf1f74b.
2026-08-22T09:30:08.879626460Z 2026-08-22T11:30:08+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 5b6f48cd-6295-4c12-abdc-1b46421e6fca.
2026-08-22T09:30:09.123264891Z 2026-08-22T11:30:09+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 79e1d044-f7c3-4dfd-9798-628efd4a0ee4.
2026-08-22T09:30:09.563066324Z 2026-08-22T11:30:09+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = f4bdabde-f137-408f-8fb3-7f432271ad90.
2026-08-22T09:30:09.850078635Z 2026-08-22T11:30:09+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 896b973e-85da-4247-a844-a1e994e342b9.
2026-08-22T09:30:10.138206342Z 2026-08-22T11:30:10+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 8d70db63-979d-4ba1-8d07-01fbe3609f28.
2026-08-22T09:30:10.388330818Z 2026-08-22T11:30:10+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = d76b8b99-3807-4d2c-becc-ca5377e224b4.
2026-08-22T09:30:10.674524141Z 2026-08-22T11:30:10+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = b9c0b21c-1c21-4446-8ad7-535dfc81b67c.
2026-08-22T09:30:10.949199606Z 2026-08-22T11:30:10+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 09d39d7e-5204-4ab4-afda-394a8f4d9b48.
2026-08-22T09:30:11.262557972Z 2026-08-22T11:30:11+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 212a6b8e-eb39-443e-8325-c741a7816eba.
2026-08-22T09:30:11.544134344Z 2026-08-22T11:30:11+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = d4d7c6cb-080b-41c7-b5b2-076825cb382a.
2026-08-22T09:30:11.841341537Z 2026-08-22T11:30:11+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = cffc3961-c3db-40c9-941a-1ffe9d36f26a.
2026-08-22T09:30:12.118171491Z 2026-08-22T11:30:12+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 178ef579-31c3-4e94-8a58-31cb2f6bee42.
2026-08-22T09:30:12.359589117Z 2026-08-22T11:30:12+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = e796720b-19a1-4e71-b2ee-420978d504e1.
2026-08-22T09:30:12.600363037Z 2026-08-22T11:30:12+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 56908815-e60a-4e14-b586-7d56a07fb430.
2026-08-22T09:30:12.863408289Z 2026-08-22T11:30:12+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 2a43d6b1-63cf-47c1-a3d1-2b4a2ea968bb.
2026-08-22T09:30:13.156550321Z 2026-08-22T11:30:13+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 59e123c8-3d0b-454e-a20a-e90b8deeda12.
2026-08-22T09:30:13.416077142Z 2026-08-22T11:30:13+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = fb4134df-a7c8-4f8b-83bf-8517e1df2c76.
2026-08-22T09:30:13.701174320Z 2026-08-22T11:30:13+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = d8cfb77f-5979-414e-aa32-4f548b5f92cd.
2026-08-22T09:30:13.957885319Z 2026-08-22T11:30:13+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 3efa0164-afce-4277-9a48-9e923dd7bdf0.
2026-08-22T09:30:14.227498093Z 2026-08-22T11:30:14+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = d9964116-b5e1-4c5b-9167-816e938e2d76.
2026-08-22T09:30:14.500695100Z 2026-08-22T11:30:14+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = fc550b4f-b17e-4b70-af16-e1995e019c96.
2026-08-22T09:30:14.924357684Z 2026-08-22T11:30:14+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 10999f49-2cb9-4219-9979-33c2d6919a7f.
2026-08-22T09:30:15.189534575Z 2026-08-22T11:30:15+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 9355ea88-d340-4a39-846f-737fafe60209.
2026-08-22T09:30:15.511661892Z 2026-08-22T11:30:15+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 39aa6cef-00b0-4218-b4eb-4c1f9bb718de.
2026-08-22T09:30:15.716199233Z 2026-08-22T11:30:15+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 55e325ef-8c54-4481-9213-23cc83985109.
2026-08-22T09:30:15.935813191Z 2026-08-22T11:30:15+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 774b17c5-2c8d-48eb-b982-eb744fc8556f.
2026-08-22T09:36:26.225531844Z 2026-08-22T11:36:26+0200 <info> enedis.sync.js:44 (recursiveBatchCall) Enedis: Syncing 06558900066149 after 2026-08-14
2026-08-22T09:36:27.589366968Z 2026-08-22T11:36:27+0200 <info> enedis.sync.js:44 (recursiveBatchCall) Enedis: Syncing 06558900066149 after 2026-08-15
2026-08-22T09:37:02.248453741Z 2026-08-22T11:37:02+0200 <info> energy-monitoring.calculateCostFrom.js:34 (EnergyMonitoringHandler.calculateCostFrom) Calculating cost in timezone Europe/Paris
2026-08-22T09:37:02.743256593Z 2026-08-22T11:37:02+0200 <info> energy-monitoring.calculateCostFrom.js:38 (EnergyMonitoringHandler.calculateCostFrom) Found 25 energy devices
2026-08-22T09:37:03.158032208Z 2026-08-22T11:37:03+0200 <info> energy-monitoring.calculateCostFrom.js:126 () Device 90ce8dc9-b3ac-48fe-8940-841d6aeee0c1 has tempo prices and Map is empty, getting EDF tempo historical
2026-08-22T09:37:03.160061894Z 2026-08-22T11:37:03+0200 <info> contracts.buildEdfTempoDayMap.js:19 (buildEdfTempoDayMap) Building EDF tempo historical map from 2026-08-14
2026-08-22T09:37:03.176366583Z 2026-08-22T11:37:03+0200 <info> contracts.buildEdfTempoDayMap.js:52 (buildEdfTempoDayMap) All 9 EDF tempo days found in cache (from 2026-08-14 to 2026-08-22)
2026-08-22T09:37:20.652322833Z 2026-08-22T11:37:20+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 40dd1280-6d50-4580-83c8-e494c08f37dc.
2026-08-22T09:37:40.882913002Z 2026-08-22T11:37:40+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 1ede5f2e-7789-4964-9bc0-9b00ef8cfbe1.
2026-08-22T09:38:01.521148847Z 2026-08-22T11:38:01+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = ced1c552-2d2a-4119-a9fe-7be34f5a6d17.
2026-08-22T09:38:21.143400676Z 2026-08-22T11:38:21+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = aaba2941-6ff0-49a5-9204-d5018fc7b0bd.
2026-08-22T09:38:42.168250001Z 2026-08-22T11:38:42+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 4b5f49fb-70f6-4a95-ab71-0b5cbaf1f74b.
2026-08-22T09:39:04.045789281Z 2026-08-22T11:39:04+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 5b6f48cd-6295-4c12-abdc-1b46421e6fca.
2026-08-22T09:39:25.250822208Z 2026-08-22T11:39:25+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 79e1d044-f7c3-4dfd-9798-628efd4a0ee4.
2026-08-22T09:39:47.151292427Z 2026-08-22T11:39:47+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 07cf603e-3c3b-4ecc-9ce4-87f2f16cbaef.
2026-08-22T09:40:09.032173230Z 2026-08-22T11:40:09+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = f4bdabde-f137-408f-8fb3-7f432271ad90.
2026-08-22T09:40:29.630179715Z 2026-08-22T11:40:29+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 896b973e-85da-4247-a844-a1e994e342b9.
2026-08-22T09:40:50.552164640Z 2026-08-22T11:40:50+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 8d70db63-979d-4ba1-8d07-01fbe3609f28.
2026-08-22T09:41:11.882783690Z 2026-08-22T11:41:11+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = d76b8b99-3807-4d2c-becc-ca5377e224b4.
2026-08-22T09:41:32.863451901Z 2026-08-22T11:41:32+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = b9c0b21c-1c21-4446-8ad7-535dfc81b67c.
2026-08-22T09:41:53.347144646Z 2026-08-22T11:41:53+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 09d39d7e-5204-4ab4-afda-394a8f4d9b48.
2026-08-22T09:42:14.273207632Z 2026-08-22T11:42:14+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 212a6b8e-eb39-443e-8325-c741a7816eba.
2026-08-22T09:42:35.269890234Z 2026-08-22T11:42:35+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = d4d7c6cb-080b-41c7-b5b2-076825cb382a.
2026-08-22T09:42:55.110720580Z 2026-08-22T11:42:55+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = cffc3961-c3db-40c9-941a-1ffe9d36f26a.
2026-08-22T09:43:16.626924625Z 2026-08-22T11:43:16+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 178ef579-31c3-4e94-8a58-31cb2f6bee42.
2026-08-22T09:43:39.205060304Z 2026-08-22T11:43:39+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = e796720b-19a1-4e71-b2ee-420978d504e1.
2026-08-22T09:43:49.392672455Z 2026-08-22T11:43:49+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 56908815-e60a-4e14-b586-7d56a07fb430.
2026-08-22T09:44:08.730355351Z 2026-08-22T11:44:08+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 2a43d6b1-63cf-47c1-a3d1-2b4a2ea968bb.
2026-08-22T09:44:30.020353087Z 2026-08-22T11:44:30+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 59e123c8-3d0b-454e-a20a-e90b8deeda12.
2026-08-22T09:44:50.917166245Z 2026-08-22T11:44:50+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = fb4134df-a7c8-4f8b-83bf-8517e1df2c76.
2026-08-22T09:45:12.317759412Z 2026-08-22T11:45:12+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = d8cfb77f-5979-414e-aa32-4f548b5f92cd.
2026-08-22T09:45:32.845566956Z 2026-08-22T11:45:32+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 3efa0164-afce-4277-9a48-9e923dd7bdf0.
2026-08-22T09:45:54.535325404Z 2026-08-22T11:45:54+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = d9964116-b5e1-4c5b-9167-816e938e2d76.
2026-08-22T09:46:16.206679888Z 2026-08-22T11:46:16+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = fc550b4f-b17e-4b70-af16-e1995e019c96.
2026-08-22T09:46:36.348576345Z 2026-08-22T11:46:36+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 10999f49-2cb9-4219-9979-33c2d6919a7f.
2026-08-22T09:46:57.605137190Z 2026-08-22T11:46:57+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 9355ea88-d340-4a39-846f-737fafe60209.
2026-08-22T09:47:19.496451604Z 2026-08-22T11:47:19+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 39aa6cef-00b0-4218-b4eb-4c1f9bb718de.
2026-08-22T09:47:41.892196972Z 2026-08-22T11:47:41+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 55e325ef-8c54-4481-9213-23cc83985109.
2026-08-22T09:47:43.000018861Z 2026-08-22T11:47:42+0200 <info> scene.triggers.js:91 (Object.device.new-state) Scheduling timer to check for device_feature "zigbee2mqtt-sonde-t-frigo-cuisine-temperature-sensor-decimal-temperature" state in 900000ms
2026-08-22T09:48:03.662680063Z 2026-08-22T11:48:03+0200 <info> index.js:369 () DuckDB : Inserting chunk 0 for deviceFeature = 774b17c5-2c8d-48eb-b982-eb744fc8556f.

Here are some observations/questions I have:

  • My sync doesn’t start from scratch each time. The date is August 14, 8 days ago. OK
  • Phase 1 takes 36 seconds, so that’s fine. This would mean that phase 2 lasts more than 10 minutes. Are the various « Inserting chunk 0 » entries from 11:30 to 11:48 a sign of this?
  • I have several lines indicating the number of ‹ found devices ›, but with different values: 79, 31, 0, 0, 25, 25, 25. Is this normal?
  • I don’t know if it’s normal that there seem to be 2 overlapping cycles: the « Enedis: syncing » appears twice, as does the « Calculating cost »

Thanks in advance for your help

@pierre-gilles I imagine you’re very focused on preparing Gladys v5, but if you have the chance to look at the logs I collected following your last message, I’d appreciate your advice… Thanks in advance.

Hi everyone!

This topic is now under development.

A PR has been opened to only recalculate energy costs for devices actually impacted by an Enedis sync (and thus avoid hourly slowdowns):

Don’t hesitate to follow the PR, to test (optional, especially for small requests) and to share your feedback here if needed.

WTF ? :flushed_face: :partying_face:

Hi @StephaneB, thanks for the logs!

Verdict: it is indeed phase 2 (the cost recalculation), and your log proves it alone.

The exact sequence of your window 11:30 → 11:48

There are two different tasks in your log, and their comparison is enlightening:

Time What’s running Duration
11:30:00 → 11:30:07 Consumption calculation from indexes (31 index/30-min pairs) 7 s
11:30:07 Production calculation from indexes (0 device) Instantaneous
11:30:07 → 11:30:15 Cost recalculation, 25 devices, window = 30 minutes 8 s :white_check_mark:
11:36:26 → 11:36:27 Enedis, daily consumption, since 14/08 (8 points) 1 s
11:36:27 → 11:37:02 Enedis, load curve, since 15/08 (384 points) 35 s
11:37:02 → 11:48:03 Cost recalculation, 25 devices, window = 8 days 11 min :cross_mark:

The same code, the same 25 devices, executed twice with a 7-minute interval: 8 seconds in one case, 11 minutes in the other. The only variable is the width of the recalculated window: 30 minutes against 8 days.

And 11:36:26 → 11:48:03 = 11 min 40, which matches the ~12 min displayed on the task.

By the way, the 36 s of phase 1 are normal and intentional: Gladys inserts the load curve points with a 50 ms delay between each to avoid overloading the CPU during import. 384 points × 50 ms ≈ 35 s. That’s exactly what we see. Nothing to correct on this side.

Your 4 questions

1. « My sync does not restart from zero » — Correct, no issues here. after 2026-08-14, it is indeed the last synchronized date minus 7 days. The bug I feared is not there.

Small clarification: if you see two different dates (14/08 then 15/08), it is not an anomaly — these are your two Enedis features (daily consumption and load curve) each keeping their own last sync date.

2. « Are the Inserting chunk 0 signs? » — Yes, it is exactly the right marker, but be careful not to mix the two blocks:

  • 31 lines between 11:30:07 and 11:30:15 → the routine task. ~0.25 s per feature.
  • 32 lines between 11:37:20 and 11:48:03 → the recalculation triggered by Enedis. ~20 s per feature.

Relative to the number of points processed (384 load curve points over 8 days against 1 over 30 minutes), that’s about 55 ms per recalculated point. That’s too much, and it’s on my end now.

3. The different « Found N » (79 / 31 / 0 / 0 / 25…) — Everything is normal, these are counters that do not count the same thing:

  • 79 = devices with a feature of category energy_sensor, switch or teleinformation (the broad pool where we look for indexes).
  • 31 = among them, the number of pairs « index ↔ 30-minutes » connected to each other. Note that the message says « devices » but actually counts pairs of features — that’s why « Compteur Zlinky » appears 7 times in a row right after: your Zlinky exposes several indexes (EASF01…EASF10 for Tempo).
  • 0 / 0 = the same on the production side. You don’t have a production index declared (your panels are tracked via a plug, so on the consumption side), so 0. Normal.
  • 25 = the cost recalculation filter, which is more restrictive (only the energy_sensor category). This line appears once per cost recalculation — hence its repetition.

4. « Two overlapping cycles? » — No, rest assured, and it’s even impossible: everything goes through a queue that serializes the processes. What you see are two distinct tasks:

  • the one at 11:30, scheduled every 30 minutes (at HH:00 and HH:30);
  • the one at 11:36, the hourly Enedis sync, which calls the cost recalculation at the end.

Both call the same function, hence the duplicate lines.

Why 11 minutes for you and 5 seconds for @PhilippeMA

Because the post-sync recalculation does not take into account what has actually changed, nor the size of the installation:

  • it starts from the oldest date resynchronized, so always ~D-8 (due to the 7-day safety net);
  • and it replays all your energy devices, not just Enedis.

For you, that’s ~33 cost features × 8 days × 48 points, so about 12,000 points deleted, recalculated, and reinserted every hour — while only the Enedis feature has received new data. For Philippe, with one or two devices, the same process goes unnoticed.

You are not doing anything wrong: you are just the first to have a large enough installation to make the problem visible.

What I will fix

This is a real design flaw, not a problem with your installation.

I proposed a PR with:

  1. Only recalculate what has moved: after an Enedis sync, only the features actually impacted should be retaken, not the entire fleet.
  2. Only recalculate the days actually modified, instead of a fixed 8-day window for each cycle.
  3. Optimize the internal loop (the 55 ms per point): the validity periods of the rates are rebuilt with time zone conversion for each point, when they could be done only once.
  4. Bring phase 2 up in the progress bar: today it only follows the download, hence the task that remains « in progress » at 100% for 10 minutes.

Thanks for the analysis and relieved to know there will be a solution! And I am therefore even more eager to discover the next version :wink: