[Release] Virtual Container Driver

There are a lot of nuances to what you are asking. Please specify in detail what you are trying to accomplish.
If you want to link 2 existing , then that is not really possible unless you use a smartApp to tie them together.
Otherwise, you need to have one device create the other device (i.e. the child device is a component of the parent device that created it). This is what my Virtual Container driver does.

If you have a smartthings account, this link might be helpful (ignore all the tile stuff..it doesnt apply).


See also...scroll down to the addChildDevice() section

1 Like

Fantastic. Thank you @stephack. And as you say this all seems simple enough I may be able to figure out how to do it myself...

1 Like

See @Cobras post a few posts up

Right, I'm thinking even a little higher, where I could have a container for bedroom, and I could automagically add any user app I have as a child:
-Heater Control My HeaterApp
-Fan Control MyFanApp
-Xmas Lights MyXmasApp
-PoolConteol MyPoolControl

Might be a bridge too far, we'd need to be able to get a list of apps that can be installed.

It still comes down to all of us want better organization.


I used the same system in ST
I included the relevant apps into ‘groups’ ( mostly rooms)

It worked quite well at the time


This is what my 'Cobra Apps' container is looking like at the moment..

And when they are installed (the same app)...

And in the apps list...

Maybe not the 'final' version... but you get the idea?

EDIT: I almost forgot... @bravenel
Bruce.. this is the next thing on my road-map :rofl:

For those of you not 'in' on the joke...



I'm paying VERY close attention. :nerd_face:


RAFLMAO @bravenel

Thanks @stephack, it wasnt so much of the logic, rather than the method I was missing.
I noted all my Zigbee Id's, then removed them all. Created the VC devices, and created the devices again, after updating the code with the driver details. Then re-paired each device. So now I have them :slight_smile: And very happy!! :slight_smile:



Holy Cow!! That's NOT what this was designed to do, but it's fantastic if it actually works. This was designed for Virtual devices and never considered trying physical devices with it. Let us know how well it works and I might give it a shot as well.

@mike.maxwell do you see any pitfals to assigning physical devices this way. I cant think of any myself.


:smiley: Going back to the ST days, I added most my Xiaomi devices via the catchall method, so I made sure I kept the Zigbee ID and dni, I added them using your method and added the Zigbee ID (not the dni) to each device I was adding, then performed a search on each. All were picked up without issue, and added to the VC I had created. I've tested them since adding and all functioning fine. So fingers crossed there is no potential issue to be caused :+1:

1 Like



Well, that's sweet! Somebody figure out how to do this without re-pairing my devices please. I would love this, but don't have the time to futz with pairing temperamental devices all over again unless forced under duress.

1 Like

Great to know, thanks @mike.maxwell. Could you advise what namespace the Hubitat drivers are using, if thats ok? I have a load of bulbs using the "Generic Zigbee Bulb" driver which I'd also like to do the same way. Cheers.

Edit Doesn't matter, I sussed it. :+1:

hubitat should be the namespace for all built in drivers.

1 Like

My mistake was "H" :wink:

Yes, it's sorted by label....so it will cycle in the order displayed in the device list. Same with setLevel. And as an FYI, the level is reset to 0 if you do a refresh.

1 Like

I am unfamiliar with xiaomi devices, is this something that will only work with these devices. Or can we get all of our zigbee devices to group like this?

If I understand. You created virtual devices with the same settings as your physical devices. Then when removed and repaired they joined in place of the virtual devices you created?

Copied the Zigbee ID to an XLS.
Removed my Xioami devices, then installed the Container, then added each device and set the type accordingly. Performed a reset of each device and performed a search. Each device I’d added were then found and the dni was updated and they’re working as required.

I’ve not had the same success with my TRÅDFRI bulbs though. Even though the dni is updated, and they’re found, they don’t respond to commands, which is a shame. So I don’t think this will work for all devices, or maybe there’s a better way.

1 Like

I just gave it a shot with an iris plug I had sitting here. I see the same thing you do. It looks like it paired up, but then pushing configure throws errors in the log. I tried another driver with same results.

Is too bad. This is a great way to clean up the device page.

1 Like