Pulse sayan bir ESP32 ile Landis+Gyr sayacımızdan haftalık doğalgaz kullanımı, her Pazartesi finans ekibine e-postayla gönderiliyor
Yapay zekâ tarafından English dilinden çevrildi ·
Fabrika müdürü, otomotiv boya atölyesi. Finans ekibi her Pazartesi saat 7’de boya fırınları için haftalık bir doğalgaz değeri istiyor; şu an biri her Pazar gecesi sayacı elle okuyor. Pek iyi bir durum değil.Sayaç, reed darbe çıkışına sahip bir Landis+Gyr diyaframlı sayaç; 1 darbe = 0,01 m³. Bakım ekibimizden biri bunun üzerine, darbeleri kesme ile sayan ve çalışan toplamı dakikada bir yayınlayan bir ESP32 taktı:
{"gas_m3": 18234.57}
Bu bir aydır Hermetry’de çalışıyor ve grafik doğru görünüyor. Bir yerde haftalık toplamı e-postayla gönderen zamanlanmış bir rapor olduğunu varsaydım, ama her şeye baktım ve bulamadım. İnsanlar bunun için ne yapıyor? Her Pazartesi birinin CSV dışa aktarmasını istemem; kurtulmaya çalıştığım şey tam da bu.
Plant manager, automotive paint shop. Finance wants a weekly gas figure for the paint ovens every Monday at 7, and right now someone reads the meter by hand on Sunday night. Not great.
The meter is a Landis+Gyr diaphragm meter with a reed pulse output, 1 pulse = 0.01 m³. One of our maintenance guys put an ESP32 on it that counts pulses on an interrupt and publishes the running total once a minute:
{"gas_m3": 18234.57}
That’s been in Hermetry for a month and the chart looks right. I assumed there’d be a scheduled report somewhere that mails a weekly total, but I’ve clicked through everything and can’t find one. What do people do for this? I’d rather not have a person export a CSV every Monday, that’s the thing I’m trying to get rid of.
Yapay zekâ tarafından English dilinden çevrildi ·
Ben de bunu öğrenmek isterim, binalarımızın gaz sayaçları için de aynı durum geçerli.
I’d like to know too, same thing for our buildings’ gas meters.
Yapay zekâ tarafından English dilinden çevrildi ·
Darbe toplamı elektrik kesintisinde korunuyor mu? ESP32 bir kesintiden sonra sıfırdan başlarsa haftalık toplamlarınız yanlış çıkar.
Is the pulse total kept over a power cut? If the ESP32 starts from zero after an outage your weekly totals go wrong.
Yapay zekâ tarafından English dilinden çevrildi ·
Veri FRAM’de saklanıyor, elektrik kesintilerinden etkilenmiyor. Yalnızca yeni firmware yüklediğimizde sıfırlanıyor.
It’s stored in FRAM, survives power cuts. It only goes back to zero when we flash new firmware.
Yapay zekâ tarafından English dilinden çevrildi ·
Panolarda bir “raporu gönder” seçeneği olduğunu düşünmüştüm?
I thought there was a “send report” option on dashboards?
Yapay zekâ tarafından English dilinden çevrildi ·
Bence öyle değil. Verileri dışa aktarma sayfasında, yerleşik zamanlanmış veya e-posta ile gönderilen rapor bulunmadığı yazıyor. Kartlarda CSV ve Excel indirme seçeneği var, ancak bunun için birinin tıklaması gerekiyor.
I don’t think so. The Exporting data page says there are no built-in scheduled or e-mailed reports. Cards have a CSV and Excel download, but that’s someone clicking.
Yapay zekâ tarafından English dilinden çevrildi ·
Banerjee haklı, e-posta ile gönderilen bir rapor yok. Bunu yaklaşık 20 enerji sayacı için kendi sunucumuzda çalışan küçük bir betikle yapıyoruz; betik geçmiş verileri sunan API üzerine kurulu. Yarım günlük bir iş ve bir yıldır dokunulmadan çalışıyor.Bir increase toplama işlevi isteyin. gas_m3 gibi bir sayaç için her zaman aralığında ne kadar arttığını verir ve sayaç sıfırlanırsa (firmware yüklemeniz gibi) eksiye düşmek yerine sıfırdan saymaya devam eder.
import requests, time, smtplib
from email.message import EmailMessage
BASE = "https://<host>/tenant/<tenantId>"
KEY = "sk_live_..." # Read-only telemetry key, IP allowlist = this server
now = int(time.time() * 1000)
week_ago = now - 7 * 24 * 3600 * 1000
r = requests.get(BASE + "/api/telemetry/series", headers={"Authorization": "Bearer " + KEY},
params={"kind": "iot_device", "entityId": "<meter device id>", "keys": "gas_m3",
"from": week_ago, "to": now, "bucket": "1h", "agg": "increase"}, timeout=30)
r.raise_for_status()
# sum the hourly increases and mail the total to finance
Betiği Pazartesi günleri saat 07:00’de cron ile çalıştırın. Öğrendiklerimiz:
- Gün aralıkları UTC günleridir. Finans yerel günleri istiyorsa 1h isteyip saatlik değerleri kendiniz toplayın.
- API anahtarına Read-only ön ayarını verin ve IP allowlist’e yalnızca bu sunucuyu ekleyin. Anahtarlar varsayılan olarak 90 gün sonra sona erer; bir hatırlatıcı kurun ya da daha uzun bir süre (en fazla bir yıl) seçin.
- Anahtar başına istek başına en fazla 50 anahtar ve 10.000 nokta vardır; haftalık saatlik okuma için bu bile fazlasıyla yeterli.
Bir sunucu çalıştırmak istemiyorsanız, bir Schedule tetikleyicisi ve bir HTTP isteği bloğu içeren bir akış, kendi raporlama servisinizi çağırarak raporu oluşturup gönderebilir. Biz betiği tercih ettik.Exporting data her iki seçeneği de listeler.
Banerjee’s right, there’s no mailed report. We do this for about 20 energy meters with a small script on our own server, built on the history API. It’s half a day of work and has run untouched for a year.
Ask for the increase aggregate. For a counter like gas_m3 it gives you how much it rose per bucket, and it handles a counter restart (your firmware flash) by counting from zero instead of going negative.
import requests, time, smtplib
from email.message import EmailMessage
BASE = "https://<host>/tenant/<tenantId>"
KEY = "sk_live_..." # Read-only telemetry key, IP allowlist = this server
now = int(time.time() * 1000)
week_ago = now - 7 * 24 * 3600 * 1000
r = requests.get(BASE + "/api/telemetry/series", headers={"Authorization": "Bearer " + KEY},
params={"kind": "iot_device", "entityId": "<meter device id>", "keys": "gas_m3",
"from": week_ago, "to": now, "bucket": "1h", "agg": "increase"}, timeout=30)
r.raise_for_status()
# sum the hourly increases and mail the total to finance
Run it from cron at 07:00 on Mondays. A few things we learned:
- Day buckets are UTC days. If finance wants local days, ask for 1h and add them up yourself.
- Give the API key the Read-only preset and an IP allowlist with just that server. Keys expire after 90 days by default, so set a reminder or a longer expiry (max a year).
- At most 50 keys and 10,000 points per key per request, which is nothing for a weekly hourly read.
If you’d rather not run a server, a flow with a Schedule trigger and an HTTP request block can poke your own reporting service to build and send it. We went with the script.
Exporting data lists both options.
Yapay zekâ tarafından English dilinden çevrildi ·
Geçen haftadan beri, vardiya raporlarımızı zaten üreten raporlama kutusunda çalışıyor. İlk Pazartesi değer biraz yanlıştı çünkü 1d aralıklarını kullanmıştım ve yaz saatine yeni geçmiştik; 1h aralıklarına geçtim ve manuel okumayla 0,1 m³ hassasiyetle eşleşiyor. Finans memnun, artık pazar gecesi kimse sayacı okumuyor.
Running since last week on the reporting box that already does our shift reports. First Monday the figure was off a little because I used 1d buckets and we’d just moved to summer time, switched to 1h buckets and it matches the manual reading to 0.1 m³. Finance is happy, and nobody reads the meter on Sunday night anymore.
Yapay zekâ tarafından English dilinden çevrildi ·
Aynı yöntem su sayaçlarında da işe yarıyor. Ay ortasında bir sayaç değiştirildiğinde ve yenisi 0’dan başladığında increase bizi kurtardı.
Same pattern works for water meters. increase saved us when a meter was swapped mid-month and the new one started at 0.
- Bu konuyu yanıtlamak için giriş yapmış olmalısınız.
Sohbete katılın
Soru sormak ve yanıtlamak, yararlı gönderileri beğenmek ve sorununuzu çözen yanıtı işaretlemek için oturum açın. Her katkı puan ve seviye kazandırır.

