www.homeseer.com    
 

Go Back   HomeSeer Message Board > Media Plug-ins > Media Discussion > SqueezeBox Plug-In (3P)

SqueezeBox Plug-In (3P) Discussion area for the SqueezeBox plug-in by PCP.

Reply
 
Thread Tools Display Modes
  #1  
Old December 21st, 2009, 11:15 PM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,678
SqueezeBox plugin V2.0.0 beta 1

Attached is version 2.0.0 beta 1 of the SqueezeBox plugin. The major goal for this release is HSTouch support, though it includes a few other enhancements. This is a first version toward HSTouch support and I am looking for feedback! I tried a few HSTouch screens but I am sure you will
come up with other variations, library sizes and usage pattern that will provide valuable feedback.

New features
  • HS-Touch support
  • Option to use Location2 instead of Location to organize Devices in SqueezeBox player menus
  • Option to display caller name from address book when caller-id is briefly displayed
  • New Power button in player's HS2 device to toggle the player’s power
  • New HS2 actions to set the song rating using percent (0 to 100%) and to toggle the player's power
  • Support for HS2 MusicAPI and MultiZoneAPI and each player is considered a different zone.
  • Added wait argument to several existing APIs. If set to true, the API will only return once Squeezebox Server sent a reply.
  • Periodic query of currently playing song time
  • Icon displayed in SqueezeBox Controller next to the “HomeSeer – HS2” top menu label
  • Updated documentation
Bug Fixes
  • After last song in the Now Playing Playlist ends, the player’s status is now updated
  • When multiple HS2 devices with the same name are added in a player menu group (based on location or location2), the house/device code is added to the name of duplicates to make them unique. Previously an error message was added to the log file and the menu was not displayed.
This is Beta software! Backup before installing the attached beta update. This Beta software should be installed on top of the currently released plug-in available from the updater. Once installed, do not forget to update the SqueezeBox Server plugin using the Extension Downloader.

NOTE 1: I updated the plug-in to version 2.0.0.2. This version creates MusicAPI instances for disconnected players and also uses a different approach to collect information about the current song and especially the artwork. Still some work to do regarding support of some character sets and noticed that HS Touch once a while does not update the arwork while the cached image has been updated.

I also highly recommend you update to HSTouch server plugin 1.0.0.12 (see http://board.homeseer.com/showpost.p...16&postcount=1 for details).

NOTE 2: I updated the plug-in to version 2.0.0.3. This version corrects a problem when new players are added and when searching the library when non ASCII characters are used (note that these searches are slower that others for now due to a SB Server query issue).
Attached Files
File Type: zip HomeSeerPluginSqueezeBox_2.0.0.3.zip (993.7 KB, 194 views)

Last edited by pcp; January 23rd, 2010 at 10:39 PM.
Reply With Quote
  #2  
Old December 22nd, 2009, 05:33 AM
Droezel Droezel is offline
Seer
 
Join Date: Jul 2007
Location: Belgium
Posts: 35
I did the update and all seems to be working great. I like the power toggle

I have another feature request for when you have the time: alarm integration!

I just bought 2 SB Radio's and I would like to have a device per SB radio that shows the alarm status (enabled/disabled) and the next date/hour the alarm would go off. It would also be usefull to have a squeezebox alarm event trigger condition. When the alarm goes off I could open the blinds, start the boombox in the bathroom, etc...

This way you can set your alarms on the radio before you go to sleep, and homeseer can fire all sorts of events to get you out of bed.
Reply With Quote
  #3  
Old December 22nd, 2009, 08:04 AM
markus.bergvoll markus.bergvoll is offline
Seer Deluxe
 
Join Date: Oct 2008
Location: Norway
Posts: 305
Hi,
is this supposed to work as the mediaplayer plugin in HST?

Can i use the standard "default" music browser. I can only chose the MediaPlayer or default.

I might have misunderstood the integration....

I also get this error on startup of HS

PHP Code:
22.12.2009 12:32:41  SqueezeBox Error An unexpected error occured in the RegisterCallback() function/subroutine:  [System.InvalidCastExceptionKonvertering fra strengen 1.0 til typen Double er ikke gyldig. ---> System.FormatExceptionInndatastrengen hadde ugyldig format.   ved Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String ValueNumberFormatInfo NumberFormat)   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String ValueNumberFormatInfo NumberFormat)   --- Slutten på sporingen av intern unntaksstakk ---   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String ValueNumberFormatInfo NumberFormat)   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(Object ValueNumberFormatInfo NumberFormat)   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(Object Value)   ved HSPI_SQUEEZEBOX.HSPI.RegisterCallback(Objectfrm)] 
In english it says something about converting string to double is not legal
__________________
Markus
Home Automation Beginner
Reply With Quote
  #4  
