Measuring compressor current with ESP32 and producing a monthly kWh report: which sensor, and where does the report come from?
Translated from Türkçe by AI ·
Hi, I’m not sure if this is the right subforum, but since the end goal is a report, I wrote here.In the factory (pharmaceutical production) we want to see how much energy two screw compressors and an AHU fan consume. At month end, management wants a table showing “which machine consumed how much”. I have an ESP32 DevKit, and I’m already sending temperature to Hermetry over MQTT. That part works.I’m stuck on two things:1) What should I measure the current with? ACS712 or SCT-013 clamp type? The compressor is 3-phase 400V, ~38A. I can’t cut cables and insert anything into the panel because it is validated equipment.2) Once I’ve measured it, can I get the monthly kWh report automatically by e-mail? Is there a ready-made report feature? I couldn’t find one.
Selam, doğru alt forum mu emin değilim, işin sonu rapor olduğu için buraya yazdım.
Fabrikada (ilaç üretimi) iki vidalı kompresörün ve bir AHU fanının ne kadar enerji yediğini görmek istiyoruz. Yönetim ay sonunda “hangi makine ne kadar tüketti” tablosu istiyor. Elimde ESP32 DevKit var, Hermetry’ye MQTT ile sıcaklık zaten gönderiyorum, o kısım çalışıyor.
Takıldığım iki şey var:
1) Akımı neyle ölçeyim? ACS712 mi, SCT-013 pens tipi mi? Kompresör 3 faz 400V, ~38A. Panoya kablo kesip bir şey sokmam mümkün değil, validasyonlu ekipman.
2) Ölçtükten sonra aylık kWh raporunu otomatik mail ile alabilir miyim? Hazır bir rapor özelliği var mı, bulamadım.
Translated from Türkçe by AI ·
If you can’t cut the cable, the ACS712 is already ruled out, it connects in series. An SCT-013 clamp goes around the phase conductor and you don’t touch anything. At our pump stations we fitted one on each of the 3 phases.
Kablo kesemiyorsan ACS712 zaten elendi, o seri bağlanıyor. SCT-013 pens, faz iletkeninin etrafına takıyorsun, hiçbir şeye dokunmuyorsun. Biz pompa istasyonlarında 3 fazın her birine birer tane taktık.
Translated from Türkçe by AI ·
Wouldn’t it be fine to clamp on one phase and multiply by three? I’m curious, does it really make a difference if the load is balanced?
Tek faza takıp üçle çarpsak olmaz mı? Merak ettim, yük dengeliyse fark eder mi gerçekten?
Translated from Türkçe by AI ·
With a balanced motor load it gives a roughly correct result, but when the compressor switches between unloaded and loaded, the cosφ changes, and current × voltage does not give you the real power anyway. It’s fine for a rough estimate.
Dengeli motor yükünde yaklaşık doğru çıkar ama kompresör yüksüz/yüklü geçiş yapınca cosφ değişiyor, akım×gerilim sana gerçek gücü vermez zaten. Kaba tahmin için tamam.
Translated from Türkçe by AI ·
For the report part: I think Hermetry itself sends the monthly report by e-mail; I remember there is a scheduled report setting.
Rapor kısmı için: Hermetry bence aylık raporu kendisi mail atıyordur, zamanlanmış rapor ayarı vardır diye hatırlıyorum.
Translated from Türkçe by AI ·
Hakan, check the documentation, there is nothing like that. Hermetry has no scheduled or e-mailed ready-made report, it is stated clearly. But the approach that works today is this, we did exactly that at a textile factory:Measurement: for 38A, get an SCT-013-050 (1V output), connect it to the ESP32’s ADC with a 1.65V bias, and do the EmonLib-like RMS calculation on the device. Have the device send current_a every 30 seconds. If you want real kWh, you will need an energy analyzer with Modbus on a DIN rail. Accept a 10% error margin with clamp-on meter + estimated cosφ.Power and energy: in the root flow, put a Calculate block before Save telemetry and derive power_kw. Details are on the derived values page.
expr: round(1.732 * 400 * msg.payload.current_a * 0.85 / 1000, 2)
target: msg.payload.power_kw
Report: put a chart card on the dashboard, set grouping to day, and in the card settings tick Download data (CSV). At month end, set the window to This month and download the Excel file. If you want it automated, a small script can pull the daily values from the history API with agg=sum, or with increase if you are sending a counter, and you send the e-mail yourself.
Hakan, dokümana bak, öyle bir şey yok. Hermetry’de zamanlanmış ya da e-postayla giden hazır rapor yok, açıkça yazıyor. Ama bugün çalışan yol şu, biz aynısını bir tekstil fabrikasında yaptık:
Ölçüm: 38A için SCT-013-050 (1V çıkışlı) al, ESP32’de ADC’ye 1.65V bias ile bağla, EmonLib benzeri RMS hesabını cihazda yap. Cihaz her 30 saniyede bir current_a göndersin. Gerçek kWh istiyorsan DIN raya Modbus’lı bir enerji analizörü takman gerekir. Pens + tahmini cosφ ile %10 hata payını kabul et.
Güç ve enerji: root flow’da Save telemetry’den önce bir Calculate bloğu koy, power_kw türet. Detayı türetilmiş değerler sayfasında var.
expr: round(1.732 * 400 * msg.payload.current_a * 0.85 / 1000, 2)
target: msg.payload.power_kw
Rapor: panoya bir chart kartı koy, gruplamayı gün yap, kartın ayarlarında Download data (CSV) işaretle. Ay sonunda pencereyi Bu ay yapıp Excel indiriyorsun. Otomatik istiyorsan küçük bir script history API’den agg=sum ya da sayaç gönderiyorsan increase ile günlük değerleri çekip maili kendin atarsın.
Translated from Türkçe by AI ·
Okay, I’ve ordered the SCT-013-050. I derived power_kw with Calculate and it gave the correct output in the test message. For the mail part, for now we download the Excel and send it manually, since it happens only once at month end, so it’s not a problem. I noted to management that this is an “estimated value”, and we’ve moved the analyzer budget to next quarter. Thanks.
Tamamdır, SCT-013-050 siparişini verdim. Calculate ile power_kw türettim, test mesajında doğru çıktı. Mail kısmını şimdilik Excel indirip elle gönderiyoruz, ay sonu bir kere olduğu için sorun değil. Yönetime de “bu tahmini değer” notunu düştüm, analizör bütçesini sonraki çeyreğe yazdık. Sağ olun.
Translated from Türkçe by AI ·
You’re right Esra, I mixed it up with a different product. If you need the History API script, I have a Python example that runs with cron, just let me know.
Haklısın Esra, başka bir üründen karıştırmışım. History API scripti lazım olursa bende cron’la çalışan bir Python örneği var, yazın.
- You must be logged in to reply to this topic.
Join the conversation
Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

