Hello Everyone,
I am trying to turn on an Insteon device based on a motion sensor device and using BLRadar.
So, BLRadar is correctly calling the script below using the following arguments:
hs.RunScriptFunc("Test.vb","ZoneChange","Laundry|Occupied",f alse,false)
--------------------------------------------------
Sub ZoneChange(ByVal Parms As Object)
Dim ParmsArray() As String
ParmsArray = Parms.ToString.Split("|")
Dim ZoneName As String = ParmsArray(0)
Dim ZoneStatus As String = ParmsArray(1)
If ZoneName = "Laundry" Then
Dim InsteonGroupLightsInLaundry As String = "24.04.3A:1"
'Dim InsteonGroupLightsInLaundry As String = "Group:7"
If ZoneStatus = "Occupied" Then
hs.WriteLog("Debug", "Laundry Room - Occupied")
hs.SetDeviceValue("InsteonGroupLightsInLaundry", 2)
End If
If ZoneStatus = "Vacant" Then
hs.WriteLog("Debug", "Laundry Room - Vacant")
hs.SetDeviceValue("InsteonGroupLightsInLaundry", 0)
End If
End If
End Sub
----------------------------------------------------------
I see the Debug output, but the device does not turn on. What am I doing wrong?
Thanks,
Marcus
I am trying to turn on an Insteon device based on a motion sensor device and using BLRadar.
So, BLRadar is correctly calling the script below using the following arguments:
hs.RunScriptFunc("Test.vb","ZoneChange","Laundry|Occupied",f alse,false)
--------------------------------------------------
Sub ZoneChange(ByVal Parms As Object)
Dim ParmsArray() As String
ParmsArray = Parms.ToString.Split("|")
Dim ZoneName As String = ParmsArray(0)
Dim ZoneStatus As String = ParmsArray(1)
If ZoneName = "Laundry" Then
Dim InsteonGroupLightsInLaundry As String = "24.04.3A:1"
'Dim InsteonGroupLightsInLaundry As String = "Group:7"
If ZoneStatus = "Occupied" Then
hs.WriteLog("Debug", "Laundry Room - Occupied")
hs.SetDeviceValue("InsteonGroupLightsInLaundry", 2)
End If
If ZoneStatus = "Vacant" Then
hs.WriteLog("Debug", "Laundry Room - Vacant")
hs.SetDeviceValue("InsteonGroupLightsInLaundry", 0)
End If
End If
End Sub
----------------------------------------------------------
I see the Debug output, but the device does not turn on. What am I doing wrong?
Thanks,
Marcus
Comment