Sub Main() Dim DE, dv, x Const MISC_ZWAVE = 4096 Dim sName, sLocation, sAlarm, sAssoc Dim sClass, sIndicator, sLevel, sProtect, sVersion Set DE = hs.GetDeviceEnumerator If DE is nothing then writemon "Error","ZWave_Info.vbs got an empty device enumerator object." Exit Sub End If x = 0 On Error Resume Next Do while Not DE.Finished Set dv = DE.GetNext If Not dv Is Nothing Then If (dv.misc And MISC_ZWAVE) = MISC_ZWAVE Then sClass = hs.ZWaveAction(dv, 7, "") If Instr(LCase(sClass),"association") > 0 Then hs.WriteLog "Z-Wave","----------------------------------------------------------------------------------" x = x + 1 hs.WriteLog "Z-Wave","Node: " & dv.zwave_nodeid & ", Device: " & dv.Location2 & " " & dv.Location & " " & dv.Name sResult = hs.ZWaveAction(dv, 2, 1) hs.WriteLog "Z-Wave","Remove HomeSeer Association from group 1 Result: " & sResult sResult = hs.ZWaveAction(dv, 1, 1) hs.WriteLog "Z-Wave","Add HomeSeer Association to 1 Result: " & sResult sName = hs.ZWaveAction(dv, 3, "") sLocation = hs.ZWaveAction(dv, 5, "") sLevel = hs.ZWaveAction(dv, 8, "") sProtect = hs.ZWaveAction(dv, 9, "") sIndicator = hs.ZWaveAction(dv, 10, "") sAlarm = hs.ZWaveAction(dv, 11, 1) sAssoc = hs.ZWaveAction(dv, 12, "") sVersion = hs.ZWaveAction(dv, 13, "") hs.WriteLog "Z-Wave","------------: Name " & sName hs.WriteLog "Z-Wave","------------: Location " & sLocation hs.WriteLog "Z-Wave","------------: Alarm " & sAlarm hs.WriteLog "Z-Wave","------------: Associations " & sAssoc hs.WriteLog "Z-Wave","------------: Classes " & sClass hs.WriteLog "Z-Wave","------------: Indicator " & sIndicator hs.WriteLog "Z-Wave","------------: Level " & sLevel hs.WriteLog "Z-Wave","------------: Protection " & sProtect hs.WriteLog "Z-Wave","------------: Version " & sVersion hs.WriteLog "Z-Wave","==================================================================================" End If hs.WaitEvents End If End If Loop If x > 0 Then hs.WriteLog "ZWS","Processed " & CStr(x) & " devices, finished." End If End Sub