Radio Thermostat CT-30 / Filtrete 3M-50 Codes & Feedback
Posted: Sun Aug 11, 2013 8:14 pm
Have been working on my project and just assimilated the CT-30 Wifi model. Great little thermostat for 100 bucks, works really well, maintains connection to WIFI as long as you have a C-wire connection. Install was a breeze, with the help of Demopad I was also able to get it working, there was scant information on the web for this device, so I decided to post the codes I'm using to control the thermostat in Demopad. You will want to make sure that you set the device as a static IP.
This device communicates on port 80 (default port, but not specifically mentioned in the API).
The API can be found here: http://www.radiothermostat.com/document ... PIV1_3.pdf
Almost the entire controllable directory for this device is contained within the /tstat directory, the commands I use to control this device are below, i will list one basic one for POST, and GET.
POST COMMANDS:
POST /tstat HTTP/1.1
Connection: Close
Content-Type: application/x-www-form-urlencoded
Content-Length: 39
{"tmode":2,"t_cool":[SetTemp],"hold":1}
This, per the API, sets the thermostat to cool, and sets a temp, [SetTemp] is a variable within demopad that I created (this can also just be a basic number, say 72, or another variable you create.) It also turns the hold program on -- any number of actions can be accessed as long as they are in the /tstat directory, if in a different directory, or sub-directory, you just need to make sure to replace /tstat, or add to it like: /tstat/tmode -- this will allow you to get even more specific in the data that is returned from the device.
You also must use the other information (connection, content-type, content-length, and you must specify the length)
GET COMMANDS:
GET /tstat HTTP/1.1 \x0D\x0A
The GET command is easier, and is best used with feedback. The code referenced above will return ALL data points referenced in that directory of the device. For instance, that code will return the following (or something similar depending on the current state of your thermostat):
{"temp":73.00,"tmode":0,"fmode":0,"override":0,"hold":0,"tstate":0,"fstate":0,"time":{"day":6,"hour":12,"minute":7},"t_type_post":0}
This information can then be used in the 2 way feedback as such:
For the code termination i use a single bracket "}" -- do not need quotes, or else it wont work. As you can see from the code above this is the last piece of data that comes through, so demopad will know that the last item is that bracket, and then will evaluate the data with regex.
The regex was tricky, using the regex you DO NOT want to use brackets, an example of regex would be like this: "temp":(.*) -- however you will find that this includes extra characters that you may not want, so I instead opted for this regex code -- "temp":(.....), each decimal returns one character of data, so you can format how you see fit.
You also want to make sure that you are setting it to look for a pattern not specific data, although you can do either, depending on the functions you are trying to program, but I believe the regex only works when looking for a pattern.
That is pretty much it, I find for my purposes that this covers everything i need to do 100%.
Hope this wasn't too confusing.
This device communicates on port 80 (default port, but not specifically mentioned in the API).
The API can be found here: http://www.radiothermostat.com/document ... PIV1_3.pdf
Almost the entire controllable directory for this device is contained within the /tstat directory, the commands I use to control this device are below, i will list one basic one for POST, and GET.
POST COMMANDS:
POST /tstat HTTP/1.1
Connection: Close
Content-Type: application/x-www-form-urlencoded
Content-Length: 39
{"tmode":2,"t_cool":[SetTemp],"hold":1}
This, per the API, sets the thermostat to cool, and sets a temp, [SetTemp] is a variable within demopad that I created (this can also just be a basic number, say 72, or another variable you create.) It also turns the hold program on -- any number of actions can be accessed as long as they are in the /tstat directory, if in a different directory, or sub-directory, you just need to make sure to replace /tstat, or add to it like: /tstat/tmode -- this will allow you to get even more specific in the data that is returned from the device.
You also must use the other information (connection, content-type, content-length, and you must specify the length)
GET COMMANDS:
GET /tstat HTTP/1.1 \x0D\x0A
The GET command is easier, and is best used with feedback. The code referenced above will return ALL data points referenced in that directory of the device. For instance, that code will return the following (or something similar depending on the current state of your thermostat):
{"temp":73.00,"tmode":0,"fmode":0,"override":0,"hold":0,"tstate":0,"fstate":0,"time":{"day":6,"hour":12,"minute":7},"t_type_post":0}
This information can then be used in the 2 way feedback as such:
For the code termination i use a single bracket "}" -- do not need quotes, or else it wont work. As you can see from the code above this is the last piece of data that comes through, so demopad will know that the last item is that bracket, and then will evaluate the data with regex.
The regex was tricky, using the regex you DO NOT want to use brackets, an example of regex would be like this: "temp":(.*) -- however you will find that this includes extra characters that you may not want, so I instead opted for this regex code -- "temp":(.....), each decimal returns one character of data, so you can format how you see fit.
You also want to make sure that you are setting it to look for a pattern not specific data, although you can do either, depending on the functions you are trying to program, but I believe the regex only works when looking for a pattern.
That is pretty much it, I find for my purposes that this covers everything i need to do 100%.
Hope this wasn't too confusing.