# Energy Meter - energy consumption

**URL:** https://discourse.nodered.org/t/energy-meter-energy-consumption/92751
**Category:** General
**Created:** [28 October 2024 20:17 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751 "2024-10-28T20:17:43Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Tomtom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tomtom](https://discourse.nodered.org/u/Tomtom)
#### Post date: [28 October 2024 20:17 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/1 "2024-10-28T20:17:43Z")

</div>

Hi everyone,  
Is there somewhere a simple node able to act as a virtual energy meter, which could provide the consumption of a device on a daily/monthly/yearly base ?  
I have not find one while searching the forum.  
Thanks a lot

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [29 October 2024 14:22 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/2 "2024-10-29T14:22:03Z")

</div>

What would be the input to the node?

---

<div class="post-metadata">

### Author: ![Tomtom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tomtom](https://discourse.nodered.org/u/Tomtom)
#### Post date: [29 October 2024 21:37 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/3 "2024-10-29T21:37:38Z")

</div>

Watts will be send to this node

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [30 October 2024 07:27 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/4 "2024-10-30T07:27:59Z")

</div>

> [@Tomtom](#):
>
> Is there somewhere a simple node able to act as a virtual energy meter, which could provide the consumption of a device on a daily/monthly/yearly base ?

Since you didn't give a lot of information, I'll ask some questions:

1. You need someway of getting the energy reading. This will depend on the ability to get data from the device that has the measurement. What is the actual device measuring the energy?
2. does the device reading the energy have an API so you can get the data? What is it?
3. does the device support MQTT?
4. Since you want to have monthly and yearly data, you probably want to store each data reading so you can compute the daily. monthly and yearly reading. You might want to store it in a database.
5. Since you want to display the data, you will need a dashboard (use dashboard 2 which is the new dashboard)
6. Do you want to display the numeric value or you looking for a graph of each of the values you want?
7. what version of NR and node.js are you running (you can get this from the startup log)
8. What device are you running NR on?
9. are you using Home Assistant or Docker?

As you can see, you have a lot of decisions to make, research to do and information to provide. If you want help it is best to provide background information, so make sure to answer ALL of the questions asked.

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [30 October 2024 07:47 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/5 "2024-10-30T07:47:35Z")

</div>

**Edit:** Just re-read your original post/question. It sounds like you have already sorted out the sensing as you indicated your are receiving "watts". So correct me if I'm wrong - you are looking for a Node-RED node to process the "watts" to show the consumption over a period of time?

Might be worth looking at this node...

> **[node-red-contrib-watt2kwh](https://flows.nodered.org/node/node-red-contrib-watt2kwh)**
>
> A node-RED node that converts a power feed (watts) to energy (kWh).

Sorry - this might not be relevant to your needs.  
Have you looked at the PZEM-004T (available on AE and Banggood as well as other stores) ?

 ![PZEM-004T](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/0/40bd6194f01fc50a5d788b8e44104fdcddaa0eec.png)  
The split-ring clamp goes around the 'live' cable of the device you want to measure.  
The unit provides a TTL Mod-Bus interface that can be connected to low-cost microcontroller (e.g. ESP32-S2-Mini, ESP32-C3-Super-Mini, etc..) which can be flashed with Tasmota to send the readings to Node-RED using MQTT protocol. Here's a link to one of my old projects.

> [@Need to write one function that will return 3 values](https://discourse.nodered.org/t/need-to-write-one-function-that-will-return-3-values/30931/9):
>
> Yes i am just trying to show real time value on gauge which i received on MQTT, i have used JSON node.. Issue has been resolved, Thank you very much all of you guys. It would be great if anyone help me on making dashboard more attractive. I have attached SS which i had made.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 October 2024 09:48 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/6 "2024-10-30T09:48:22Z")

</div>

> [@Tomtom](#):
>
> Watts will be send to this node

On the assumption that you already have this data available, are you asking how to store several years worth of data and display it in various ways? If so then I recommend looking at Influxdb and, if you want charts, then also Grafana.

---

<div class="post-metadata">

### Author: ![Tomtom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tomtom](https://discourse.nodered.org/u/Tomtom)
#### Post date: [30 October 2024 11:02 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/7 "2024-10-30T11:02:40Z")

</div>

Thanks [zenofmud](https://discourse.nodered.org/u/zenofmud) for your detailed answer.  
Question 1 to 3: all is done already, the data are coming in a payload from a local meter via KNX, send every 20 seconds.  
4. Well, yes and no. I was expecting to find a kind of meter node in order to avoid storing each value after 20 sec.  
5. Dashboard is existing already, I am able to select the numeric data and display in the graph  
7 to 9. V3.9.1 and no need for home assistant, I am equipped already  
Thanks a lot !

---

<div class="post-metadata">

### Author: ![Tomtom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tomtom](https://discourse.nodered.org/u/Tomtom)
#### Post date: [30 October 2024 11:05 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/8 "2024-10-30T11:05:31Z")

</div>

Thanks [dynamicdave](https://discourse.nodered.org/u/dynamicdave), I will have a look to this node, I am receiving the data from my installation already, this is under control. The point is how to meter without having to go in a DB but maybe it is too high challenge and would be better with.

---

<div class="post-metadata">

### Author: ![Tomtom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tomtom](https://discourse.nodered.org/u/Tomtom)
#### Post date: [30 October 2024 11:07 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/9 "2024-10-30T11:07:17Z")

</div>

Maybe an intermediate step to find a node that store for the day, and then record only the daily value will make it lighter for the database, I will check thanks Colin !

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [30 October 2024 11:23 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/10 "2024-10-30T11:23:49Z")

</div>

You can use context storage to save and aggregate the output of watts2kwh [Working with context : Node-RED](https://nodered.org/docs/user-guide/context)

---

<div class="post-metadata">

### Author: ![Tomtom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tomtom](https://discourse.nodered.org/u/Tomtom)
#### Post date: [30 October 2024 11:53 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/11 "2024-10-30T11:53:54Z")

</div>

Thanks E1cid, I will check this 👍

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 October 2024 19:27 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/12 "2024-10-30T19:27:54Z")

</div>

> [@Tomtom](#):
>
> Maybe an intermediate step to find a node that store for the day, and then record only the daily value will make it lighter for the database,

You could record all the data in the database as it is received, but then run an influxdb continuous query to downscale it so that it only retains the daily total for each day. That is the sort of thing that Influxdb excels in.

---

<div class="post-metadata">

### Author: ![Tomtom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tomtom](https://discourse.nodered.org/u/Tomtom)
#### Post date: [30 October 2024 21:45 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/13 "2024-10-30T21:45:16Z")

</div>

Will do 👍👍

---

<div class="post-metadata">

### Author: ![dougle03](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dougle03/32/32979_2.png) [@dougle03](https://discourse.nodered.org/u/dougle03)
#### Post date: [4 November 2024 19:42 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/14 "2024-11-04T19:42:46Z")

</div>

There is another node called:  
`node-red-contrib-simple-energymeter`  
that accepts a live watts input and calculates consumption, but alas it does not survive a reboot of NR, there is no context storage for it yet: I've raised an issue with the dev who has promised to look at it, but nothing yet.  
My search will continue...

---

<div class="post-metadata">

### Author: ![Tomtom](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@Tomtom](https://discourse.nodered.org/u/Tomtom)
#### Post date: [5 November 2024 13:58 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/15 "2024-11-05T13:58:12Z")

</div>

Yes, everytime you are deploying it is putting the value back to zero, can be a good asset if it is evolving to context storage 👍

---

<div class="post-metadata">

### Author: ![dougle03](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dougle03/32/32979_2.png) [@dougle03](https://discourse.nodered.org/u/dougle03)
#### Post date: [21 November 2024 09:17 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/16 "2024-11-21T09:17:34Z")

</div>

Perhaps if a few more people raise it as an issue on the git page, the author might give it a bit of time to implement..  
I did fork it with the aid of ChatGPT, but could not get it to work as I wanted...

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [19 February 2025 09:18 UTC](https://discourse.nodered.org/t/energy-meter-energy-consumption/92751/17 "2025-02-19T09:18:22Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
