How to calculate data in day and month using node-red-contrib-modbus and mysql

I am working on raspberry pi 3. I am using node-red-contrib-modbus and Mysql for my project. I read my data from Modbus Energy meter by USB RS485 converter. I want calculate Power in every hour, daily, week and month but I can't improve my project because of modbus poll rate even I try to write many function. The problem is the modbus poll rate. Example: modbus poll rate every 1 minute. if I try to do math in function. I still can't get any value because of it because it poll in every minute. any guys know how to compare old values with new values after using (node-red contrib-modbus) noded and function or how to calculate it in every hour, daily, and week.

Best Regards,

Are you saving the values in the database?

Yes, I save in mysql every 1 minute with modbus poll rate 1 minute

When you say you want to calculate the power every hour, do you actually mean you want the total energy used over that hour or the average power over the hour, or what?

What does the energy meter give you each minute?

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