cameo69 solved the acutal problem in an way with very few nodes, far less complex than the flow I build for my old 433MHz-stuff for this exhaust fan) and I'm on my way learning some about how to write function nodes.
Your suggestion is more complex and will probably be useful for adding more functions and I have already learned a few more things I had no clue about, even though I don't fully understand it yet...
I just found that sub-flow you wrote about a while ago that I didn't figured out what it was by then...so then it will probably be easier to understand the rest....hopefully...
I had never seen a sub-flow before. That looks to be useful - guess several flows can share a sub-flow...and for notifications for example I might be able to redo/reduce if make that part of my flows in a sub-flow...
I have to spend more time with your flow - maybe this weekend if it gets rainy
NR is fun - especially with this much help that really trigger to learn and I get more and more ideas what I would like to do in the future when I see what's possible!