This may be out there, but I'm hoping someone may have come across this before.
I didn't like my TStat's scheduling interface, so I decided to create my own. I did it 2 ways, one by creating a bunch of virtual devices for all the different setpoints, and the way I wanted to do it - by saving the setpoints in an .ini file.
Both screens look pretty much like this:
Both use similar scripts to change the setpoints when one of the arrow buttons is clicked.
The version using the virtual devices updates the numbers on the screen instantly. The problem is with the .ini file - it can take up to 15 seconds to update the number on the screen after the arrow button is clicked.
Here is the script I'm using, can anyone see anything I'm doing wrong to slow the HSTouch screen response?
Again, I know this is a bit out there, but any advice would be greatly appreciated! I really want to get rid of all those virtual devices!!!
I didn't like my TStat's scheduling interface, so I decided to create my own. I did it 2 ways, one by creating a bunch of virtual devices for all the different setpoints, and the way I wanted to do it - by saving the setpoints in an .ini file.
Both screens look pretty much like this:
Both use similar scripts to change the setpoints when one of the arrow buttons is clicked.
The version using the virtual devices updates the numbers on the screen instantly. The problem is with the .ini file - it can take up to 15 seconds to update the number on the screen after the arrow button is clicked.
Here is the script I'm using, can anyone see anything I'm doing wrong to slow the HSTouch screen response?
Code:
'HS3 Script 2020-01-05 JG Sub Main(ByVal parm As Object) ' Get Setpoint to change and change direction Dim OldValue = 0, NewValue = 0, SetPointToChange, ChangeAction, RowLock, Row, Temp, Day SetPointToChange = parm(0).ToString ' Get Setpoint to change from HSTouch ChangeAction = parm(1).ToString ' Get increment direction from HSTouch RowLock = parm(2).ToString ' Get whether to change all row's setpoints from HSTouch Row = Mid(SetPointToChange, 16, 4) ' Get which row has been selected in HSTouch: Wake/Away/Home/Sleep Temp = Mid(SetPointToChange, 4, 4) ' Get whether Cool or Heat Setpoint has been selected in HSTouch Day = Mid(SetPointToChange, 1, 3) ' Get what day has been selected in HSTouch OldValue = hs.GetINISetting("Thermostat", SetPointToChange, "", "EyeNetTStat.ini") If ChangeAction = "UP" Then ' Calculate the new setpoint NewValue = OldValue + 1 Else NewValue = OldValue - 1 End If If RowLock = "Locked" And (Day = "Sat" or Day = "Sun") Then ' Override lock if day selected was Sat or Sun RowLock = "Unlocked" End If If RowLock = "Locked" ' Change M-F on the selected row all at the same time If Temp = "HEAT" Then If Row = "WAKE" hs.SaveINISetting("Thermostat", "MonHeatSetpointWAKE", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "TueHeatSetpointWAKE", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "WedHeatSetpointWAKE", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "ThuHeatSetpointWAKE", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "FriHeatSetpointWAKE", NewValue, "EyeNetTStat.ini") End If If Row = "AWAY" Then hs.SaveINISetting("Thermostat", "MonHeatSetpointAWAY", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "TueHeatSetpointAWAY", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "WedHeatSetpointAWAY", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "ThuHeatSetpointAWAY", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "FriHeatSetpointAWAY", NewValue, "EyeNetTStat.ini") End If If Row = "HOME" Then hs.SaveINISetting("Thermostat", "MonHeatSetpointHOME", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "TueHeatSetpointHOME", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "WedHeatSetpointHOME", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "ThuHeatSetpointHOME", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "FriHeatSetpointHOME", NewValue, "EyeNetTStat.ini") End If If Row = "SLEE" Then hs.SaveINISetting("Thermostat", "MonHeatSetpointSLEEP", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "TueHeatSetpointSLEEP", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "WedHeatSetpointSLEEP", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "ThuHeatSetpointSLEEP", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "FriHeatSetpointSLEEP", NewValue, "EyeNetTStat.ini") End If Else If Row = "WAKE" Then hs.SaveINISetting("Thermostat", "MonCoolSetpointWAKE", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "TueCoolSetpointWAKE", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "WedCoolSetpointWAKE", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "ThuCoolSetpointWAKE", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "FriCoolSetpointWAKE", NewValue, "EyeNetTStat.ini") End If If Row = "AWAY" Then hs.SaveINISetting("Thermostat", "MonCoolSetpointAWAY", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "TueCoolSetpointAWAY", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "WedCoolSetpointAWAY", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "ThuCoolSetpointAWAY", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "FriCoolSetpointAWAY", NewValue, "EyeNetTStat.ini") End If If Row = "HOME" Then hs.SaveINISetting("Thermostat", "MonCoolSetpointHOME", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "TueCoolSetpointHOME", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "WedCoolSetpointHOME", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "ThuCoolSetpointHOME", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "FriCoolSetpointHOME", NewValue, "EyeNetTStat.ini") End If If Row = "SLEE" Then hs.SaveINISetting("Thermostat", "MonCoolSetpointSLEEP", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "TueCoolSetpointSLEEP", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "WedCoolSetpointSLEEP", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "ThuCoolSetpointSLEEP", NewValue, "EyeNetTStat.ini") hs.SaveINISetting("Thermostat", "FriCoolSetpointSLEEP", NewValue, "EyeNetTStat.ini") End If End If hs.writelog("Climate",CStr(SetPointToChange & " changed to: " & NewValue & " Action: " & ChangeAction & ", Rows are: " & RowLock & " Row: " & Row)) Else ' Change only the day selected hs.SaveINISetting("Thermostat", SetPointToChange, NewValue, "EyeNetTStat.ini") hs.writelog("Climate",CStr(SetPointToChange & " changed to: " & NewValue & " Action: " & ChangeAction & ", Rows are: " & RowLock)) End If End Sub
Comment