I am slowing converting my HS3 over to raspberry pi - Jessie. I have a script that runs under windows just fine, but I get the following error when I run it under Jessie.
Running script /usr/local/HomeSeer/scripts/Lightsonv2.vb :Exception has been thrown by the target of an invocation.Invalid IL code in scriptcode3.VBWrapper:Main (object): IL_01d2: nop
I have no idea what this means. Any help would be greatly appreciated.
There is the script. I did not write it, but I copied it from somewhere. So I have limited understanding of how it works.
Sub Main(Parm As Object)
'Script to display Light Status
Dim Status
Dim DeviceVal
Dim Offf'0
Dim OnOn'1
Dim Lightson as Integer
OnOn = ""
Offf = ""
Lightson=0
Dim col As New Collections.Generic.List(Of Scheduler.Classes.DeviceClass)
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
col.Add(dv)
Loop Until EN.Finished
If col IsNot Nothing AndAlso col.Count > 0 Then
For Each dv In col
If dv Is Nothing Then Continue For
If dv.Location2(Nothing)= "Lights" then
DeviceVal= hs.DeviceValue(dv.Ref(Nothing))
If DeviceVal = 0 then
Offf = Offf & dv.Name(Nothing) & ", " & "<Br>"
Else
OnOn = OnOn & dv.Name(Nothing) & ", " & "<Br>"
Lightson=Lightson+1
End If
'hs.writelog ("OK", OnOn)
'hs.WriteLog("Ref: " & dv.Ref(Nothing), dv.Name(Nothing) & " " & DeviceVal & " " & Status) 'Update HS Log
'hs.WriteLog("Ref: " & dv.Ref(Nothing), dv.Name(Nothing) & " " & dv.Location(Nothing) & " " & dv.Location2(Nothing))
End If
Next
End If
If OnOn = "" then OnOn = "All Lights are Off"
hs.SetDeviceString(14, Trim(OnOn), True)
hs.SetDeviceValueByRef(14, Lightson, True)
End Sub
Running script /usr/local/HomeSeer/scripts/Lightsonv2.vb :Exception has been thrown by the target of an invocation.Invalid IL code in scriptcode3.VBWrapper:Main (object): IL_01d2: nop
I have no idea what this means. Any help would be greatly appreciated.
There is the script. I did not write it, but I copied it from somewhere. So I have limited understanding of how it works.
Sub Main(Parm As Object)
'Script to display Light Status
Dim Status
Dim DeviceVal
Dim Offf'0
Dim OnOn'1
Dim Lightson as Integer
OnOn = ""
Offf = ""
Lightson=0
Dim col As New Collections.Generic.List(Of Scheduler.Classes.DeviceClass)
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
col.Add(dv)
Loop Until EN.Finished
If col IsNot Nothing AndAlso col.Count > 0 Then
For Each dv In col
If dv Is Nothing Then Continue For
If dv.Location2(Nothing)= "Lights" then
DeviceVal= hs.DeviceValue(dv.Ref(Nothing))
If DeviceVal = 0 then
Offf = Offf & dv.Name(Nothing) & ", " & "<Br>"
Else
OnOn = OnOn & dv.Name(Nothing) & ", " & "<Br>"
Lightson=Lightson+1
End If
'hs.writelog ("OK", OnOn)
'hs.WriteLog("Ref: " & dv.Ref(Nothing), dv.Name(Nothing) & " " & DeviceVal & " " & Status) 'Update HS Log
'hs.WriteLog("Ref: " & dv.Ref(Nothing), dv.Name(Nothing) & " " & dv.Location(Nothing) & " " & dv.Location2(Nothing))
End If
Next
End If
If OnOn = "" then OnOn = "All Lights are Off"
hs.SetDeviceString(14, Trim(OnOn), True)
hs.SetDeviceValueByRef(14, Lightson, True)
End Sub
Comment