I searched for an answer to this first, but couldn't find it, so I was hoping a scripting guru could help me out. I am trying to make an event that increases the Heat Setpoint by 1 degree. I found the Thermostat API, but I think my syntax must be off. I do have the latest Z-wave Tstat plugin (and it is enabled). Take a look at what I have, and see if a glaring error is apparent. Thanks in advance!
Sub Main
Dim Mode
Dim CSP
Dim HSP
Dim Fan
Dim Temp
Dim pi
set pi = hs.Plugin("ZWave Thermostats")
Mode = pi.GetModeSet(1) ' This gets Thermostat 1, indices are available on the config page
CSP = pi.GetCoolSet(1)
HSP = pi.GetHeatSet(1)
Fan = pi.GetFanMode(1)
Temp = pi.GetTemp(1)
' Mode is an enum with these values:
' 0 = Off
' 1 = Heat
' 2 = Cool
' 3 = Auto
' 4 = Aux/EMHT
Select case Mode
case 0
Mode = "Off"
Case 1
Mode = "Heat"
Case 2
Mode = "Cool"
Case 3
Mode = "Auto"
Case 4
Mode = "EMHT"
end select
' Fan is 1 for on, 0 for off/auto
If Fan = 1 then Fan = "On"
If Fan = 0 then Fan = "Off/auto"
pi.CmdSetHeat 1, HSP+1
End Sub
Sub Main
Dim Mode
Dim CSP
Dim HSP
Dim Fan
Dim Temp
Dim pi
set pi = hs.Plugin("ZWave Thermostats")
Mode = pi.GetModeSet(1) ' This gets Thermostat 1, indices are available on the config page
CSP = pi.GetCoolSet(1)
HSP = pi.GetHeatSet(1)
Fan = pi.GetFanMode(1)
Temp = pi.GetTemp(1)
' Mode is an enum with these values:
' 0 = Off
' 1 = Heat
' 2 = Cool
' 3 = Auto
' 4 = Aux/EMHT
Select case Mode
case 0
Mode = "Off"
Case 1
Mode = "Heat"
Case 2
Mode = "Cool"
Case 3
Mode = "Auto"
Case 4
Mode = "EMHT"
end select
' Fan is 1 for on, 0 for off/auto
If Fan = 1 then Fan = "On"
If Fan = 0 then Fan = "Off/auto"
pi.CmdSetHeat 1, HSP+1
End Sub
Comment