Shane,
Sorry but I accidentally deleted the entire topic. I created this with the same topic heading, so I hope you see it.
I tried to add the script to my reply after I posted it, and I could not, so then I clicked the Delete Message button but the reality was made visible to me quickly that Delete Message is really Delete Topic!!!
Sorry...
I am posting the script you wanted and also attaching it to this message since the formatting of scripts here is not always the best...
Sub Main()
' Replace A1 with the address of a virtual
' device that you want to use to display
' the temperature information.
' Uncomment the lines that use A2, etc. and
' create other virtual devices if you want
' more information displayed.
'
' In the script commands, where you see (1),
' you can replace it with (2) for the 2nd
' thermostat, (3) for third, etc.
dim sp ' Current Setpoint
dim ct ' Current Temperature
dim cm ' Current thermostat mode
dim tname ' Thermostat name
dim hai
set hai = hs.Plugin("HAI_System") ' Use OnQ_System for an OnQ plug-in.
' Get thermostat name
tname = hai.ThermostatName(1)
' Get the current thermostat mode
cm = hai.GetMode(1)
' Allow some other HS processing to take place.
hs.WaitEvents
hs.WaitEvents
' Get the setpoint depending on what the mode is (HAI has two setpoints)
if lcase(left(cm,1)) = "a" then ' Therm in Auto mode - don't know which setpoint to get.
sp = "Cool:" & cstr(hai.HAI_WhatIsSetpoint(1,"c")) & " Heat:" & cstr(hai.HAI_WhatIsSetpoint(1,"h"))
elseif lcase(left(cm,1)) = "c" then
sp = cstr(hai.HAI_WhatIsSetpoint(1,"c"))
else
sp = cstr(hai.HAI_WhatIsSetpoint(1,"h"))
end if
' Get the current temperature
ct = cstr(hai.HAI_WhatIsTemp(1))
' Now put it all together and set it to the device
' string of our virtual device A1.
hs.SetDeviceString "A1", tname & " temperature is " & ct & " with a setpoint of " & sp & " and the stat is currently in the " & cm & " mode."
end Sub
Rick Tinker
HomeSeer Technologies
Sorry but I accidentally deleted the entire topic. I created this with the same topic heading, so I hope you see it.
I tried to add the script to my reply after I posted it, and I could not, so then I clicked the Delete Message button but the reality was made visible to me quickly that Delete Message is really Delete Topic!!!
Sorry...
I am posting the script you wanted and also attaching it to this message since the formatting of scripts here is not always the best...
Sub Main()
' Replace A1 with the address of a virtual
' device that you want to use to display
' the temperature information.
' Uncomment the lines that use A2, etc. and
' create other virtual devices if you want
' more information displayed.
'
' In the script commands, where you see (1),
' you can replace it with (2) for the 2nd
' thermostat, (3) for third, etc.
dim sp ' Current Setpoint
dim ct ' Current Temperature
dim cm ' Current thermostat mode
dim tname ' Thermostat name
dim hai
set hai = hs.Plugin("HAI_System") ' Use OnQ_System for an OnQ plug-in.
' Get thermostat name
tname = hai.ThermostatName(1)
' Get the current thermostat mode
cm = hai.GetMode(1)
' Allow some other HS processing to take place.
hs.WaitEvents
hs.WaitEvents
' Get the setpoint depending on what the mode is (HAI has two setpoints)
if lcase(left(cm,1)) = "a" then ' Therm in Auto mode - don't know which setpoint to get.
sp = "Cool:" & cstr(hai.HAI_WhatIsSetpoint(1,"c")) & " Heat:" & cstr(hai.HAI_WhatIsSetpoint(1,"h"))
elseif lcase(left(cm,1)) = "c" then
sp = cstr(hai.HAI_WhatIsSetpoint(1,"c"))
else
sp = cstr(hai.HAI_WhatIsSetpoint(1,"h"))
end if
' Get the current temperature
ct = cstr(hai.HAI_WhatIsTemp(1))
' Now put it all together and set it to the device
' string of our virtual device A1.
hs.SetDeviceString "A1", tname & " temperature is " & ct & " with a setpoint of " & sp & " and the stat is currently in the " & cm & " mode."
end Sub
Rick Tinker
HomeSeer Technologies
Comment