Lar deg sette en vilkårlig device som Root med vilkårlige devicer som Child Devices.
Parameter: RooTID|child1ID,child2ID,etc
Sub Main(ByVal params As String)
Dim lines() As String = params.ToString.Split("|")
Dim rootRef As Integer = lines(0)
Dim children() As String = lines(1).Split(",")
Dim rootDevice As Scheduler.Classes.DeviceClass = hs.GetDeviceByRef(rootRef)
rootDevice.Relationship(hs) = HomeSeerAPI.Enums.eRelationship.Parent_Root
Dim childDevice As Scheduler.Classes.DeviceClass
For Each c As Integer In children
childDevice = hs.GetDeviceByRef(c)
rootDevice.AssociatedDevice_Add(hs, c)
childDevice.Relationship(hs) = HomeSeerAPI.Enums.eRelationship.Child
childDevice.AssociatedDevice_Add(hs, rootRef)
Next
End Sub