Announcement

Collapse
No announcement yet.

New User Question

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

    New User Question

    Hi- I just downloaded a trial of Homeseer and your plug-in last night and am in the process of testing out announcements with embedded variables. I do not know any scripting but I used examples from the message board to create a test script (below). Initially I was able to load a variable called "say" with the value from a variable device using either of two statements. I was then able to construct a sentance using 3 seperate hs.speak statements to to speak the sentance in 3 parts (text, variable, text). This all worked fine. The final step was to use your plug-in to embed the variable into a single hs.speak statement following the examples in your docs. I tried each of the three statements commented out below but none of them worked so I still must be missing something. Can you point me in the right direction?

    Thanks,

    sub main()
    Dim Say ' Text to speak


    'say=hs.DeviceValueByName("JDS Pump")
    say=hs.DeviceValue("[20")


    hs.speak "the pump has operated"
    hs.speak say
    hs.speak "times so far today"

    'hs.speak "the pump has operated $"[20" times today"
    'hs.speak "the pump has operated $"JDS Pump" times today"
    'hs.speak "the pump has operated $"say" times today"


    end sub

    #2
    I'm not in front of my HS PC right now, but try:

    hs.speak "the pump has operated " & say & "times today"

    Let us know...
    HS4Pro on a Raspberry Pi4
    54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
    Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

    HSTouch Clients: 1 Android

    Comment


      #3
      Rob-

      Definitely a step in the right direction! It works with the say variable except for the fact that it wants to spell out the word operated instead of say it!? I still can't use the variable device directly as in $[20 or $JDS Pump. At least your suggestion got everything into a single hs.speak statement!

      Thanks,

      -Mike

      Comment


        #4
        <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Mike Maliga:
        Rob-

        Definitely a step in the right direction! It works with the say variable except for the fact that it wants to spell out the word operated instead of say it!? I still can't use the variable device directly as in $[20 or $JDS Pump. At least your suggestion got everything into a single hs.speak statement!

        Thanks,

        -Mike <HR></BLOCKQUOTE>


        Make sure there is a space at the end of 'operated' and before 'times'

        My code I posted above is wrong! Sorry about that!
        HS4Pro on a Raspberry Pi4
        54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
        Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

        HSTouch Clients: 1 Android

        Comment


          #5
          And make sure that the word 'say' does NOT have any quotes around it. g

          Comment


            #6
            And you almost got the dynamic substitution correct.
            Instead of: <pre class="ip-ubbcode-code-pre">hs.speak "the pump has operated $"[20" times today" </pre>
            Try: <pre class="ip-ubbcode-code-pre">hs.speak "the pump has operated $[20 times today" </pre>
            Notice the missing ""'s. Page 5 of the documentation, 2nd example.

            George

            Comment


              #7
              Thanks Rob, I did it try with and without spacing.

              George- I tried the dynamic substitution using hs.speak "The pump has operated $[20 times today" but it just says the words and skips the variable as if it isn't even there.

              -Mike

              Comment


                #8
                Rob-

                Just did another test changing the spaces and this time it worked. I must not have put them in the right places on my first test. Now how do I insert a shrt pause after the variable so the sentance sounds more natural? (It kind of runs together now)

                -Mike

                Comment


                  #9
                  Mike,

                  I see it in the code.. The $ substitution variables take whatever is in the device string and you are using device values. Sorry.

                  So make it see more natural insert a comma. Something like:

                  hs.speak "the pump has operated "&say&", times today"

                  Comment


                    #10
                    Georg-
                    Not sure I understand the device string vs device value thing but the variables are loaded from the JDS plug-in so I don't think it is something I can control. I guess dynamic substitution is not an option for these variables. Using the other method, I tried your comma example and got the sentance to sound good. Next question: from within the script, how do I switch to a different voice? My default is ATT Audry but what if I want the pump status announcements to be spoken by Mike or Crystal?

                    Comment


                      #11
                      Glad you got it working, Mike...

                      You pose an interesting question on how to switch voices - I'll be watching for a reply from some of the experts - I would be interested in this as well.
                      HS4Pro on a Raspberry Pi4
                      54 Z-Wave Nodes / 21 Zigbee Devices / 108 Events / 767 Devices
                      Plugins: Z-Wave / Zigbee Plus / EasyTrigger / AK Weather / OMNI

                      HSTouch Clients: 1 Android

                      Comment


                        #12
                        Switching voices is not implemented yet but it is coming. I just have to work a little with Rick and/or Rich on the proper SAPI calls to cause the voice to switch. They've been busy lately as have I and I did not want to bother them unless I was behind a keyboard and ready to code and test.

                        G

                        Comment


                          #13
                          Mike,

                          I'll take a look and see if I can add something that handles device values as well. G

                          Comment

                          Working...
                          X