I'm attempting to deprecate several Hub Variable Connectors (which create a virtual device).
It would be very helpful to be able to specify a Variable Connector in the Select device to be replaced in apps (old) dropbox of Swap Apps Device so that all instances of that Connector being used by an App were replaced with a new (virtual) Device.
They are not displayed because they are child devices, and child devices are not supported by this tool (see: Swap Apps Device | Hubitat Documentation). This is unlikely to change from what we have been told.
It can't happen because of the relationship between a child device and its parent app or driver. Child devices make calls to methods in the parent app or driver, and vice versa. The relationship of parent and child device is intimate, and can't be replicated or replaced. Further, even discovering those connections is not in general doable -- there is no road map created by an app, driver or child device that could be followed.
In other words, parent-child relationships are represented the same way in the db as other kinds of relationships. Therefore the tool doesn't know which of the relationships to be changed is a parent-child relationship, and swapping the device ID would also swap its parent if it has one.
Would it be possible to have an "advanced" version of this tool that would list all the relationships and allow the user to select which ones to swap ?
I've just spent some time replacing some "not on the compatibility list" switches with Kasa and Lutron (which I use throughout the house) and had to manually update many RM & RL instances for each device. A straightforward task, but tedious and error-prone, which is why I ask. It doesn't happen every day, however the ability to swap is a very useful debugging tool and it gave me pause that I lose that tool when going with integrations like Lutron.
What is a benefit of child devices existence?
They are always a headache to deal with.
How about to get rid of these child devices altogether and make all devices easy swappable?
Further more, it will be easier to deal with multifunction devices if it will be a separate
driver per single function. Yes number of devices will grow but introducing a device
grouping (device folders) will help to deal with growing device number.
That is one of the things child devices can actually do...
The point of child devices is the intimate relationship with the parent. In the case of things like Lutron, it lets the parent make one telnet connection and the child devcies work through that, for example (ignoring whatever the "direct" option might do in newer firmware; that I don't know). In the case of multichannel Z-Wave devices, the parent has all the Z-Wave smarts, and generic child device drivers can be used (to say nothing of the fact that it frees the platform from needing to make any assumptions about how they might work). Similar for Zigbee devices that need similar functionality.
Sometimes, parent devices or apps are little more than "containers" or easy ways to create devices. In this case, it may be possible to avoid this relationship. That is a choice the app or driver author can make, but in general, doing things with arbitrary devices is more limiting for an app (and it possible at all for devices) as well as possibly more confusing for users to set up.
Yes, if the end result is a set of simple virtual devices.
The same as above.
I could be wrong but I think it will much easier to deal with simple sigle function device
instead of this complexity presented by multifunction devices and parent-child combos. Another words - why not to add another layer of abstraction and create a set of simple virtual devices regardless of what actual physical device is?
(Just my opinion.)
No, this is not the issue. The issue, as I said above, has to do with the intimate relationship between parent and child. The nature of that relationship is such that a swap simply would not work, and doing so would break both the parent and the swapped child.
I guess nothing is stopping you from doing that on your own if you want to, and the new Mirror app changes might make that easier for many devices.
For me, swapping devices is rare, and the tool works for most devices when I need it. For the even rarer other cases, doing it "manually" works, as it always does (tip: you can cheat on a per-app basis and do a clone or import if you want--you'll be offered swaps there, and most apps should respond well). Adding anything else to make swaps "easier" seems like more work in the end for me.
PS - I've heard you talk about HADB a lot, and if your swap are between children of the same parent, there may be workarounds. Ask the developer of your app (or driver) if you aren't sure.
Final note for this topic: Swaps of child devices is in general not possible, and certainly not possible with the built in utility Swap Apps Device. Most of the rest of this topic is misinformed and misleading. So, the topic is now finished.