Before I start manipulating any values, I wanted to ask where they’re written to and whether there’s anything I need to bear in mind.
From my microcontroller days, I know that flash memory shouldn’t—or mustn’t—be written to with individual values at intervals of less than a second.
Where is this stored if I regularly write the grid setpoint via a calculation in Node-RED? RAM would be harmless, but if the value is written to the flash disk each time, I’d want to send only one message per minute.
There is no point in using such a fast rate, the system cannot respond in that time. I wouldn’t be updating more often than every 5 seconds or so.
Modern flash shouldn’t have an issue with updating like that.
Regardless, even if theoretically an unlimited number of writes should be allowed, I usually put a Filter node (write only on change) before settings like these in Node-RED. It can’t hurt and usually cuts the number of writes dramatically.