Announcement

Collapse
No announcement yet.

Upgraded thermostats, then spent hours fighting DeviceValueByName... What's wrong?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Upgraded thermostats, then spent hours fighting DeviceValueByName... What's wrong?

    Hello,

    So I upgraded a few of my first-gen RadioThermostats to much newer Alarm.com Z+ thermostats this evening, because the RadioThermostats units started crashing randomly this season, getting stuck in some unpleasant mode.

    The upgrade itself was fine. I cut power and pulled the batteries, then removed the failed nodes. While power was off, I swapped in the Alarm.com units, and turned power back on. Because they were Z+ nodes, I was able to find them, even though they're likely out of range of the USB interface.

    However, my thermostat VB script failed miserably, and I spent a few hours trying to figure out what the problem is. I figured out a workaround, but I need to know what the real problem is, so I can fix the kludge.

    All of the "features" of the Thermostats can be queried via hs.DeviceValueByName, except for "Heating Setpoint" and "Cooling Setpoint". I can play with the mode values via the HS web interface, and then query the mode, and the correct value is returned. But "Heating Setpoint" and "Cooling Setpoint" for all three of the thermostats all return -1.

    This is what I ended up having to do, and I need to fix it. Any idea why these two features can't be queried?

    Code:
    If hs.IsOnByName("Scripting Flags Heating Season") Then
        ' Set the heat setpoint
       'hs.CAPIControlHandler(hs.CAPIGetSingleControl(hs.GetDeviceRefByName("Scripting Thermostat Pellet Heating Setpoint"), False, CStr(CalPellTemp), False, True))
       hs.CAPIControlHandler(hs.CAPIGetSingleControl(570, False, CStr(CalPellTemp), False, True))
       hs.WaitSecs(1)
       'hs.WriteLog("Thermostat", "Changing Pellet to " & CalPellTemp & ". Confirmation: " & hs.DeviceValueByName("Scripting Thermostat Pellet Heating Setpoint"))
       hs.WriteLog("Thermostat", "Changing Pellet to " & CalPellTemp & ". Confirmation: " & hs.DeviceValue(570))
       hs.WaitSecs(1)
       'hs.CAPIControlHandler(hs.CAPIGetSingleControl(hs.GetDeviceRefByName("Scripting Thermostat Gas Heating Setpoint"), False, CStr(CalGasTemp), False, True))
       hs.CAPIControlHandler(hs.CAPIGetSingleControl(560, False, CStr(CalGasTemp), False, True))
       hs.WaitSecs(1)
       'hs.WriteLog("Thermostat", "Changing Gas to " & CalGasTemp & ". Confirmation: " & hs.DeviceValueByName("Scripting Thermostat Gas Heating Setpoint"))
       hs.WriteLog("Thermostat", "Changing Gas to " & CalGasTemp & ". Confirmation: " & hs.DeviceValue(560))
       hs.WaitSecs(1)
       'hs.CAPIControlHandler(hs.CAPIGetSingleControl(hs.GetDeviceRefByName("Scripting Thermostat Washitsu Heating Setpoint"), False, CStr(CalWaTemp), False, True))
       hs.CAPIControlHandler(hs.CAPIGetSingleControl(589, False, CStr(CalWaTemp), False, True))
       hs.WaitSecs(1)
       'hs.WriteLog("Thermostat", "Changing Washitsu to " & CalWaTemp & ". Confirmation: " & hs.DeviceValueByName("Scripting Thermostat Washitsu Heating Setpoint"))
       hs.WriteLog("Thermostat", "Changing Washitsu to " & CalWaTemp & ". Confirmation: " & hs.DeviceValue(589))
    End If
    Thanks,
    Chris

    #2
    Can you post screenshot of Status/Controls/Graphics configuration for the offending devices

    Comment


      #3
      Originally posted by The Keeper View Post
      ...All of the "features" of the Thermostats can be queried via hs.DeviceValueByName, except for "Heating Setpoint" and "Cooling Setpoint". ...
      I hit this same problem with HS3 and a Trane thermostat. It is a double space (even though it doesn't show as such) between "Cooling" and "Setpoint", and between "Heating" and "Setpoint". Put the extra space in, and it works.

      Comment


        #4
        Originally posted by joegr View Post

        I hit this same problem with HS3 and a Trane thermostat. It is a double space (even though it doesn't show as such) between "Cooling" and "Setpoint", and between "Heating" and "Setpoint". Put the extra space in, and it works.
        Wow, WTF is that extra space character doing there... I just opened the device edit page, and I see exactly what you're describing.

        Thank you, I just removed the offending space character from both of the Setpoints on all of the thermostats, and my script is now working.

        Chris

        Comment

        Working...
        X