Calculate accumulated price based on power consumption

I got this feed provided from Tibber, my power consumption accumulated for the last hour. I also have the price for the power. The price is without all the taxes so i added them and i then recieve the price as well. The price is updated pr 60 seconds, and the accumulated power consumption is updated every 1.5 second. My goal is to calculate the cost for every hour, and sum them as the hours pass. Example the first hour from midnight to 01.00 I have been using 3kWh, and the price was 0.50 Nok, calculated it will be 1.50, if that repeats itself the next hour then I am interesting in 1.50 NOK +1.50 NOK

Most of this is ok to do, my main problem is how to trigger the accumulated consumption every minute for one specific hour. Hope you understand my question.

Best regards Freddy.

I've used this node in my home-energy monitoring system to calculate my kWh and daily consumption..

I came up with this and this works. I get the values I want and they get multiplided. But the next big issue is, how can i sum all the results. Beacause in the end of the day I want to have the sum for all 24 hours. And it have to restart every day as well, as soon as one thing is solved another question pops up. Hope anyone can lead me into the right direction though.

Solved it with the node-red-contrib-sum (node) - Node-RED node.

1 Like

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