question

Milan Kosa avatar image
Milan Kosa asked

AC Input and AC Loads SAMPLING RATE

Hello everyone.


I would like to create an electricity meter on nodered.

More precisely, to measure my KWh.

It is quite a simple application.

However, the sampling rate is key for measurement accuracy.

First of all, it is an AC input.

The refresh rate is 5s in my case.

Regarding the battery and solar energy, I have a refresh rate of about 1s

I also have another Victron app and there the sample rate for the AC Input seems to be around 1 second as well.


So my question is. Can I somehow speed up the AC Input sampling from 5s to 1s?


I have one second on another installation. So it has to work somehow.


Thank you. Milan

ac
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
matt1309 avatar image
matt1309 answered ·

Hi @Milan Kosa,


I don't have a complete answer for you but might be able to help push in the right direction of finding it out.

I would personally try reading the information from dbus directly rather than via any other apps.

That way you're removing any element of the app itself querying an API or something similar and going straight to the source (or at least close to it). That should give you an idea of how frequently the information actually updates in the system.


Then you can way up the pros on cons of it reading from dbus is needed/necessary. ie you put in effort to setup a system to read the faster source by directly reading from dbus. Or if there's not too much of a time difference then just getting the data from a slower app/node red outputs.


Out of curiosity what element of the system are you wanting the kwh for? If you're getting the kw data from an energy meter I believe they not only provide kw but also kwh values. That way you woudlnt need to "integrate" the wattage values to get watthours you could just get the watthours from the meter directly. Which should be more accurate than "integrating" the discrete data points and hoping the sample rate is high enough for accuracy.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image
Kevin Windrem answered ·

Also not a complete answer but the system calc thread in the GX devices computes new values every 1 second. I do see AC power changes about that often so I'd guess the Multi is actually supplying information that fast as well.

System calc aggregates values from multiple devices and creates system totals and these are most likely the parameters you would be monitoring for energy accumulation.

If node red isn't fast enough, you might consider creating a service (or modifying system calc) on the GX device to accumulate energy (watt-hour) values you are interested in then publishing them to dbus. Then it would be a matter of reading those values from node red.

Another approach would be to use a grid meter that itself accumulates watt-hour values and attach those to the grid input and the AC output.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Milan Kosa avatar image
Milan Kosa answered ·

Thank you very much for your observations.

I will try to zoom in on my application a bit.


As for HW, I have 3 pieces of 1 phase Victron inverters. In addition, MPPT for solar panels. It's all managed by CERBO. Nothing more. This is a family house with a connection to the distributor. Heat pump heating and hot water heating using an electric boiler.


Thanks to the option to run nodered on CERBO GX, I created my application.

The aim of the project is Buy electricity at hourly spot prices. I want to charge the boiler at a cheap hour. I want to turn on the heat pump at a cheap hour. I also want to charge the battery at my power station for the lowest possible electricity rate.


tablet1.jpg

I am currently downloading the cheapest electricity times for the next day. Look at the graph. I have the cheapest 4 hours highlighted in green.

tablet2.jpg

I am preparing the graph below just for measuring KWh. The result will be a graph with the sum of electricity prices and the amount of energy consumed. It all runs on the supplied VICTRON technology and I wouldn't like to use anything else.


I don't know if I would need anything else on DBUS...


As I wrote in the first question.

I have one more installation. If I connect the HDMI display directly to CERBO, then the sampling rate is around 1 second.


In my house, the cerbo runs via HDMI with a refresh rate of 5 seconds on AC Input.


Can you think of anything?

Anyway, thank you very much for your willingness.

Best regards

Milan


tablet1.jpg (132.8 KiB)
tablet2.jpg (245.1 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Additional resources still need to be added for this topic