The daily kWh is not calculated based on the power value but on the total kWh value. You should perform specific operations when a new day begins.
Store the first and last kWh values of each day and calculate the difference at the end of the day.
For a tutorial on how to implement daily kWh calculation in Home Assistant, you can refer to the following video:
I think the nodered may also have the same logic.