Old December 22nd, 2009, 08:52 AM
Droezel Droezel is offline
Seer
 
Join Date: Jul 2007
Location: Belgium
Posts: 35
I don't know if it's gonna help you with my request for alarm clock integration, but I just created a little sample to read the alarms from a player and output them in a console application (vb.net):

Code:
Module Module1

    Sub Main()

        Dim client As System.Net.Sockets.TcpClient
        Dim reader As System.IO.StreamReader
        Dim writer As System.IO.StreamWriter
        Dim result As String

        Dim alarm As Hashtable
        Dim resultarray() As String
        Dim alarms() As Hashtable
        Dim alarmsCount As Integer = -1

        client = New System.Net.Sockets.TcpClient("10.111.0.4", 9090) 'connect to squeezebox server
        reader = New System.IO.StreamReader(client.GetStream, System.Text.Encoding.ASCII)
        writer = New System.IO.StreamWriter(client.GetStream, System.Text.Encoding.ASCII)
        writer.AutoFlush = True

        writer.WriteLine("00:04:20:26:56:6a alarms 0 5") 'send the get alarms cli command
        result = System.Web.HttpUtility.UrlDecode(reader.ReadLine) 'read the result

        Console.WriteLine("Result: " + result)
        Console.WriteLine("")

        result = result.Substring(result.IndexOf("id:")) 'cut of everyting before the id of the first alarm
        resultarray = result.Split(New Char() {" "c}) 'put results in an array per key:value

        'put the alarms into hashtables
        For i As Integer = 0 To resultarray.Length - 1
            Dim str As String = System.Web.HttpUtility.UrlDecode(resultarray(i))
            Dim index As Integer = str.IndexOf(":"c)
            If (index <> -1) Then
                Dim key As String = str.Substring(0, index)
                Dim value As String = str.Substring((index + 1))
                If key.Equals("id") Then
                    alarm = New Hashtable
                    alarmsCount += 1
                End If
                alarm.Add(key, value)
                If key.Equals("url") Then
                    ReDim Preserve alarms(alarmsCount)
                    alarms(alarmsCount) = alarm
                End If
            End If
        Next

        'write the alarms
        For i As Integer = 0 To alarmsCount
            Console.WriteLine("ID: " + alarms(i)("id"))
            Console.WriteLine("Dow: " + alarms(i)("dow"))
            Console.WriteLine("Enabled: " + alarms(i)("enabled"))
            Console.WriteLine("Repeat: " + alarms(i)("repeat"))
            Console.WriteLine("Time: " + alarms(i)("time") + " = " + getTime(alarms(i)("time").ToString).ToString)
            Console.WriteLine("Volume: " + alarms(i)("volume"))
            Console.WriteLine("Url: " + alarms(i)("url"))
            Console.WriteLine("")
        Next

        Console.ReadLine()

    End Sub

    Private Function getTime(ByVal sTime As String) As TimeSpan

        'convert the time string to a real time
        Dim ihour As Integer
        Dim iMinutes As Integer

        ihour = CInt(sTime) / 3600
        iMinutes = (CInt(sTime) Mod 3600) / 60

        Return New TimeSpan(ihour, iMinutes, 0)

    End Function

End Module
I could go on with creating a script to add my desired functionality, but offcourse it would be nicer to have it integrated in the plugin.
Reply With Quote
  #5  
Old December 22nd, 2009, 09:14 AM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,678
The integration should work as does the Media player. i.e. via the Music APIs except that each player is a different zone. If you create a new screen, drop the Music overlay, you should see a selection of Music players and in the SB case, one per player (assuming the initialization did not fail of course). I am not sure how HSTouch desides what the Default Music source is; any idea?

Note that in some cases, the first player/zone name was missing from my list of Music player choices in HSTouch. It does not seem to be a SB plug-in issue and reported it to HS for further analysis (see the know problem in the plug-in version section in the doc as well).

What is the Locale on your HS2 computer? I will have to look the initialization problem tonight to find out what might be the cause. Not sure if this is related, but can you try to define an entry as follows in the plug-in INI file and in the settings sections?

