I tried to workaround this issue by using virtual switch (this is basically similar to child devices that are not available in edge, only in groovy)
However, there is an issue with condition view for multiswitch devices that does not allow unselecting the first switch. Please see [ST Edge] Issue with automation actions for multicomponent switches for details.
Not only child devices are not supported, but it is also not possible to simulate this behaviour with automation.
This is really unfortunate and frustrating
as far as I understand the virtual switch is a huge hack, as soon as it created as a separated “Lan” device and you have to link Zigbee and virtual device via (a good amount of) boilerplate code through the driver
However you don’t need to write a code to achieve this. You can just install the virtual device from either available DTHs or edge drivers and connect your switch component to it with automation (or routine as it is called in the latest ST app).
In fact, currently there is no code you can write to achieve the same programmatically, as zigbee edge driver can not dynamically create devices and you can not access devices, created by different edge driver