Author Topic: Radio Thermostat owners: can you help me out on new driver?  (Read 644 times)

mkbrown69

  • Guru
  • ****
  • Posts: 192
    • View Profile
Radio Thermostat owners: can you help me out on new driver?
« on: August 30, 2013, 04:31:18 am »
Hi Folks!

I'm currently working on a driver for the Radio Thermostat CT-80, which uses the API.  Because it uses the API, it's a possible universal driver for all Radio Thermostat models.  I've based mine on Sean's (aka WhateverFits) excellent 3M50 driver (thanks for the great work Sean!), and updated it for the additional capabilities of the CT-80 plus other API features which should work with other models. There's been a bit of discussion in this thread:  http://forum.linuxmce.org/index.php/topic,13336.0.html

In order to try and make this a universal driver, I'm hoping some other Radio Thermostat owners could do me a favor, and post the results of a few URL's off of your thermostat.  That way, I can make sure I don't break anybody's usage of their thermostats if they try my driver.  ;). So, if you have a 3M50, a CT-30, or a CT-80, if you could post the results of some URL's, it would let me make sure that I'm not making assumptions on the capabilities of the various models, as the API docs don't go into enough specifics as to what devices have which capabilities.

You should be able to use a web browser, and just paste the URL's into the browser address bar.  I'll also post a curl version people can run from the core via command line.  Just substitute the xxx with the proper address of your thermostat (or the full IP if you're not using the normal subnet range for the LMCE network)

Code: [Select]
http://192.168.80.xxx/tstat/model

http://192.168.80.xxx/sys

http://192.168.80.xxx/tstat/help

http://192.168.80.xxx/tstat/eventlog

Code: [Select]
curl http://192.168.80.xxx/tstat/model

curl http://192.168.80.xxx/sys

curl http://192.168.80.xxx/tstat/help

curl http://192.168.80.xxx/tstat/eventlog

Thanks for your assistance with this!

/Mike

WhateverFits

  • Guru
  • ****
  • Posts: 228
    • View Profile
    • Sean Walker
Re: Radio Thermostat owners: can you help me out on new driver?
« Reply #1 on: September 04, 2013, 03:09:20 am »
Here you go!

Code: [Select]
{"model":"CT50 V1.94"}
Code: [Select]
{"uuid":"5cdad4fdb577","api_version":113,"fw_version":"1.04.84","wlan_fw_version":"v10.105576"}
Code: [Select]
/}ir_baffle get set
/datalog get x
/dehumidifier get set
/ext_dehumidifier get set
/errstatus get x
/eventlog get x
/fmode get set
/fan_ctime get set
/help get x
/hold get set
/humidity get x
/hvac_recovery get set
/hvac_settings get x
/humidifier get set
/led x set
/lock get set
/model get x
/night_light get set
/override get x
/power get set
/beep x set
/uma x set
/pma x set
/temp get x
/differential get set
/time/day get x
/time/hour get x
/time
Code: [Select]
{"eventlog":[["hour","minute","relay","temp","humidity","ttemp"],[17,46,64,74.50,0,73],[17,51,64,74.50,0,73],[17,56,64,75.00,0,73],[18,1,64,75.00,0,73],[18,6,64,75.00,0,73]]}

mkbrown69

  • Guru
  • ****
  • Posts: 192
    • View Profile
Re: Radio Thermostat owners: can you help me out on new driver?
« Reply #2 on: September 04, 2013, 05:02:40 am »
Thanks Sean!  Much appreciated.

We're pretty close on firmware versions: mine's running 1.04.83, so I'm guessing you use the Radio Thermostat app, and the "cloud service"? Mine is running what it shipped with; haven't done the app yet.

The /tstat/help output is interesting, but not surprising. It's showing the complete API listing, given that it's implemented in the radio, not the tstat itself.  I was rather hoping it would only expose the functionality that the device was actually capable of, but that doesn't appear to be the case...

Good news is that the driver should work properly for you functionally.  I think I'll have to implement some additional error trapping for some routines to ensure that the driver doesn't puke if it tries to query device capabilities that don't exist. I'll also leave some of the advanced functionality out for a bit, until the driver's been out in the wild for a while.

Hope to get it finished (for now) later this week, and then released for broader testing.  Thanks for your help with this!

/Mike

WhateverFits

  • Guru
  • ****
  • Posts: 228
    • View Profile
    • Sean Walker
Re: Radio Thermostat owners: can you help me out on new driver?
« Reply #3 on: September 04, 2013, 05:47:36 am »
I noticed that errors have a tendency to disable the device in LMCE so good error handling is a must.  ;D

Let me know what you have and I'll see what I can help with too.

WhateverFits

  • Guru
  • ****
  • Posts: 228
    • View Profile
    • Sean Walker
Re: Radio Thermostat owners: can you help me out on new driver?
« Reply #4 on: September 04, 2013, 05:57:52 am »
Found an error in the error logs:

 PHP Notice:  Undefined index: idx in /var/www/lmce-admin/qOrbiterGenerator.php on line 843, referer: http://forum.linuxmce.org/index.php?action=post;topic=13344.105;num_replies=106


Code: [Select]
$paramArray = array();
$paramArray["device"] = array("device"=>$_GET["idx"]);
$res = mysql_query(mysql_real_escape_string($sql), $conn) or die(mysql_error($conn));
$p1Array = array();
 while ($row = mysql_fetch_array($res)){