Announcement

Collapse
No announcement yet.

Can I repeat TTS announcements on demand ?

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

  • #46
    This works with tasker TTS as well, not directly but I just added another action to speak the same and send it to the PHONY speaker client.


    One thing I havent got working yet, I have an event to execute a immediate command


    &hs.speak("The current temperature is " & hs.devicevalueex(14) & " degrees" & " and " & hs.devicestring(341) & " and the forecast is " & hs.devicestring(350) & " with a minimum of " & hs.devicevalueex(352) & " degrees and a maximum of " & hs.devicevalueex(351) & " degrees", FALSE, "$SONOS$KitchenTTS$",PHONY)


    This throws an error, it doesnt like the ,PHONY at the end

    Comment


    • #47
      Originally posted by mikee123 View Post
      This works with tasker TTS as well, not directly but I just added another action to speak the same and send it to the PHONY speaker client.


      One thing I havent got working yet, I have an event to execute a immediate command


      &hs.speak("The current temperature is " & hs.devicevalueex(14) & " degrees" & " and " & hs.devicestring(341) & " and the forecast is " & hs.devicestring(350) & " with a minimum of " & hs.devicevalueex(352) & " degrees and a maximum of " & hs.devicevalueex(351) & " degrees", FALSE, "$SONOS$KitchenTTS$",PHONY)


      This throws an error, it doesnt like the ,PHONY at the end
      Try to put PHONY and comma within same double quotes as you have the Sonos stuff

      Comment


      • #48
        &hs.speak("The current temperature is " & hs.devicevalueex(14) & " degrees" & " and " & hs.devicestring(341) & " and the forecast is " & hs.devicestring(350) & " with a minimum of " & hs.devicevalueex(352) & " degrees and a maximum of " & hs.devicevalueex(351) & " degrees", FALSE, "$SONOS$KitchenTTS$","PHONY")


        produces the same error


        Jul-24 20:31:46 Error Running script(2) &hs.speak("The current temperature is " & hs.devicevalueex(14) & " degrees" & " and " & hs.devicestring(341) & " and the forecast is " & hs.devicestring(350) & " with a minimum of " & hs.devicevalueex(352) & " degrees and a maximum of " & hs.devicevalueex(351) & " degrees", FALSE, "$SONOS$KitchenTTS$","PHONY"), init error: Wrong number of arguments or invalid property assignment: 'hs.speak'

        Maybe I cannot specify 2 speaker clients in that command ?

        I found it. It has to be

        &hs.speak("The current temperature is " & hs.devicevalueex(14) & " degrees" & " and " & hs.devicestring(341) & " and the forecast is " & hs.devicestring(350) & " with a minimum of " & hs.devicevalueex(352) & " degrees and a maximum of " & hs.devicevalueex(351) & " degrees", FALSE, "$SONOS$KitchenTTS$,PHONY")

        That seems to work

        Comment


        • #49
          Originally posted by mikee123 View Post
          &hs.speak("The current temperature is " & hs.devicevalueex(14) & " degrees" & " and " & hs.devicestring(341) & " and the forecast is " & hs.devicestring(350) & " with a minimum of " & hs.devicevalueex(352) & " degrees and a maximum of " & hs.devicevalueex(351) & " degrees", FALSE, "$SONOS$KitchenTTS$","PHONY")


          produces the same error


          Jul-24 20:31:46 Error Running script(2) &hs.speak("The current temperature is " & hs.devicevalueex(14) & " degrees" & " and " & hs.devicestring(341) & " and the forecast is " & hs.devicestring(350) & " with a minimum of " & hs.devicevalueex(352) & " degrees and a maximum of " & hs.devicevalueex(351) & " degrees", FALSE, "$SONOS$KitchenTTS$","PHONY"), init error: Wrong number of arguments or invalid property assignment: 'hs.speak'

          Maybe I cannot specify 2 speaker clients in that command ?

          This way:
          "$SONOS$KitchenTTS$,PHONY")

          Comment


          • #50
            Hm. Another strange one. In a script, hs.speak

            These all work as intended:

            hs.Speak("please open the bedroom windows ",true,"Lounge:tasker")
            hs.Speak("please open the bedroom windows ",true,"PHONY")
            hs.speak("Test", FALSE, "$SONOS$KitchenTTS$,PHONY")

            This doesnt... weird

            hs.speak("Test", FALSE, "Lounge:tasker,PHONY")

            Comment


            • #51
              Originally posted by mikee123 View Post
              Hm. Another strange one. In a script, hs.speak

              These all work as intended:

              hs.Speak("please open the bedroom windows ",true,"Lounge:tasker")
              hs.Speak("please open the bedroom windows ",true,"PHONY")
              hs.speak("Test", FALSE, "$SONOS$KitchenTTS$,PHONY")

              This doesnt... weird

              hs.speak("Test", FALSE, "Lounge:tasker,PHONY")
              Having multiple speaker clients in one speak action is something I think came later, or I may have missed its existence when HS3 came out. That means that whomever developed proxies or clients may have been in the same boat as I was, that I had to develop support for it, years after HS3 debuted. In this case, tasker may not have support for it at all. You can always double up on actions ie.

              if this doesn't work
              hs.speak("Test", FALSE, "Lounge:tasker,PHONY")
              this does the same
              hs.Speak("please open the bedroom windows ",true,"Lounge:tasker")
              hs.Speak("please open the bedroom windows ",true,"PHONY")

              Just a bit more work....

              Dirk

              Comment


              • #52
                Originally posted by dcorsus View Post
                Having multiple speaker clients in one speak action is something I think came later, or I may have missed its existence when HS3 came out. That means that whomever developed proxies or clients may have been in the same boat as I was, that I had to develop support for it, years after HS3 debuted. In this case, tasker may not have support for it at all. You can always double up on actions ie.

                if this doesn't work
                hs.speak("Test", FALSE, "Lounge:tasker,PHONY")
                this does the same
                hs.Speak("please open the bedroom windows ",true,"Lounge:tasker")
                hs.Speak("please open the bedroom windows ",true,"PHONY")

                Just a bit more work....

                Dirk
                Yes thats what I've done. As you said, just a bit more work but it does the job. But I'm glad its all working well. Thanks to everyone for the help.

                Comment


                • #53
                  Originally posted by mikee123 View Post
                  Yes thats what I've done. As you said, just a bit more work but it does the job. But I'm glad its all working well. Thanks to everyone for the help.
                  So I assume you have repeat announcements working OK now?

                  Are you repeating announcements to 'all' clients or targeting specific clients such as Sonos etc?
                  Jon

                  Comment


                  • #54
                    Yes its all working fine. I added the PHONY client to my Sonos announcement groups, also added an extra action on my tasker announcements which sends the same announcement to PHONY. In my scripts, as per earlier post, if hs.speak sends to a Sonos group, I jus added ,PHONY. Sending hs.speak to a tasker group, I had to add another line of code with the same hs.speak action just sending to PHONY.
                    The PI has created devices for my Sonos clients (after adding them manually to the .ini, but they show speech which had not been sent there. So there is some sort of problem, but I did not have time to investigate and test a bit more. But I am only using the all devices, and they seem to show all TTS. I have also created a event, to repeat the last TTS (which uses the last TTS in all). Now I can say Alexa, repeat, and it will use Sonos to repeat the last TTS. Fantastic.

                    .
                    Attached Files

                    Comment

                    Working...
                    X