Announcement

Collapse
No announcement yet.

New SqueezeBox Plug-in

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    New SqueezeBox Plug-in

    The SqueezeBox plug-in integrates SqueezeBox players with HomeSeer. The plug-in communicates with the players through the SqueezeCenter software to control players, display notification messages, update screensavers or receive requests from players. This plug-in also creates HomeSeer devices for each SqueezeBox player.

    Features

    HomeSeer HS2 features
    • The Plug-in creates devices for each player to display the status, volume, song being played and latest pressed button for each player. Also the status page include buttons to control each player: turn on, turn off, volume+/-, mute, play, stop, pause, etc
    • Predefined event actions are available to turn a player on, off, change the volume, play the latest song, stop playing songs or send messages to specific player or broadcast message to all players. Messages sent to players may contain replacement variables referring to HomeSeer devices to include information from specific devices in displayed messages.
    • HomeSeer IR support, i.e. the player can send IR signals to HS2 which can trigger events. Any IR remote that the squeezebox can detect should work, not just the player remote control. If you install the SqueezeCenter IR Blaster, HS2 can also send IR signals.
    • Scripting APIs for custom logic


    SqueezeBox player features

    #2
    Very cool... how do we get it? Are you going to post more screen shots? Have you tried creating an event that pauses certain players when the phone line goes off hook?

    Looking forward to trying this out!

    Comment


      #3
      SqueezeBox plugin 1.5 beta

      I started to incrementally develop this SqueezeBox plug-in many months ago. I recently extended it to support IR and scripting. Attached is the beta version 1.5 for your enjoyment. I hope to make it available via the HS2 updater but for now installation is via the included zip files. The attached document (Word format) includes installation instructions.
      Attached Files

      Comment


        #4
        You were fast! It took me a bit longer to post the second dialog... the uploader did not like my PDF documentation with multiple screenshots since it exceeded the size limit.

        Comment


          #5
          Originally posted by upstatemike View Post
          Very cool... how do we get it? Are you going to post more screen shots? Have you tried creating an event that pauses certain players when the phone line goes off hook?

          Looking forward to trying this out!
          The players will display caller id information. I don't recall that I tried pausing them, though the actions are included so you ca ntry it out. Let us know.

          Comment


            #6
            Just tried this, wow, this will be fantastically useful. I'd started to experiment with sending xAP messages to Squeezecenter, but your plugin will make interfacing much easier. Thank you for releasing the plugin.

            Couple of questions though.

            1. I am periodically getting HomeSeer a crash with the following error. I think it happens when pressing "Connect" on the Squeezebox "Status" Device (not the play status devices)

            2. Probably related to question 1 - the player count and total albums and songs devices are "unknown"

            I am running HS 2.3.0.0 and squeezecenter 7.2.1

            cheers,

            Al

            08/12/2008 22:57
            Cannot access a disposed object.
            Object name: 'System.Net.Sockets.Socket'.
            HomeSeer version: 2.3.0.0
            Source: System
            Target: Int32 EndSend(System.IAsyncResult, System.Net.Sockets.SocketError ByRef)
            Stack trace:
            at System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult, SocketError& errorCode)
            at System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult)
            at HSPI_SQUEEZEBOX.hs_socket_io.sockSendEnd(IAsyncResult ar)
            at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
            at System.Net.ContextAwareResult.CompleteCallback(Object state)
            at System.Threading.ExecutionContext.runTryCode(Object userData)
            at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWi thGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
            at System.Threading.ExecutionContext.RunInternal(ExecutionConte xt executionContext, ContextCallback callback, Object state)
            at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
            at System.Net.ContextAwareResult.Complete(IntPtr userToken)
            at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
            at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortC allback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
            at System.Threading._IOCompletionCallback.PerformIOCompletionCa llback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

            Please specify what you were doing at the time of this error:

            Comment


              #7
              apluck, Ihave a couple of questions...

              1) are HS2 and Squeezecenter running on the same computer? Are you using XP Pro or another version? I assume you don't have any firewall issues.

              2) When you go to the status page do you initially see a green check mark to indicate if it is connected?

              3) if you got to the status page of the plugin, does it list the players?

              If it still fails, go to the configuration page of the plugin enable debug and verbose debugging (check them) and unckeck the "Use HomeSeer Log" so that it creates a separate log. Connect and email me the log file (hspi_squeezebox_debug.log located in the HomeSeer 2 directory).

              Comment


                #8
                I was able to reproduce similar errors if very rapidly click on the connect button (though did not get the same stack trace). I will look into it. Does the plug-in work and you run into this once a while or is at initial startup?
                Last edited by pcp; December 8, 2008, 09:03 PM.

                Comment


                  #9
                  1. HS is on a 2003 server VM under vmware server, Squeezecenter is running on the Vista 32 bit host. I may move Squeezecenter to the HS VM to solve another issue.

                  2. See attached screenshot

                  3. Yes. i can control the players via the devices. But after a few minutes, HS crashes. I haven't narrowed it down further yet - will experiment more tonight.

                  thanks,

                  Al
                  Attached Files

                  Comment


                    #10
                    Originally posted by apluck View Post
                    1. HS is on a 2003 server VM under vmware server, Squeezecenter is running on the Vista 32 bit host. I may move Squeezecenter to the HS VM to solve another issue.

                    2. See attached screenshot

                    3. Yes. i can control the players via the devices. But after a few minutes, HS crashes. I haven't narrowed it down further yet - will experiment more tonight.

                    thanks,

                    Al
                    Note that the first four devices ('1 to 4) with general information (status, total album, total songs and player count) are using a different house code than the ones for the layer; they should be the same. Can you try deleting them and restart the HS2?

                    Also please try the attached build. It catches one more exception; If you do a lot of disconnect/reconnects, the plug-in will add information about them as warnings to the log file. If you get a chance, enable debugging/verbose debugging and send me the log file.

                    I have not tried Windows 2003 and especially WMWare. If you want to only check network connectivity, you can use a DOS prompt, telnet from your HS2 server to SqueezeCenter at port 9090 (i.e. telnet host 9090) and enter the "listen 1" command; it will output any communication to the shell. If the communication aborts, it indicates a network communication problem.
                    Attached Files

                    Comment


                      #11
                      All works now! Deleting all the Squeezebox devices and restarted sorted it out.

                      This will be really useful, as I want to use the Squeezeboxes to display various messages. Thank you for releasing!

                      Do you have any plans to add a "Play Playlist" or "Play Song" Action?

                      Comment


                        #12
                        Basic question,

                        how do I create a script to use the BroadcastMessage sub as part of an event?

                        I have tried
                        Sub Main
                        BroadcastMessage "Central Heating", "Set On"
                        End Sub

                        I have also tried

                        Sub Main
                        call BroadcastMessage("Central Heating", "Set On")
                        End Sub

                        I have also tried

                        Sub Main
                        set xyz=hs.plugin("Squeezebox")
                        xyz.BroadcastMessage "Central Heating", "Set On"
                        End Sub

                        thanks

                        Comment


                          #13
                          Below is a simple vb.net example

                          1) Save the following vb.net code in the script directory. For example squeezebox_example.vb (.vb extension is important)

                          PHP Code:
                          Sub Main(ByVal parm As Object)

                              
                          Dim hspi As Object hs.plugin("SqueezeBox")

                              If 
                          hspi Is Nothing Then
                                  hs
                          .WriteLog("My Script""Plugin not found!")
                              Else
                                  
                          hs.WriteLog("My Script""Found plugin " hspi.Name())
                                  
                          hspi.BroadcastMessage("Central Heating""Set On")
                              
                          End If
                          End Sub 
                          2) Create an event to run this script (manual for testing for example)
                          3) Trigger the event (Run button on event page for example)

                          Comment


                            #14
                            Note that if the only thing you want to do in your event is to display messages (i.e. you do not a script for other logic), you can use the "Send Message to SqueezeBox" action (in the Add Actions list). If you select "All Payers" instead of a specific one it will broadcast it to all instead of sending it to a specific one. Attached is a screen capture which shows both method: calling the script from previous dialog and using the built-in action.
                            Attached Files

                            Comment


                              #15
                              Originally posted by apluck View Post
                              All works now! Deleting all the Squeezebox devices and restarted sorted it out.

                              This will be really useful, as I want to use the Squeezeboxes to display various messages. Thank you for releasing!

                              Do you have any plans to add a "Play Playlist" or "Play Song" Action?
                              Sounds like reasonable extensions. I was thinking a while back to start with "Play Playlist" and ideally download the playlist to make selection and validation easier in the UI (Event Actions for example). But haven't coded anything yet. Would this be good enough?

                              Comment

                              Working...
                              X