Hello,
script below was working in HS2, but can get it working in HS3.
18 and 271 are reference ID's.
Objective => based on the value of a temp sensor with ID18 set value of virtual sensor ID271 to 1, 2 or 3.
Additional make the string ID271 and ID18 equal (this is working in Immediate Script Command).
Please advice
Sub Main
intTemp = hs.DeviceValue(18)
retValue = 0
If intTemp > 0 Then
If intTemp < 15 Then
retValue = 1
Else
If intTemp > 25 Then
retValue = 3
Else
retValue = 2
End If
End If
End If
hs.SetDeviceValue 271, retValue
hs.SetDeviceString(271, hs.DeviceString(18), True)
End Sub
script below was working in HS2, but can get it working in HS3.
18 and 271 are reference ID's.
Objective => based on the value of a temp sensor with ID18 set value of virtual sensor ID271 to 1, 2 or 3.
Additional make the string ID271 and ID18 equal (this is working in Immediate Script Command).
Please advice
Sub Main
intTemp = hs.DeviceValue(18)
retValue = 0
If intTemp > 0 Then
If intTemp < 15 Then
retValue = 1
Else
If intTemp > 25 Then
retValue = 3
Else
retValue = 2
End If
End If
End If
hs.SetDeviceValue 271, retValue
hs.SetDeviceString(271, hs.DeviceString(18), True)
End Sub