Energy Meter - energy consumption

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

What would be the input to the node?

Watts will be send to this node

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.

1 Like

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...

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) ?


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.

2 Likes

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.

1 Like

Thanks 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 !

Thanks 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.

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 !

You can use context storage to save and aggregate the output of watts2kwh Working with context : Node-RED

1 Like

Thanks E1cid, I will check this :+1:

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.

1 Like

Will do :+1::+1:

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...

1 Like

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 :+1:

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...

1 Like