2006-01-06, 17:28
the goal is to be able to send http post to a homeseer web server (home automation software which is very popular).
according to the homeseer documentation a simple http command should be accepted directly. if i'm reading it correctly?
here's the page in the online manual for homeseer with the info: homeseer info on controlling devices from html
i simplified my .py to only 2 lines...
error on xbmc log...
i've taken the commands i'm using from working http & asp pages.
here's actual code from an html page i'm using for the same device i'm trying in my .py...
according to the homeseer documentation a simple http command should be accepted directly. if i'm reading it correctly?
here's the page in the online manual for homeseer with the info: homeseer info on controlling devices from html
i simplified my .py to only 2 lines...
Quote:import urllib
urllib.urlopen('http://192.168.1.11', urllib.urlencode({'control_device': 'kitchen lights=off'}))
error on xbmc log...
Quote:file "q:\python\python23.zlib\urllib.py", line 78, in urlopen
file "q:\python\python23.zlib\urllib.py", line 183, in open
file "q:\python\python23.zlib\urllib.py", line 297, in open_http
file "q:\python\python23.zlib\httplib.py", line 712, in endheaders
file "q:\python\python23.zlib\httplib.py", line 597, in _send_output
file "q:\python\python23.zlib\httplib.py", line 564, in send
file "q:\python\python23.zlib\httplib.py", line 548, in connect
ioerror
:
[errno socket error] (10060, 'operation timed out')
i've taken the commands i'm using from working http & asp pages.
here's actual code from an html page i'm using for the same device i'm trying in my .py...
Quote:<form method="post">
<td nowrap class="tableroweven">
<a name="bm83274"></a>
<input type="hidden" name="bookmark" value="83274">
<input type="hidden" name="ref_page" value="stat">
<input type="hidden" name="control_device" value="kitchen lights">
<input class="formbutton" type="submit" name="action_on" value="on">
<input class="formbutton" type="submit" name="action_off" value="off">
<select class="formdropdown" name="selectdim" size="1"
onchange="submitform(this)">
<option selected value="0">0%</option>
<option value="10">10%</option>
<option value="20">20%</option>
<option value="30">30%</option>
<option value="40">40%</option>
<option value="50">50%</option>
<option value="60">60%</option>
<option value="70">70%</option>
<option value="80">80%</option>
<option value="90">90%</option>
<option value="100">100%</option>
</select>
</td></form>