[Settings]
PlayerMonitoringInterval=1


Quote:
Originally Posted by markus.bergvoll View Post
Hi,
is this supposed to work as the mediaplayer plugin in HST?

Can i use the standard "default" music browser. I can only chose the MediaPlayer or default.

I might have misunderstood the integration....

I also get this error on startup of HS

PHP Code:
22.12.2009 12:32:41  SqueezeBox Error An unexpected error occured in the RegisterCallback() function/subroutine:  [System.InvalidCastExceptionKonvertering fra strengen 1.0 til typen Double er ikke gyldig. ---> System.FormatExceptionInndatastrengen hadde ugyldig format.   ved Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String ValueNumberFormatInfo NumberFormat)   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String ValueNumberFormatInfo NumberFormat)   --- Slutten på sporingen av intern unntaksstakk ---   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String ValueNumberFormatInfo NumberFormat)   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(Object ValueNumberFormatInfo NumberFormat)   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(Object Value)   ved HSPI_SQUEEZEBOX.HSPI.RegisterCallback(Objectfrm)] 
In english it says something about converting string to double is not legal

Last edited by pcp; December 22nd, 2009 at 09:33 AM.
Reply With Quote
  #6  
Old December 22nd, 2009, 09:25 AM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,678
Good suggestion and convinces me to look into it! I looked it once but then wasn't sure if HS2 should be the system generating alarms or SB. I can see others in the house would enjoy lights on and dimmed, etc... the side effect is that I will not be able to support as many players if I add additional devices per player. Thanks for the code you supplied.

Quote:
Originally Posted by Droezel View Post
I did the update and all seems to be working great. I like the power toggle

I have another feature request for when you have the time: alarm integration!

I just bought 2 SB Radio's and I would like to have a device per SB radio that shows the alarm status (enabled/disabled) and the next date/hour the alarm would go off. It would also be usefull to have a squeezebox alarm event trigger condition. When the alarm goes off I could open the blinds, start the boombox in the bathroom, etc...

This way you can set your alarms on the radio before you go to sleep, and homeseer can fire all sorts of events to get you out of bed.
Reply With Quote
  #7  
Old December 22nd, 2009, 09:30 AM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,678
Is there any interest in having a music selection page in the plug-in HTML pages or do you all plan to either use HSTouch or the Squeezebox Server HTML pages?
Reply With Quote
  #8  
Old December 22nd, 2009, 10:06 AM
Droezel Droezel is offline
Seer
 
Join Date: Jul 2007
Location: Belgium
Posts: 35
I am perfectly satisfied with the squeezebox pages and the squeezebox controller to do music selections. Wouldnt need music selection in the homeseer webinterface since I rarely use it.
Reply With Quote
  #9  
Old December 22nd, 2009, 03:25 PM
ewassink ewassink is offline
Seer
 
Join Date: Dec 2007
Location: Netherlands
Posts: 6
It must be christmass :-)

I recently bought a second SB and was silently waiting for HStouch support. Now it's here,....well in beta anyway

Can't wait to finish my music screen with this plug-in. It installed nicely and looks very promising.

Quote:
Originally Posted by pcp View Post
...
Note that in some cases, the first player/zone name was missing from my list of Music player choices in HSTouch. It does not seem to be a SB plug-in issue and reported it to HS for further analysis (see the know problem in the plug-in version section in the doc as well).
It did also ran into the above issue though (with 2 players only 1 showing up). But I'm sure that can be solved.

Nice to see this plug-in being actively supported/developped... thanks !!
Reply With Quote
  #10  
Old December 22nd, 2009, 05:25 PM
Jakob.Sand's Avatar
Jakob.Sand Jakob.Sand is offline
Seer Deluxe
 
Join Date: Jan 2008
Location: Denmark, Karlebo
Posts: 471
Looks great.
Will add support for creating a HS Menu in SB Radio Device?
__________________
Best,
Jakob Sand, I automate everything!
Reply With Quote
  #11  
Old December 22nd, 2009, 07:46 PM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,678
I uploaded a newer version that should resolve this issue.

Quote:
Originally Posted by markus.bergvoll View Post
Hi,
is this supposed to work as the mediaplayer plugin in HST?

Can i use the standard "default" music browser. I can only chose the MediaPlayer or default.

I might have misunderstood the integration....

