I am running a script to display TRV temperatures in a virtual device. I have similar devices to display temperatures and setpoints, they all work fine.
With this script although the device shows the temperature with a decimal, my script only shows integer numbers and I dont get why. On my other temperature display the script is pulling the values from RFXCoM devices, this here is from TRV zwave devices, maybe that makes a difference, I dont know. I did try defining trvsetoint (my variable for the temperature as decimal or string, but its still only showing an integer number.
This is my script:
This is the display virtual device and one of the TRV devices:
.
With this script although the device shows the temperature with a decimal, my script only shows integer numbers and I dont get why. On my other temperature display the script is pulling the values from RFXCoM devices, this here is from TRV zwave devices, maybe that makes a difference, I dont know. I did try defining trvsetoint (my variable for the temperature as decimal or string, but its still only showing an integer number.
This is my script:
Code:
dim array_trvs() as string = {"Guest Bed TRV Temp ","Study TRV Temp","Lounge TRV Temp","Kitchen TRV Temp","Gym TRV Temp"} dim trvsetpoint as double dim trvs_name as string = "" dim trvstr as string = "" sub Main(ByVal Parms as Object) Try trvs_name = "" trvstr = "" for each devw as string in array_trvs trvs_name = devw trvsetpoint = hs.DeviceValueByName(devw) If trvsetpoint >20 trvstr = trvstr & trvs_name & " <span style='color:red'>" & trvsetpoint & " °C" & "</span>" & "<br>" Else trvstr = trvstr & trvs_name & " <span style='color:blue'>" & trvsetpoint & " °C" & "</span>" & "<br>" End If next hs.SetDeviceString(1650, trvstr,true) Catch ex As Exception hs.WriteLog ("Array", "Error: " & ex.Message) End Try End Sub
.
Comment