Announcement

Collapse
No announcement yet.

hs.speak syntax question

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

  • hs.speak syntax question

    I am trying to route this hs.speak immediate script action through tasker to device Mike S6.

    I have tried this:

    Code:
    &hs.speak("The current temperature is " & hs.devicevalueex(14) & " degrees" & " and " & hs.devicestring(341) & " and the forecast is " & hs.devicestring(350) & " with a minimum temperature of " & hs.devicevalueex(352) & " degrees and a maximum temperature of " & hs.devicevalueex(351) & " degrees", "Tasker:Mike S6")
    but get this error:

    Jul-13 13:19:27 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 temperature of " & hs.devicevalueex(352) & " degrees and a maximum temperature of " & hs.devicevalueex(351) & " degrees", "Tasker:Mike S6"), init error: Class doesn't support Automation: 'hs.speak'

    If I just send it without "Tasker:Mike S6" it works but I want to be able to send it to a specific tasker device

  • #2
    You need a additional parameter

    The syntax for the speak command is text,true/false,optional speaker client name.
    So just add a "true" as the second parameter and then the speaker client name as the third parameter.

    Hope this helps.
    Last edited by jimbell; July 13th, 2016, 08:43 AM. Reason: error in text

    Comment


    • #3
      I do not have a error message any more, and I can see this in the log:

      Jul-13 15:40:50 TTS Speak: (Tasker:Mike S6):The current temperature is 18.8 degrees and Light Cloud and the forecast is Light Cloud with a minimum temperature of 12 degrees and a maximum temperature of 19 degrees


      so that looks ok but its not coming through to my device
      Attached Files

      Comment


      • #4
        I getting opposite results

        I ran a test on my system and I get the opposite result.
        The name of my tasker device(my Note 4) is "Note4-3".
        I have the "speaker client" checked.

        I send the following immediate command by manually running an event with the immediate script command.

        &hs.speak("hello from tasker")

        I get the expected result. The phone speaks the text.

        I then send the the command

        &hs.speak("hello from tasker", false, "Tasker:test4-x")

        I still hear the text on the phone which is not "test4-x".

        It appears that the third parameter is ignored, at least in my system.

        Comment


        • #5
          I have just tried again to get this to work, this is my test script:

          Sub Main(parm as object)
          hs.Speak ("this is a test",true,"Tasker:Mike S6")
          End Sub

          In the log it shows:



          TTS Speak: (Tasker:Mike S6):this is a test if you hear this please text me

          but I cannot hear anything

          Comment


          • #6
            Originally posted by mikee123 View Post
            I have just tried again to get this to work, this is my test script:

            Sub Main(parm as object)
            hs.Speak ("this is a test",true,"Tasker:Mike S6")
            End Sub

            In the log it shows:



            TTS Speak: (Tasker:Mike S6):this is a test if you hear this please text me

            but I cannot hear anything
            Hi,
            Have you enabled the device as speaker client?
            You can also try the API request.

            PHP Code:
            hs.PluginFunction("Tasker Plugin""""CustomAPI", New Object() {"Mike S6""say vibrate popup ""Hello this is a message!"}) 
            The code above code should first speak, vibrate and the popup your message. If you only want say command, remove vibrate & popup.
            PHP Code:
            hs.PluginFunction("Tasker Plugin""""CustomAPI", New Object() {"Mike S6""say""Hello this is a message!"}) 
            Please excuse any spelling and grammatical errors I may make.
            --
            Tasker Plugin / Speech Droid
            Tonlof | Sweden

            Comment


            • #7
              I have tried:

              Sub Main(parm as object)
              hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"Mike S6", "say vibrate popup ", "Hello this is a message!"})
              End Sub

              I think that must be wrong, there is no error in the log but nothing happens on Mike S6 (speaker client is enabled)

              This works, but comes out on all (enabled) clients now even though directed at Mike S6

              Sub Main(parm as object)
              hs.Speak ("this is a test",true,"Tasker:Mike S6")
              End Sub

              again, no errors I can see in the log

              Comment


              • #8
                Originally posted by mikee123 View Post
                I have tried:

                Sub Main(parm as object)
                hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"Mike S6", "say vibrate popup ", "Hello this is a message!"})
                End Sub

                I think that must be wrong, there is no error in the log but nothing happens on Mike S6 (speaker client is enabled)

                This works, but comes out on all (enabled) clients now even though directed at Mike S6

                Sub Main(parm as object)
                hs.Speak ("this is a test",true,"Tasker:Mike S6")
                End Sub

                again, no errors I can see in the log
                Hi Mike, if I don't remember wrong you need to use tasker in lowercase and change the order.
                hs.Speak ("this is a test",true,"Mike S6:tasker")
                Please excuse any spelling and grammatical errors I may make.
                --
                Tasker Plugin / Speech Droid
                Tonlof | Sweden

                Comment


                • #9
                  I am getting closer. I have found and corrected a few errors, and now sending a speech command to one of the tablets I can see the command arriving. (With the hs.speak lounge:tasker). I can see it in the notification area, and it tells me 'speech this is a test', so it has arrived but I cannot hear anything. if I do the same on my phone the Mike S6 it works. All the volume sliders for all free speech engines notification system and media are turned up so that is not the issue so it must be something else.

                  Comment


                  • #10
                    Originally posted by mikee123 View Post
                    I am getting closer. I have found and corrected a few errors, and now sending a speech command to one of the tablets I can see the command arriving. (With the hs.speak lounge:tasker). I can see it in the notification area, and it tells me 'speech this is a test', so it has arrived but I cannot hear anything. if I do the same on my phone the Mike S6 it works. All the volume sliders for all free speech engines notification system and media are turned up so that is not the issue so it must be something else.
                    Great, try to use the diffrent source of your lounge to see if there is any volume issue.
                    PHP Code:
                    hs.Speak ("this is a test",true,"<alarm>lounge:tasker")         
                    hs.Speak ("this is a test",true,"<system>lounge:tasker")
                    hs.Speak ("this is a test",true,"<media>lounge:tasker"
                    hs.Speak ("this is a test",true,"<notification>lounge:tasker")
                    hs.Speak ("this is a test",true,"<ringer>lounge:tasker"
                    You may also have diffrent versions of the tasker files?
                    Here is an updated SAY task, place SAY.tsk.xml under Tasker/task folder.
                    Delete the old SAY task in HS3 Engine / TASKS, press and hold TASKS, then select import SAY


                    https://drive.google.com/open?id=0B7...3pIa0hDekJlUnM
                    Last edited by tonlof; August 27th, 2016, 02:17 AM.
                    Please excuse any spelling and grammatical errors I may make.
                    --
                    Tasker Plugin / Speech Droid
                    Tonlof | Sweden

                    Comment


                    • #11
                      No cannot get anything to come put of the speakers. I updated everything on my tablet, imported the say into tasks (it wasnt there previously). The I run this event

                      Sub Main(parm as object)

                      hs.Speak ("this is a test alarm",true,"<alarm>Kitchen:tasker")
                      hs.Speak ("this is a test system",true,"<system>Kitchen:tasker")
                      hs.Speak ("this is a test media",true,"<media>Kitchen:tasker")
                      hs.Speak ("this is a test notification",true,"<notification>Kitchen:tasker")
                      hs.Speak ("this is a test ringer",true,"<ringer>Kitchen:tasker")

                      End Sub

                      absolutely nothing out of the speakers (all volumes set to high)

                      If I send a text to speach from the device in device manager from HS3, it works, then I can see the autoremote task arriving on my tablet.

                      Comment


                      • #12
                        Originally posted by mikee123 View Post
                        No cannot get anything to come put of the speakers. I updated everything on my tablet, imported the say into tasks (it wasnt there previously). The I run this event

                        Sub Main(parm as object)

                        hs.Speak ("this is a test alarm",true,"<alarm>Kitchen:tasker")
                        hs.Speak ("this is a test system",true,"<system>Kitchen:tasker")
                        hs.Speak ("this is a test media",true,"<media>Kitchen:tasker")
                        hs.Speak ("this is a test notification",true,"<notification>Kitchen:tasker")
                        hs.Speak ("this is a test ringer",true,"<ringer>Kitchen:tasker")

                        End Sub

                        absolutely nothing out of the speakers (all volumes set to high)

                        If I send a text to speach from the device in device manager from HS3, it works, then I can see the autoremote task arriving on my tablet.
                        Strange, did you exit tasker after importing so it reload the files?
                        So "Mike S6" is working as it should but not "Kithen" and "lounge"?
                        Could you export the log from tasker.
                        Please excuse any spelling and grammatical errors I may make.
                        --
                        Tasker Plugin / Speech Droid
                        Tonlof | Sweden

                        Comment


                        • #13
                          You will not believe it. Sending this to my tablet:

                          Sub Main(parm as object)

                          hs.Speak ("this is a test alarm",true,"<alarm>Kitchen:tasker")
                          hs.Speak ("this is a test system",true,"<system>Kitchen:tasker")
                          hs.Speak ("this is a test media",true,"<media>Kitchen:tasker")
                          hs.Speak ("this is a test notification",true,"<notification>Kitchen:tasker")
                          hs.Speak ("this is a test ringer",true,"<ringer>Kitchen:tasker")

                          End Sub

                          No sound. It drove me crazy. I re setup my HS3 settings on tasker. Same result. So I tried this:

                          hs.Speak ("this is a test alarm",true,"Kitchen:tasker")

                          and guess what. Its working. But still if I have any attempt to route it to a specific stream, no sound. Doesnt make sense. But, I can route my TTS now to the right tablet, which is what I wanted.
                          Thanks for your help and patience.

                          Comment


                          • #14
                            Originally posted by mikee123 View Post
                            You will not believe it. Sending this to my tablet:

                            Sub Main(parm as object)

                            hs.Speak ("this is a test alarm",true,"<alarm>Kitchen:tasker")
                            hs.Speak ("this is a test system",true,"<system>Kitchen:tasker")
                            hs.Speak ("this is a test media",true,"<media>Kitchen:tasker")
                            hs.Speak ("this is a test notification",true,"<notification>Kitchen:tasker")
                            hs.Speak ("this is a test ringer",true,"<ringer>Kitchen:tasker")

                            End Sub

                            No sound. It drove me crazy. I re setup my HS3 settings on tasker. Same result. So I tried this:

                            hs.Speak ("this is a test alarm",true,"Kitchen:tasker")

                            and guess what. Its working. But still if I have any attempt to route it to a specific stream, no sound. Doesnt make sense. But, I can route my TTS now to the right tablet, which is what I wanted.
                            Thanks for your help and patience.
                            Ok great that you get the most working, what HS3 plugin version are you running?
                            Please excuse any spelling and grammatical errors I may make.
                            --
                            Tasker Plugin / Speech Droid
                            Tonlof | Sweden

                            Comment


                            • #15
                              I have got one more problem to solve. I am sending this to my tablet (this is part of a script)

                              Code:
                              If BedWindowR = 255 OR BedWindowL = 255 Then 
                                                hs.Speak("please close the bedroom windows ",true,"Lounge:tasker")
                                                hs.Speak(" the Bedroom temperature is " & Temperature & " Degrees",true,"Lounge:tasker")
                                                hs.Speak(" and outside temperature is " & Tempoutside & " Degrees",true,"Lounge:tasker")
                                                End If
                              It is working, but I sometimes have delays between the hs.speak commands
                              I think I can see the reason in the logs, its probably the Tasker plugin error:

                              Aug-27 17:36:06 Tasker Plugin Error
                              Aug-27 17:36:06 Tasker Plugin Error Connection Error
                              Aug-27 17:36:06 Tasker Plugin Error
                              Aug-27 17:36:06 Tasker Plugin Error Sending local command failed: (192.168.0.17)
                              Aug-27 17:36:04 TTS Speak: (Lounge:tasker):and outside temperature is 25.6 Degrees
                              Aug-27 17:36:04 Tasker Plugin Error
                              Aug-27 17:36:04 Tasker Plugin Error Connection Error
                              Aug-27 17:36:04 Tasker Plugin Error
                              Aug-27 17:36:04 Tasker Plugin Error Sending local command failed: (192.168.0.17)
                              Aug-27 17:36:03 TTS Speak: (Lounge:tasker):the Bedroom temperature is 24.7 Degrees
                              Aug-27 17:36:02 TTS Speak: (Lounge:tasker)lease close the bedroom windows
                              Aug-27 17:36:02 Event Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/bedroom window.vb
                              Aug-27 17:36:02 Event Event Trigger "Notifications AC logic open bedroom window"

                              so I am trying to get to the bottom of this error

                              In my HS3 tasker plugin, I have ticked the lounge tablet as speaker client, and have also added the IP for this tablet 192.168.0.17 which is static

                              Comment

                              Working...
                              X