The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Completely pointless example!


  • Subject: Completely pointless example!
  • From: James Traynor <james@xxxxxxx>
  • Date: Sat, 03 Mar 2007 16:17:43 +0000

This is just little example of what could be done with xAP, Floorplan
and a bit of HTML.

I have added a form to the homepage of mi4.biz where you can enter a
message for me. When you click send that message appears instantly on my
SLIMP3 above my monitor and this is how it works:

This is the html form on the homepage:

<form
action="modules.php?name=Messageexample&file=index&func=send"
method="post">
<input size="20" name="stuff"><input
value="Send" type="submit"></form>

This sends the data collected from the input box to a php page on the
same server. That php page receives the data and sends it to my home via
another http request. The reason for doing this rather than just sending
the data straight to my home is that it hides my home IP address, which
is a good thing!

$curl_handle=curl_init('<HomeIP>/custom/On_FromWeb/index.xsp?'.urlencode($stuff));
curl_setopt($curl_handle,CURLOPT_PORT,<Floorplan Web Port>);
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle, CURLOPT_HEADER, false);
$x=curl_exec($curl_handle);


On my xAP Floorplan I have made a custom web page to receive the data
and then send the xAP.

st=replace(getdata,"+"," ")
msg=replace(st,"\'","'")
if msg<>"" then
'send the message.display message
body="display.text" & chr(10)
body=body & "{" & chr(10)
body=body & "Line1=Message from the web" & chr(10)
body=body & "Line2=" & msg & chr(10)
body=body & "Priority=3" & chr(10)
body=body & "Duration=20" & chr(10)
body=body & "}" & chr(10)
x=xap.sendxap(body,"message.display","ersp.slim.server:monitor")
end if


Hopefully it gives a little taster of what can be done and how easy it
would be to extend this to send other messages and do other functions.

So next time you're on mi4 you can say hi!

Cheers

James







xAP_Automation Main Index | xAP_Automation Thread Index | xAP_Automation Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.