Create automation(s) to link the virtual device with the child device.
If you’re in a region where Smart Lighting is available, the new Smart Lighting plugin includes a “mirror” option. go to “create routine”, “discover” tab at bottom right, scroll all the way down to “Smart Lighting” (lightbulb icon).
Select + to add a new lighting routine. Devices to control: select the child device. Actions: “Sync with switch”. Select devices: select your virtual switch.
If you don’t have Smart Lighting, you would need to mimic the above using Routines, with one routine for on and another for off. I’m not sure if there’s a good way to match dimming in routines, if that’s something you’re worried about, but simple on-off should be straightforward.