lutzer / node-red-contrib-easing

MIT License
3 stars 2 forks source link

restart node on restart #9

Open noumenon272 opened 3 years ago

noumenon272 commented 3 years ago

Love this node. I have now integrated it into a bunch of smart home flows for a variety of things. Some of my nodes ease over a couple hours though, which makes them susceptible to getting messed up if I have to restart nodered or there is a power outage or something.

I've also been using the stoptimer-varidelay node, which has a handy feature of resuming its timer on restart and I was wondering if you would be willing to add something similar to the easing node.

https://flows.nodered.org/node/node-red-contrib-stoptimer-varidelay

thanks

lutzer commented 3 years ago

thanks for your feedback! so far i havnt really tested the nodes to work over such long intervals. they were not intended for that. but its good that they do. :)

technically it would be possible to preserve the state over restarts by writing the current state to a file and reload it from there. It would require a complete restructuring of the code, so i am hesitant right now to do so.

then there is also the question if the function value starts from the value where the shut down happened and just resumes from there or if it takes the time between shut down and reboot in account, so i think this feature is not so trivial.

i have to look in on how other nodes implement that features of preserving the state and if this is a general requirement.

noumenon272 commented 3 years ago

For my use case, the time missed during reboot would not need to be accounted for (unless that was easier). For longer time periods, I’m using it to slowly dim lights or close a window shade imperceptibly. If a few minutes are missing during a reboot and a 2 hour easing ends at 7:20 pm instead of 7:15 pm, it doesn’t really matter.

Yeah, I was hoping that stoptimer-varidelay node might have an easy way to add it (I am not a coder).

thanks for considering