I also get this error on startup of HS

PHP Code:
22.12.2009 12:32:41  SqueezeBox Error An unexpected error occured in the RegisterCallback() function/subroutine:  [System.InvalidCastExceptionKonvertering fra strengen 1.0 til typen Double er ikke gyldig. ---> System.FormatExceptionInndatastrengen hadde ugyldig format.   ved Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String ValueNumberFormatInfo NumberFormat)   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String ValueNumberFormatInfo NumberFormat)   --- Slutten på sporingen av intern unntaksstakk ---   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String ValueNumberFormatInfo NumberFormat)   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(Object ValueNumberFormatInfo NumberFormat)   ved Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(Object Value)   ved HSPI_SQUEEZEBOX.HSPI.RegisterCallback(Objectfrm)] 
In english it says something about converting string to double is not legal
Reply With Quote
  #12  
Old December 22nd, 2009, 07:48 PM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,678
Quote:
Originally Posted by Jakob.Sand View Post
Looks great.
Will add support for creating a HS Menu in SB Radio Device?
I haven't tried a SB Radio... the menus don't show up? Check http://board.homeseer.com/showpost.p...21&postcount=8 for some tips that may enable them.
Reply With Quote
  #13  
Old December 22nd, 2009, 08:06 PM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,678
Quote:
Originally Posted by ewassink View Post
It did also ran into the above issue though (with 2 players only 1 showing up). But I'm sure that can be solved.
I suggest updating to HSTouch server plugin 1.0.0.12 that was released today. I just tried it (no extensive tests) and all players were displayed.
Reply With Quote
  #14  
Old December 23rd, 2009, 09:53 PM
markus.bergvoll markus.bergvoll is offline
Seer Deluxe
 
Join Date: Oct 2008
Location: Norway
Posts: 305
I installed the latest beta build, and the startup error is gone

But the players are still not available to me in HST. No error messages.

I did add the settig in the ini file. In the updater i only find the HST 10.0.0.10 witch is allready installed..

My player count starts at 12 and runs to 16
Reply With Quote
  #15  
Old December 24th, 2009, 08:59 AM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,678
Quote:
Originally Posted by markus.bergvoll View Post
I installed the latest beta build, and the startup error is gone

But the players are still not available to me in HST. No error messages.

I did add the settig in the ini file. In the updater i only find the HST 10.0.0.10 witch is allready installed..

My player count starts at 12 and runs to 16
HSTouch is in Beta and to see the link I mentioned top of the page for more information and you can download it from (ftp://ftp.homeseer.com/updates/Beta/...h_1_0_0_12.msi).

I assume that when you mention that the players are not accessible in HST, you used the designer, dropped a Music overlay and when prompted for the Music source, your players are not visible. I also assume your players were connected, i.e. that you can see them in the SB plug-in status page. Can you run the attached script? It will access the Music APIs as HST does and will list the players/instances in the log file (search for 'Number of instances:' to find it) in addition will test a few additional APIs. This will help to determine if it is a SB plug-in or HST issue.
Attached Files
File Type: zip test_sb_music_api.zip (690 Bytes, 43 views)
Reply With Quote
  #16  
Old December 24th, 2009, 10:21 AM
markus.bergvoll markus.bergvoll is offline
Seer Deluxe
 
Join Date: Oct 2008
Location: Norway
Posts: 305
Sorry about the HST plugin. Installed it now.
But that didnt help either. I have 4 Squeezeboxes connected, all HW. And they work in other aspects with the plugin.

Yes to all of your questions abowe

Code:
The script file output:
24.12.2009 15:17:55  - Event - Running script in background: test_sb_music_api.vb
24.12.2009 15:17:56  - Music API - Found plugin SqueezeBox
24.12.2009 15:17:56  - Music API - Number of instances: 4
24.12.2009 15:17:56  - Music API - Instance 1 : 
24.12.2009 15:17:56  - Music API - Instance 2 : 
24.12.2009 15:17:56  - Music API - Instance 3 : 
24.12.2009 15:17:56  - Music API - Instance 4 : 
24.12.2009 15:17:56  - Music API - Plugin Music API NOT FOUND!
Reply With Quote
  #17  
Old December 24th, 2009, 11:13 AM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,678
Markus,

The 4 that are currently connected to SB Server out of the 12 or 16 players you have, which HS2 device code do they correspond to? The issue might be that I need to enhance the logic as Music player instance number 1-4 will correspond to the players at devices number 5, 10. 15 and 20 and my not match up in your case if the 4 active players have HS2 device above number 20 as they are not really available from SB server if they are not connected.
Reply With Quote
  #18  
Old December 24th, 2009, 10:44 PM
markus.bergvoll markus.bergvoll is offline
Seer Deluxe
 
Join Date: Oct 2008
Location: Norway
Posts: 305
Quote:
Originally Posted by pcp View Post
Markus,

The 4 that are currently connected to SB Server out of the 12 or 16 players you have, which HS2 device code do they correspond to? The issue might be that I need to enhance the logic as Music player instance number 1-4 will correspond to the players at devices number 5, 10. 15 and 20 and my not match up in your case if the 4 active players have HS2 device above number 20 as they are not really available from SB server if they are not connected.
The thing is that i only have five players, including the controller, . I dont know exactly how it happend, but the controller is number player number 12 (not active) the rest (the duets) is player 13 - 16 and active.

The four first device codes in use in the plugin Are ]1 - 4 (player count, songs and so on) player 12 starts on device code ]61 and player 16 ends on ]85

