Translated from Türkçe by AI ·
You already have PZEM’s own counter, energy_wh. Use it, don’t bother deriving energy from watts. I went through the same thing when I measured my fridge at home with the same module.In the Chart card, select the energy_wh key, bucket 1 day (1d), aggregate increase. increase is meant for counter-type values: it subtracts the last value of the previous bucket from the last value of each bucket. If the counter goes down (if you reset the PZEM or it rolls over at 9999 kWh), it counts that bucket as if it started from zero, so you won’t see a negative value.The advantage is this: even if the ESP32 drops off for a while, the counter keeps counting on the PZEM, and when it reconnects the energy difference in between isn’t lost. avg × 24 loses that gap.I think the midnight split you mentioned is this: day buckets are cut according to UTC, midnight to midnight UTC. Since Turkey is UTC+3, your “day” appears to start at 03:00 local time. If you write one line about this in the report, it won’t be a problem.If you also want a derived key in the stream (for example the difference at each reading), there is a Delta block, but it isn’t needed for a daily total. Both are explained here: Derived values.
Elinde zaten PZEM’in kendi sayacı var, energy_wh. Onu kullan, watt’tan enerji türetmekle uğraşma. Ben aynı modülle evdeki buzdolabını ölçerken aynı şeyi yaşadım.
Chart kartında energy_wh anahtarını seç, kova olarak 1 gün (1d), aggregate olarak increase. increase sayaç tipi değerler için var: her kovanın son değerinden bir önceki kovanın son değerini çıkarıyor. Sayaç geri düşerse (PZEM’i resetlersen ya da 9999 kWh’de dönerse) o kovada sıfırdan başlamış gibi sayıyor, yani eksi değer görmezsin.
Avantajı şu: ESP32 bir süre koparsa bile sayaç PZEM’de saymaya devam ediyor, tekrar bağlandığında aradaki enerji farkı kaybolmuyor. avg × 24’te o boşluk kayıp.
Gece yarısı bölünme dediğin şey de bence şu: gün kovaları UTC’ye göre kesiliyor, gece yarısından gece yarısına UTC. Türkiye UTC+3 olduğu için senin “gün”ün sabah 03:00’te başlıyor gibi görünür. Rapora bunu bir satırla yazarsan sorun olmaz.
Akış içinde ayrıca bir türetilmiş anahtar istersen (mesela her okumadaki fark) Delta bloğu da var, ama günlük toplam için gerek yok. Burada ikisi de anlatılıyor: Türetilmiş değerler.

