I have recently upgraded to HS4 for Windows and my scripts that used to work in HS3 are now giving an "Reference to a non-shared member requires an object reference" error in the Homeseer log when compiling.
I used this script for incremental dim/brighten of z-wave dimmers in HS3 which I found here Source: https://forums.homeseer.com/forum/li...-to-install-it. I have tried fruitlessly to debug it on HS4. There are very few references to this error on the internet. I have used tenScripting for HS4 to debug it and have ended up modifying it to this which tenscript says has no errors.
VB Script
Class dimChange
I used this script for incremental dim/brighten of z-wave dimmers in HS3 which I found here Source: https://forums.homeseer.com/forum/li...-to-install-it. I have tried fruitlessly to debug it on HS4. There are very few references to this error on the internet. I have used tenScripting for HS4 to debug it and have ended up modifying it to this which tenscript says has no errors.
VB Script
Class dimChange
Sub Main(ByVal inputparmaters As String)
' parameter "1234,10" device Reference ID followed by percentage change "-" for down
Dim myInputParmaters
Dim myPos
Dim myStringSize As New Integer
Dim myTargetDevice As New Double
Dim myTargetDimAmount As New Double
Dim myDeviceValue As New Double
Dim debugMode As New Boolean
debugMode = True
myPos = InStr(CStr(myInputParmaters), ",")
myStringSize = Len(myInputParmaters)
myTargetDevice = Left(myInputParmaters, myPos - 1)
myTargetDimAmount = Right(myInputParmaters, myStringSize - myPos)
myDeviceValue = hs4.DeviceValue(myTargetDevice) + myTargetDimAmount
hs4.WriteLog("Dim Script", CStr(myDeviceValue))
Dim p = hs4.CAPIControlHandler(hs4.CAPIGetSingleControl(myTargetDevi ce, False, CStr(myDeviceValue), False, True))
End Sub
End Class
Comment