Announcement

Collapse
No announcement yet.

Script to control Venstar T5800 thermostat

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

    Script to control Venstar T5800 thermostat

    Just installed five Venstat T5800 color touchscreen wifi thermostats, and they are terrific - they look great, the user interface is extremely easy to understand (using the 'Simple' mode), and they maintain their wifi connection.

    The setup is very straightforward as well. Note that you need to purchase the wifi key in addition to the thermostat to use with Homeseer.

    Because there is no plugin yet, I wrote a simple script to send commands to the thermostat, and to read its status. (Note that these scripts are contained in xxx.txt files, and are triggered by a Homeseer event). The following sets the desired temperature:

    Code:
    Sub Main()
    
    	setpoint = 65
    	ip = "192.168.0.40"
    	result = setThermo(ip, setpoint)
    
    End Sub
    
    function setThermo(ip, temp)
    
    	headers="Content-Type: application/x-www-form-urlencoded"  
    	data = "mode=1&fan=0&heattemp=" & temp & "&cooltemp=75"
    
    	url = "http://" & ip & "/control"
    
    	retval = hs.URLAction(url, "POST", data, headers)
    
    	setThermo = retval
    
    end function
    and the following reads the desired temperature and the current temperature in the room:

    Code:
    Sub Main()
    
    		ip = "192.168.0.40"
    		status = readThermo(ip, currentTemp, setpoint) 
    
    		'note that the values of currentTemp and setpoint are set in the function and can now be used here
    		'do whatever with currentTemp and setpoint
    
    End sub
    
    function readThermo(ip, currentTemp, setpoint)
    
    	url = "http://" & ip & "/query/info"
    	retval = hs.URLAction (url, "GET", "", "")
    
    	retval = replace(retval,"{","")
    	retval = replace(retval,"}","")
    
    	'now parse the results of retval to extract the setpoint and current temperature. To see the many other return values sent 
    	'by the thermostat, simply point your browser to 192.168.0.40/query/info , substituting of course the IP address of your thermostat
    	
    	arr = split(retval, ",")
    	setpoint = 0
    	currentTemp = 0
    
    	for i = 0 to ubound(arr)
    		arr2 = split(arr(i),":")
    		arr2(0) = replace(arr2(0),chr(34), "")
    
    		if arr2(0) = "heattemp" then setpoint = arr2(1)
    		if arr2(0) = "spacetemp" then currentTemp = arr2(1)
    	next
    
    	if currentTemp > 0 then
    		readThermo = "OK"
    	else
    		readThermo = "Offline"
    	end if
    
    end function
    I'm hoping this is helpful to someone, as I have received so much help from others on this forum over the years.

    #2
    I second the request for a Homeseer plugin for this thermostat (in my specific case it needs to be compatible with HS2). I have two installed in my home, and they are literally one of the most solid, well thought out products I have seen in the home automations space. Great Ui and easy to setup and use from their local touchscreen, very nice apps for iPhone/android, nice access for pc's as well via web based interface. If I have any criticism it is on Venstar relying on a cloud based interface with their apps instead of a direct local connection to the thermostats. While this does make it easier to handle multiple controlling devices, whether local or via the internet, it does add one more point of potential failure in the data chain.
    Also don't know about the longterm reliability. Not concerned, just have no data.
    I would recommend these without reservation.
    Mike

    Comment


      #3
      Does the T5800 have a humidity sensor and a humidity relay?

      I liked the look of the T5800 but when I bought my T1900 there was no interface as you have now made. Kiddos of the great work.

      Sent from my htc Inspire 4G using Tapatalk
      HSPro: 3.0.0.194
      PL: Insteon PLM 3.0.5.20,Insteon Thermostat 3.0.1.1 , UltraM1G, RainRelay8, UltraECM3, UltraPioneerAVR3, BLBackup, weatherXML, Jon00 Network & PC Monitor
      HW : Win 7 64bit, Intel i7-2600, 16 GB DDR3 Ram, 60 Plus Insteon Dual Band Devices, Rain8 Pro2, Elk M1 Gold, Brueltech GreenEye.

      Comment


        #4
        Originally posted by CharlieWayne View Post
        Does the T5800 have a humidity sensor and a humidity relay?
        Old thread, but the answer is that the only difference between the T5800 and T5900 is humidity:

        The T5900 has (and the T5800 does not have):
        - Humidity Sensor in the stat
        - Reports it through its local rest interface
        - Output control (W3)/relay for Humidification or Dehumidification

        It has in stat settings to perform dehumidification. As pointed out its an advanced device on a strictly HVAC device level, as well as control and cloud management services
        Paul

        Comment


          #5
          Originally posted by jwshome2 View Post
          Just installed five Venstat T5800 color touchscreen wifi thermostats, and they are terrific - they look great, the user interface is extremely easy to understand (using the 'Simple' mode), and they maintain their wifi connection.

          The setup is very straightforward as well. Note that you need to purchase the wifi key in addition to the thermostat to use with Homeseer.

          Because there is no plugin yet, I wrote a simple script to send commands to the thermostat, and to read its status. (Note that these scripts are contained in xxx.txt files, and are triggered by a Homeseer event). The following sets the desired temperature:

          Code:
          Sub Main()
          
              setpoint = 65
              ip = "192.168.0.40"
              result = setThermo(ip, setpoint)
          
          End Sub
          
          function setThermo(ip, temp)
          
              headers="Content-Type: application/x-www-form-urlencoded"  
              data = "mode=1&fan=0&heattemp=" & temp & "&cooltemp=75"
          
              url = "http://" & ip & "/control"
          
              retval = hs.URLAction(url, "POST", data, headers)
          
              setThermo = retval
          
          end function
          and the following reads the desired temperature and the current temperature in the room:

          Code:
          Sub Main()
          
                  ip = "192.168.0.40"
                  status = readThermo(ip, currentTemp, setpoint) 
          
                  'note that the values of currentTemp and setpoint are set in the function and can now be used here
                  'do whatever with currentTemp and setpoint
          
          End sub
          
          function readThermo(ip, currentTemp, setpoint)
          
              url = "http://" & ip & "/query/info"
              retval = hs.URLAction (url, "GET", "", "")
          
              retval = replace(retval,"{","")
              retval = replace(retval,"}","")
          
              'now parse the results of retval to extract the setpoint and current temperature. To see the many other return values sent 
              'by the thermostat, simply point your browser to 192.168.0.40/query/info , substituting of course the IP address of your thermostat
              
              arr = split(retval, ",")
              setpoint = 0
              currentTemp = 0
          
              for i = 0 to ubound(arr)
                  arr2 = split(arr(i),":")
                  arr2(0) = replace(arr2(0),chr(34), "")
          
                  if arr2(0) = "heattemp" then setpoint = arr2(1)
                  if arr2(0) = "spacetemp" then currentTemp = arr2(1)
              next
          
              if currentTemp > 0 then
                  readThermo = "OK"
              else
                  readThermo = "Offline"
              end if
          
          end function
          I'm hoping this is helpful to someone, as I have received so much help from others on this forum over the years.
          i have error message when i try read my info of my thermostat
          2014-12-05 13:05:04 - Error - Running script, script run or compile error in file: read thermostat cuisine.txt13:Type incompatible: 'currentTemp' in line 34 More info: Type incompatible: 'currentTemp'

          but i can control setpoint

          Comment


            #6
            I apologize, but I'm not enough of an expert to know precisely how to debug this. I suspect you may have to declare currentTemp as a number, which for some reason I didn't need to do in my environment. But I'm not really certain.

            Comment


              #7
              is this still the best way to talk to the Venstar devices? I noticed there isnt a direct plugin, and will just write code into my HVAC control program (which does integrate to HS).. unless there is a better way..
              -Christopher
              PerfecTemp - the Most advanced HVAC system I've ever Built - and its in my House

              Comment


                #8
                I wrote the code posted, and I haven't found anything better (unfortunately) - so I hope this works for you.

                Comment


                  #9
                  Any plans to create a plugin for the Venstar ColorTouch T5800? I would need it for HS2. Ready to contribute to whomever has the skill to create such a plugin.

                  CJ

                  Comment

                  Working...
                  X