it would be Nice if i dont have to reset this, but if that is what it takes.. But i dont know how.

Thanks and merry christmas
Reply With Quote
  #19  
Old December 26th, 2009, 09:46 PM
markus.bergvoll markus.bergvoll is offline
Seer Deluxe
 
Join Date: Oct 2008
Location: Norway
Posts: 305
I made it work!

Deleted all squeezebox devices in HS, edited the ini and set the device id to 5 from the first player and 10 from the second and so on... restarted HS and it worked!

I will now try the HST integration with this plugin, and looks very intresting

Thanks!
Reply With Quote
  #20  
Old December 27th, 2009, 07:25 PM
markus.bergvoll markus.bergvoll is offline
Seer Deluxe
 
Join Date: Oct 2008
Location: Norway
Posts: 305
Getting to know the new HST integration now, and i think this is very nice

There are some oddities that i dont know if its is related to the plugin or the MusicAPI.

1) If i select an Artist with scandinavian characters (æøå and some other) it will not drill down, it just shows all albums i have

2) I have two screens for two of my zones. Musikk and MusikkKjokken, when i select a song on the MusikkKjokken screen, it changes the track, but then it also changes the screen to Musikk. I start playing the song by selecting it in the music selector. I have double checked my property names so it should not be a problem there.

Thanks

Also got this Error message on track changing. I got 3 of them in one second.

Quote:
28.12.2009 00:30:14 - SqueezeBox Error - An unexpected error occured in the PlayChangeNotify function/subroutine:
[System.Net.WebException: An exception occurred during a WebClient request. --->
System.IO.IOException: The process cannot access the file 'C:\Program Files\HomeSeer HS2\html\SqueezeBox\CurrentAlbum_Kjokken_1.jpg' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access,
Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) at System.Net.WebClient.DownloadFile(Uri address, String fileName)
--- End of inner exception stack trace ---
at System.Net.WebClient.DownloadFile(Uri address, String fileName) at Microsoft.VisualBasic.MyServices.Internal.WebClientCopy.Down loadFile(Uri address, String destinationFileName)
at Microsoft.VisualBasic.Devices.Network.DownloadFile(Uri address, String destinationFileName, ICredentials networkCredentials, Boolean showUI, Int32 connectionTimeout, Boolean overwrite, UICancelOption onUserCancel) at
Microsoft.VisualBasic.Devices.Network.DownloadFile(String address, String destinationFileName, String userName, String password, Boolean showUI, Int32 connectionTimeout, Boolean overwrite, UICancelOption onUserCancel) at
Microsoft.VisualBasic.Devices.Network.DownloadFile(String address, String destinationFileName, String userName, String password, Boolean showUI, Int32 connectionTimeout, Boolean overwrite) at
HSPI_SQUEEZEBOX.hspi_music_apis.get_CurrentArtworkFile(Strin g path) at HSPI_SQUEEZEBOX.hspi_music_apis.PlayChangeNotifyCallback(pla yer_status_change changeType)]

Last edited by markus.bergvoll; December 27th, 2009 at 07:36 PM. Reason: Errormessage
Reply With Quote
Reply

Bookmarks

Tags
multizoneapi, music, music player, musicapi, squeezebox

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 02:37 PM.


Copyright HomeSeer Technologies, LLC