Announcement

Collapse
No announcement yet.

Integrate SpeakEasy with J.River Media Center?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Integrate SpeakEasy with J.River Media Center?

    Hi George,

    I use J. River Media Center and MainLobby for whole house music, what would be nice is if I can mute the music when HS speaks. I just found out I can execute the following HS command:

    hs.plugin("MLHSPlugin").MLServeCMD "MLServeCmd.MLMediaCenter|PAUSE"

    And what I'd like to do is for every hs.speak command, issue the above command to pause background music over whole house speakers. Then when hs.speak finishes, it'll un-mute the music by sending the same command:

    hs.plugin("MLHSPlugin").MLServeCMD "MLServeCmd.MLMediaCenter|PAUSE"

    Can I do it with this SpeakEasy plugin?

    Thanks,
    Simon

    #2
    You will be able to. I have that on my list of things to do.

    At the moment you can do it in the SpeakEasyExit script but that exit is called when the phrase is received by the plugin. If queuing is not turned on then that should work for you because the plugin will call the TTS engine. But if it's queued then that doesn't do what you want. There is also no way to know when it's finished speaking unless you go into a loop and use the se.IsSpeaking property to determine if it's done.

    I'm going to add a device (probably the unused 10) that will track the status of the TTS engine. That way you can simply have a 'status change' event on that device that will fire when it goes on or off. While I'm at it I'll probably also add a SpeakEasy trigger for some of the TTS functions.

    The problem is that SE sees the TTS engine process for each state change. For example if you had 3 hs.speak commands one after the other, you wouldn't want to mute, unmute, mute, unmute etc after each hs.speak. That would really drive someone nuts. To do it right, I'll probably add a configurable (maybe) option to delay the 'OFF" status and triggers until X seconds after the last hs.speak has finished. That way you could have HS read you the weather report using multiple hs.speaks and the plugin will wait for things to quiesce before it signals all clear.

    Sound good to you?

    P.S. I'm in the middle of the code right now adding support for the ELK panel and finishing the HS2 support so adding this probably won't take too long.

    Comment


      #3
      Heck,

      I had some free time this morning... Added it!

      Now Device 10 is called "TTS Engine Status"

      The Device will go ON and OFF as speaking is started and stopped ( I put in a 6 second failsafe in case you don't have IDLE Switching time set)
      The Device string will change from TTS Idle to TTS Active and back again.

      2 new SpeakEasy Triggers added:

      "HomeSeer TTS is speaking"
      "HomeSeer TTS has finished speaking"

      So you can either do a device status change trigger to monitor the SE TTS Engine Status device or you can set a SpeakEasy trigger directly to trigger events or scripts when the TTS engine starts and stops.

      Anything you think I missed?

      Comment


        #4
        Hey George,

        I'm going to download the plugin and give it a try later on tonight or tomorrow. You're so cool

        Maybe a dump question, I'm on HS 1.7, SpeakEasy will work okay right?

        Thank you very much,

        Simon

        Comment


          #5
          Yup, it will work on 1.7 just fine.

          I haven't uploaded the new version to the updater yet.. Still working on the ELK support. If you PM me your email address I can send you the test build.

          Comment


            #6
            Thank you George, I got the plugin installed and replaced with the ocx you sent me. Now how do I started? So far I have added [Beep 1] to a few of hs.speak and it works great. This is one feature I was hoping to have, now I do

            I'm trying to go through the PDF manual but I don't seem to get a few things! All I wanted to do at the moment, is to send this command:

            hs.plugin("MLHSPlugin").MLServeCMD "MLServeCmd.MLMediaCenter|PAUSE"
            before HS speaks anything. How do I integrate this into the hs.speak as well as through the Events GUI?

            Much appreciate your help, Goerge.

            Simon

            Comment


              #7
              Ok, with the test plugin I sent you, you can define an event that is triggered by either a device status change on the SE TTS Engine Status device (10) ON/OFF or an event triggered by the new SpeakEasy triggers of 'HS has started speaking' and "HS has finished speaking' (I may have the words not quite right but it's in the trigger dropdown list on the events web gui.

              Then, once you have a event that is triggered by HS starting to speak or HS finishing speaking you can then put the MLHSPLUGIN command using an immediate function in the action section: Something like &hs.plugin("MLHS.........

              So, when HS starts to speak the event will fire and in the actions just define an immediate script line using the & prefix. Or, you can just put the command in a script and run the script from the event.

              Also, in this version I'm moving from using the word Beep (it's still valid) to also allow the use of the keyword (Chime) for the prefix chimes. So you can also use [Chime 1] instead of Beep 1. I just thought that Chime sounded better and better describes what it actually is.

              Take a look at creating an event and specify a SpeakEasy trigger... that should do it for you.

              Still haven't quite gotten around to updating the manual with all the new features that will be in SE 2.0. Lots of stuff to add.
              G

              Comment


                #8
                George,

                Got it set up, now I just need to find a way to let HS knows if Media Center is playing music or not. Otherwise, the event will resume playback even though the music is not supposingly playing.

                However, I'm able to pause the music and resume after speaking. I'll try to play around with multiple speech to see how it behaves. I really like the ability to play a chime before speaking.

                I'll register the plugin in next few days, well done plugin and definitely good support.

                Simon

                Comment


                  #9
                  George,

                  Good to hear of the modification. I'll PM you as I'd like to try the new version too.

                  htsource,

                  I also use J. River for my music. I use a virtual device to track if the player is playing or stopped and then check this device before issuing commands. For example, assuming device q53 is the device used for tracking player status, I use the following command.

                  hs.IsOn("q53") then hs.plugin("MLHSPlugin").MLServeCMD "MLServeCmd.MLMediaCenter|PAUSE"

                  This way, I don't issue the PAUSE command when stopped which will actually start the player.
                  Regards, Bob

                  Comment


                    #10
                    itanic,

                    This is good to know, however, how do you update the device when J River is playing vs. stopped?

                    Thanks,
                    Simon

                    Comment


                      #11
                      I use hs scripts to turn on the device and issue the play commands and also use scripts to turn off the player and the device.
                      Regards, Bob

                      Comment


                        #12
                        Got it, so instead of polling the data, you control through a device. Is it possible to control which zone through script?

                        That's good to know, thanks.

                        Simon

                        Comment

                        Working...
                        X