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]

Re: xPL integration


  • Subject: Re: xPL integration
  • From: "rleong1" <rleong1@xxxxxxxxx>
  • Date: Tue, 22 Aug 2006 21:46:05 -0000

i play on both sides of the fence, so i've written a few scripts to do
simple passing of xap data to the xpl world.

i've pasted a simple script to pass xap weather stuff to xpl at the
bottom.

i use medianet w/ my 5 rios but i use slimserver for my 2 slimp3s &
squeezebox.  the xpl slimserver is very robust and i've fed some
changes into the slimserver build for xpl stuff.  from what i've read
the xap slimserver connector isn't maintained anymore or all that stable?

tts through medianet is also a cool feature, for doing zoned
announcements to rios, etc.

i also use tony's xpl phone app.  there doesn't seem to be a xap phone
app that supports regular pci modems (only certain serial modems).

anyway, my script below:



' start script XAP_MI4_WEATHER.xpl:
sub XAP_MI4_WEATHER(xapmsg,host)
'
' get source, if you need it uncomment it
'
' Mysrc = xap.getparam(xapmsg,0,"source")
'
' count sections if necessary
'
' Mycount = xap.bodycount(xapmsg)
'
' get the name of section 1 of the xAP message
'
Mysect=xap.getsection(xapmsg,1)
'
' get Weather.Report section
'
if Mysect = "Weather.Report" then
'
' grab info
'
Mytempf=xap.getparam(xapmsg,1,"tempf")
Mydewf=xap.getparam(xapmsg,1,"dewf")
Myicon=xap.getparam(xapmsg,1,"icon")
Mywindm=xap.getparam(xapmsg,1,"windm")
Mywinddirc=xap.getparam(xapmsg,1,"winddirc")
'
' set xplhal global variables
'
Sys.value("XAP_WEATHER_TEMP")= Mytempf
Sys.value("XAP_WEATHER_DEW")= Mydewf
Sys.value("XAP_WEATHER_ICON")= Myicon
Sys.value("XAP_WEATHER_WIND")= Mywindm & " mph "
& Mywinddirc
'
' send xpl sensor.basic message (not a defined schema but my made
up one)
'
Mymsg = "device=weather" & chr(10) &
"type=generic" & chr(10) &
"tempf=" & Mytempf & chr(10) & "dewf="
& Mydewf & chr(10) & "icon=" &
Myicon & chr(10) & "windm=" & Mywindm & chr(10)
& "winddirc=" & Mywinddirc
call
xpl.SendMsg("XPL-STAT","*","SENSOR.BASIC",Mymsg)
end if
end sub

' subroutines to call the main subroutine
' these are set up for the different sources (weather reports)
' i receive
sub XAP_MI4_WEATHER_KXYZ(xapmsg)
XAP_MI4_WEATHER xapmsg,"KXYZ"
end sub

sub XAP_MI4_WEATHER_KABC(xapmsg)
XAP_MI4_WEATHER xapmsg,"KABC"
end sub

' end file









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.