I need to duplicate some parts of a flow as I need to get the same behavior and workflow to work with another device ( or let's say another identical feature of the same device)
My first idea was to make use of subflow, and make use of ENV variable to easily tweak copies of the sub-flow, but due to the use of dashboard nodes, this is not possible.
I tried to use different context, flow variables to make the change easier, but it has some limits, and I still need to modify the code quite a lot to make the copy of the group work seamlessly.
I know that for now there is no real workaround to use DB nodes in subflows, but how would you guys deal with that kind of situation ? I guess there can be some tricks to make the work easier when duplicating groups....
I would solve this by separating the logic from the dashboard nodes. I would use MQTT to publish all the data that is needed by the dashboard, and subscribe to topics that will get input from the dashboard. The subflow with the logic can be configured using subflow parameters so that it communicates using unique topics for that instance of the subflow.
If you only need to show one device on the dashboard at any one time then you can use some interface logic to decide which topics to send to the dashboard nodes.
If you need multiple devices visible at one time then you will have to duplicate the dashboard nodes and connect them via appropriately configured mqtt nodes.
I must confess I know close to nothing about MQTT for the moment, as most of the external devices I communicate with use API based on TCP, websockets or Rest API, no MQTT. But I'll give it a deeper look if it can help improving this kind of situation.