Announcement

Collapse
No announcement yet.

Can script change Device Name, Location and Location2 Properties?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can script change Device Name, Location and Location2 Properties?

    Is it possible to change the Name and Location Properties of an existing Z-Wave Device via scripting? I'm still struggling to understand scripting and not sure if these Identity Properties described in the Device Class help documentation can be changed by script. I searched the boards for a while and cannot find examples of this.

    John

    #2
    Yes these are all parameters that can be edited by script - this is a script I use that removes all of the location two data in my system.

    Code:
    Sub Main(ByVal Parm As Object)
    
        Try
            'run through the enumerator, remove the location two strings
            Dim dv As Scheduler.Classes.DeviceClass
            Dim EN As Scheduler.Classes.clsDeviceEnumeration
    
            EN = hs.GetDeviceEnumerator
    
            Do
                dv = EN.GetNext
                If dv Is Nothing Then Continue Do
                If dv.Location2(Nothing) <> Nothing Then
                    hs.writelog("Device Clear", "Device: " & dv.Name(Nothing) & " Has Location 2: " & dv.Location2(Nothing))
                    dv.Location2(hs) = Nothing
                End If
            Loop Until EN.Finished
    
        Catch ex As Exception : hs.writelog("Device Clear", "Exception: " & ex.message)
        End Try
    
    End Sub

    Comment

    Working...
    X