New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

How can I see my smart plugs' standby consumption as daily Wh?

How can I see my smart plugs' standby consumption as daily Wh?

Solved 5 4

Translated from Türkçe by AI ·

Hello, for my graduation project I set up an experiment in my room in the dorm. I may be posting in the wrong subforum, sorry about that. The topic: I want to measure how much cheap smart plugs draw by themselves even when the relay is off. My advisor said “measure it and bring me the graph”, and that’s all.Setup: ESP32 + PZEM-004T v3.0 (UART, 9600 baud), with 3 different plugs that I connected one after another behind the PZEM and measured. The ESP32 sends this to Hermetry over MQTT every 10 seconds:

{"power_w": 0.9, "voltage_v": 228.4, "current_a": 0.012, "energy_wh": 1532}

I can see the watt value on the graph, no problem. But I need daily energy (Wh/day). In the Chart card I used sum as the aggregate, and for power_w it gave a crazy number like 7700 for one day. A 0.9 W plug can’t use 7700 Wh a day, surely 🙂 With avg I get 0.9. If I multiply that by 24, is that correct, or is there a neater way?Also, the midnight measurements seem to split oddly, but I think that’s a separate topic.

♥ 0

Translated from Türkçe by AI ·

Summing watts with sum doesn’t give energy, you’re adding up each 10-second reading. 8640 readings per day × 0.9 W ≈ 7776, that’s where the number comes from.

♥ 0

Translated from Türkçe by AI ·

Oh right, so I’m multiplying by 8640. Then should I do avg × 24? I need to explain the formula in the report, my supervisor will ask “why”.

♥ 0

Translated from Türkçe by AI ·

avg × 24 is a rough estimate, but with one condition: the readings must arrive regularly. Hermetry’s avg is not time-weighted. It is the plain mean of the readings within a bucket. If the ESP32 drops off Wi-Fi for half an hour, that half hour is not counted at all, and if readings arrive in a rush after it reconnects, those minutes get too much weight.By the way, I work on the energy side. With the relay off, seeing 0.4 to 1.2 W on these plugs is normal. The Wi-Fi module stays on all the time. So a reading of 0.9 on yours is reasonable.

♥ 1

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.

Ağ geçidi yine bağlanıyor…
Accepted solution♥ 2

Translated from Türkçe by AI ·

It worked! With increase, plug 1 gave 21.4 Wh/day, plug 2 gave 11.8, and plug 3 gave 27.3. I had computed 21.6 with avg × 24, which was close, but plug 2 had an hour-long disconnection in between, and there the difference was up to 2 Wh. I also noted the UTC issue in the report. Many thanks 🙏

♥ 2
Viewing 6 posts – 1 through 6 (of 6 total)
  • 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.

Share