Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Radio Thermostat - Wifi Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: September 01 2014 at 14:16 | IP Logged Quote smarty

I just bought a pair of CT50e thermostats (with wifi USSNAP radios) for the house. The stats have a published API Here.

I think PH should be able to GET/POST information to and from the thermostat. Has anyone ever used these before with PowerHome?

I am having some initial difficulty getting these set up on my network, so if anyone has any personal experience, it would be greatly appreciated.

__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: September 03 2014 at 19:18 | IP Logged Quote smarty

I have my wifi Tstats hooked up. They seem to work well. I am able to RECIEVE data off them. For example:

ph_getitcurl("192.168.0.50/tstat",20)

returns

Execution time: 2.244 seconds.
     The formula evaluates to: {"temp":77.50,"tmode":3,"fmode":0,"override":0,"hold":0,"tst ate":0,"fstate":0,"time":{"day":2,"hour":19,"minute":4},"t_t ype_post":0}

I am now reading the API document (link above), trying to figure out what PH formula will let me SEND a command to them. For example, from the API document (to turn the Fan On):

2.5.5 Set fan mode to ON
The following curl command sets the fan mode to ON.
$ curl -d '{"fmode":2}' http://192.168.0.50/tstat
{“success”: 0}


I tried
ph_posturl1("192.168.0.50/tstat","fmode:2",0,20)
but the Tstat give a bad response (see below).

What else can I try?

Transfer-Encoding: chunked
Content-Type: text/plain

181
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ; ;
<html>
<head><title>Wireless Thermostat - 404</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body>
Whoops! This page doesn't exist. You probably meant to go to <a href="home.shtml">the main page.</a>
</body>
</html>

0

HTTP/1.1 404 Not Found
Server: Marvell 8688WM
Connection: close
Transfer-Encoding: chunked
Content-Type: application/octet-stream

181
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ; ;
<html>
<head><title>Wireless Thermostat - 404</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body>
Whoops! This page doesn't exist. You probably meant to go to <a href="home.shtml">the main page.</a>
</body>
</html>

0





Edited by smarty - September 03 2014 at 19:37


__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: September 03 2014 at 19:37 | IP Logged Quote smarty

This didn't work either:

ph_sendsocketdata("192.168.0.50/tstat",80,"{fmode:2}")

How can I tell what port these Tstats use???

__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: September 03 2014 at 19:55 | IP Logged Quote smarty

I guess I could also just download and install the cURL executable command line tool for windows.

I was hoping to find a "cleaner" approach....will keep looking from within PH.


Link Here

__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
lizaoreo
Groupie
Groupie


Joined: February 11 2013
Location: United States
Online Status: Offline
Posts: 75
Posted: September 23 2014 at 13:23 | IP Logged Quote lizaoreo

I've got something sorta set up with a CT80. I've been somewhat lazy in my implementation, so at the moment it's just changing the global values I made for the temperature and status in PowerHome, but PowerHome isn't even doing anything with that data yet.

I actually had already set up a data collection thing, so I have a PowerShell script that runs once a minute and queries the thermostat for all the data and writes it to a MySQL database my really simple home status site pulls from (http://www.lizaoreo.net).

Then I wrote a simple C# app that runs in the background and polls the MySQL database every minute and updates the global variables for the temp and stuff. I don't know enough to know how to make a plugin that acts like a thermostat using the PowerHome built in stuff, so this is how I did it.

Let me know if you're interested, I can share my code and stuff if you're interested, though you seem to have the read part figured out in a different way from me.
Back to Top View lizaoreo's Profile Search for other posts by lizaoreo
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum