PDA

View Full Version : Displaying custom text on 2 Players



Chris Saunders
2004-04-12, 09:07
Mike,

Would you be willing to share your script with the world of users that use
both Homeseer and Slim?

Thanks,

ChriS

-----Original Message-----
From: discuss-bounces (AT) lists (DOT) slimdevices.com
[mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf Of Mike Brand
Sent: Monday, April 12, 2004 8:42 AM
To: Slim Devices Discussion
Subject: [slim] Displaying custom text on 2 Players

Thanks Kevin, Max, & Dean,

I modified my HomeSeer Script and now have text displaying properly on
both my Slimp3's. Thanks for the information on xAP it looks pretty
cool! I am definitely going to take a closer look and determine how I
can integrate it into my setup.

Mike
On Apr 12, 2004, at 5:59 AM, Kevin Hawkins wrote:

> There is a xAP connector available for the SliMP3 and Squeezebox
> players
> which does exactly this. It will handle multiple players and also
> multiple
> messages. It incorporates a true queue system such that timed messages
> sent
> to players are properly queued for the correct times sequentially and
> the
> correct players independantly. This stops later messages overwriting
> earlier
> ones. There is also the ability to force messages to the front of the
> queue
> if you want.
>
> If you have a xAP source for your weather / temp sensors etc (there
> are a
> few applications for this) then you could hang it all together this
> way. Or
> if you use HomeSeer then you can script and use your existing sensor
> inputs.
> It takes a bit of work but is a true network solution.
>
> I have inside and outside temp plus my alarm system connected like
> this. At
> night the bedside Squeezebox is normally OFF with no display (I find
> even on
> the lowest DIM setting it is still too bright). Should there an
> unexpected
> alarm sensor triggered downstairs then the Squeezebox switches on to
> full
> brightness and plays a little 'alarm' sound - displayed on the screen
> is the
> name of the sensor that has tripped.
>
> You can also insert some of your own menus into the Slim ones this way
> - I
> use some of the spare keys on the IR remote to switch on and off my
> temp
> display one which effectively then replaces the time when OFF. It is
> even
> possible to insert some text into the existing menus this way but that
> requires a little more work. It avoids having to mod the server code
> though.
>
> Eg Monday, April 12, 2004
> IN: 21 11:49:41 AM OUT: 5
>
> Kevin
>
>
> The xAP Slim Connector requires a network attached Windows machine to
> run on
> (uses .NET) although the SlimServer can be any variant. It is
> available from
>
>
> www.xapframework.net
>
> xAP Weather is available from
>
> www.mi4.biz
>
>
>
>> -----Original Message-----
>> From: discuss-bounces (AT) lists (DOT) slimdevices.com
>> [mailto:discuss-bounces (AT) lists (DOT) slimdevices.com] On Behalf
>> Of Mike Brand
>> Sent: 11 April 2004 17:21
>> To: Slim Devices Discussion
>> Subject: [slim] Displaying custom text on 2 Players
>>
>> Is it possible to display custom text on 2 Slimp3 players
>> simultaneously? Or better yet, display different messages
>> on different Slimp3's?
>>
>> Here is the scenario, I have 2 players one in the Family
>> Room and one in the Bedroom. I use my home automation
>> program, Homeseer, to write the outside temperature,
>> wind-speed, and home status to the player when it is
>> stopped. this worked fine when I had 1 Slimp3. Now that I
>> have 2 Slimp3's the status info is only being written to
>> the first player in my list.
>>
>> I do not see any variables or method to specify which
>> Slimp is being written using the following command:
>>
>> http://localhost:9000/status.txt?
>> p0=display&p1=Firstline&p2=secondline&p3=5
>> Unless there is an updated version of the HTTP interface
>> documentation, which I cannot seem to find.
>>
>> Thanks
>> Mike
>>
>>

Mike Hollick
2004-04-12, 10:30
> Would you be willing to share your script with the world of users that use
> both Homeseer and Slim?

I'll second this request!

-->Mike

Mike Brand
2004-04-24, 05:49
Sorry for the delay in posting my script...

It is not pretty, but it does work...

Hope this is helpful

sub main()

dim s
dim host
dim user
dim password
dim command
dim rfile
dim lfile
dim path
dim FastCat
dim printer
dim sText
dim value
dim dv
dim page
dim line1
dim line2
dim p2
dim p1
dim MyPos

'initial Variables
'Address of SliMP3 Server
p1="localhost"
MyPos=0
page=""

'dv = hs.GetDeviceEx("weatherplug S1 Temperature")

'temp = right(hs.devicestring "a16", 3)
'temp = Replace(temp, ">", "")
'temp = Replace(temp, "'", "")




'Debug Statements
'hs.WriteLog "SlimStat1", page
'hs.WriteLog "SlimStat2", MyPos



' Now let's write it all to the file
line1=""
line2=""
'get time
'line1 = line1 & "Time: " & Now & " "
'get Temp
dv=right(hs.DeviceString("W1"),3)
dv = Replace(dv, ">", "")
dv = Replace(dv, "'", "")
line1 = line1 & "Temp: " & dv & "F "
'get Temp Feel
dv=right(hs.DeviceString("W13"),3)
dv = Replace(dv, ">", "")
dv = Replace(dv, "'", "")
'strip degree symbol, if it shows up
dv = Replace(dv, chr(176), "")
line1 = line1 & "Feels: " & dv & "F "
'get Humidity
dv=right(hs.DeviceString("W8"),4)
dv = Replace(dv, ">", "")
dv = Replace(dv, "'", "")
line1 = line1 & "Humidity: " & dv & " "
'get Temp High + Low
dv=right(hs.DeviceString("W9"),3)
dv = Replace(dv, ">", "")
dv = Replace(dv, "'", "")
value=right(hs.DeviceString("W10"),3)
value = Replace(value, ">", "")
value = Replace(value, "'", "")
'line2 = line2 & "H/L Temp: " & dv & " / " & value & " "
'get wind speed & Direction
dv=right(hs.DeviceString("W3"),3)
dv = Replace(dv, ">", "")
dv = Replace(dv, "'", "")
value=right(hs.DeviceString("W2"),3)
value = Replace(value, ">", "")
value = Replace(value, "'", "")
line2 = line2 & "Wind: " & dv & " " & value & " "
'get wind Gust
dv=right(hs.DeviceString("W4"),3)
dv = Replace(dv, ">", "")
dv = Replace(dv, "'", "")
line2 = line2 & "Gust: " & dv & " "
'get System Uptime
'dv=hs.SystemUptime
'sText = sText & "Uptime: " & dv & "<br><br>"
'get Front Door
dv=hs.DeviceString("[19")
sText = sText & "Front Door: " & dv & "<br>"
'get Garage Door
dv=right(hs.DeviceString("[21"),7)
'dv=hs.DeviceString("[21")
dv = Replace(dv, ">", "")
dv = Replace(dv, "'", "")
dv = Replace(dv, "0", "")
line2 = line2 & "Garage: " & dv & " "
'get Sliding Glass Door
dv=hs.DeviceString("[14")
sText = sText & "Sliding Door: " & dv & "<br>"
'get Rear Door
dv=hs.DeviceString("[16")
sText = sText & "Rear Door: " & dv & "<br>"
'close my html file
sText = sText & "</p></BODY></HTML>"


'Bedroom Slim
'&player=00%3A04%3A20%3A04%3A0b%3A39
'mac addr->00:04:20:04:0b:39
'Family Room Slim
'&player=00%3A04%3A20%3A03%3A03%3A48
'mac addr->00:04:20:03:03:48

'check Family Room player status
page =
hs.GetURL(p1,"/status.html?
p0=status&player=00%3A04%3A20%3A03%3A03%3A64",FALSE,9000)

'Search for Now Playing
MyPos = InStr(1,page,"Now playing")

'if SliMP3 is playing then don't write to the display
if MyPos = 0 then

' create the display for SliMP3
p2="/status.html?p0=display&p1=" & line1 & "&p2=" & line2
&"&p3=15&player=00%3A04%3A20%3A03%3A03%3A64"
'Send it
page = hs.GetURL(p1,p2,TRUE,9000)

end if

'check Bedroom player status
page =
hs.GetURL(p1,"/status.html?
p0=status&player=00%3A04%3A20%3A04%3A0b%3A4c",FALSE,9000)

'Search for Now Playing
MyPos = InStr(1,page,"Now playing")

'if SliMP3 is playing then don't write to the display
if MyPos = 0 then

' create the display for SliMP3
p2="/status.html?p0=display&p1=" & line1 & "&p2=" & line2
&"&p3=15&player=00%3A04%3A20%3A04%3A0b%3A4c"
'Send it
page = hs.GetURL(p1,p2,TRUE,9000)

end if


end sub




On Apr 12, 2004, at 12:30 PM, Mike Hollick wrote:

>> Would you be willing to share your script with the world of users
>> that use
>> both Homeseer and Slim?
>
> I'll second this request!
>
> -->Mike
>
>