• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
TRIGGERcmd
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Smart reply for voice with parameters

General Discussion
5
13
2.8k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    MysticNynja
    last edited by Dec 13, 2018, 8:14 PM

    Just was wondering if there is a way to have a voice reply for different parameters sent in.

    Let's say I have a batch that can accept on, off, or no parameter. It would be cool to have the reply say something different for each one of these situations.

    "Ok Google, Ask TriggerCMD to run Plex with parameter on"
    Voice Reply: Turned on the plex server

    "Ok Google, Ask TriggerCMD to run Plex with parameter off"
    Voice Reply: Turned off the plex server

    Plex.bat

    if "%1"=="on" "Plex Media Server.exe"
    if "%1"=="" "Plex Media Server.exe"
    if "%1"=="off" taskkill /IM "Plex Media Server.exe"

    Now I can just have two different triggers and call the correct one for on/off control but I also have smartthings and have them hooked up there. The Device Handler for that is defaulted to a switch with on/off states. If I have two Virtual Switches on Smartthings I think that could get very confusing. I think I can modify the DTH to be a button or something, but I like the idea of a state being reported to my screens.

    Anyway short of it is is there or can we have a way to have a more intelligent reply based on what parameter is passed in.

    Thanks!!! Having a blast with this, can't wait to subscribe so I can really have fun with it ๐Ÿ™‚ Just have to wait until after christmas, every dollar counts!

    R 1 Reply Last reply Dec 14, 2018, 4:42 AM Reply Quote 0
    • R
      Russ @MysticNynja
      last edited by Dec 14, 2018, 4:42 AM

      @mysticnynja, that's a good idea, and I don't think it would be too difficult. I'd have to let you put a placeholder like {{param}} in the voice reply field. I'll add this to my todo list.

      Russell VanderMey

      C 1 Reply Last reply Dec 23, 2018, 8:30 PM Reply Quote 0
      • C
        colegl @Russ
        last edited by Dec 23, 2018, 8:30 PM

        @russ
        Did this ever get implemented? It would be useful to me.

        R 1 Reply Last reply Dec 24, 2018, 12:33 AM Reply Quote 0
        • R
          Russ @colegl
          last edited by Russ Oct 16, 2020, 8:34 PM Dec 24, 2018, 12:33 AM

          @colegl, thanks for the reminder. I did it just now, and it's awesome!

          @mysticnynja, thanks for the suggestion.

          Now you can use these placeholders in your Voice Reply field:

          • {{trigger}}
          • {{computer}}
          • {{params}}
          • {{result}}

          Voice Reply Placeholders

          Russell VanderMey

          1 Reply Last reply Reply Quote 1
          • M
            MysticNynja
            last edited by Jan 9, 2019, 9:13 PM

            I just saw this!! Awesome I'll try it out today and let you know!

            1 Reply Last reply Reply Quote 0
            • S
              Sim Wonkdonk
              last edited by Feb 22, 2019, 10:41 PM

              Can I ask a follow up question?

              I'd like to have editable voice response too, and I'm running triggercmd on pi, I assume it would be a case of updating the installation and editing the json file (I have no ui on my pi).

              I'd actually like to be able to disable any feedback at all, currently it says "Getting triggercmd" and then "blah blah blah on pi"

              R 1 Reply Last reply Feb 23, 2019, 12:19 AM Reply Quote 0
              • R
                Russ @Sim Wonkdonk
                last edited by Feb 23, 2019, 12:19 AM

                @sim-wonkdonk, you could minimize the response by putting a space in that voice reply field.

                Russell VanderMey

                1 Reply Last reply Reply Quote 0
                • S
                  Sim Wonkdonk
                  last edited by Mar 9, 2019, 8:31 AM

                  I'm using a raspberry pi, so I have to edit the commands via the commands.json

                  {"trigger":"STANDBY","command":"/opt/TIVO/ircode-script.sh STANDBY","ground":"background","voice":"STANDBY","allowParams": "false"},

                  Putting a space in the "voice" parameter stops the command work, as thats the trigger word for the command, not the response the command gives.

                  I guess there's no work around?

                  R 1 Reply Last reply Mar 9, 2019, 2:18 PM Reply Quote 0
                  • R
                    Russ @Sim Wonkdonk
                    last edited by Mar 9, 2019, 2:18 PM

                    @sim-wonkdonk, the voice field is different from the voiceReply field. Your example is missing the voiceReply field.

                    Here's an example with that field:

                     {
                      "trigger": "test command",
                      "command": "d: & cd \\appdev\\test & node t.js",
                      "ground": "background",
                      "voice": "test",
                      "voiceReply": " ",
                      "allowParams": "false"
                     }
                    

                    Russell VanderMey

                    P 1 Reply Last reply Apr 18, 2019, 12:57 AM Reply Quote 0
                    • P
                      Phil Tanguay @Russ
                      last edited by Apr 18, 2019, 12:57 AM

                      @russ related to this - is it possible to include the script output in the voice reply ? For example - current lab temperature is {{result}} celcius.

                      Just started using triggercmd and itโ€™s fantastic - great service mate, weโ€™ll worth the $ !

                      R 1 Reply Last reply Apr 18, 2019, 11:23 PM Reply Quote 0
                      • R
                        Russ @Phil Tanguay
                        last edited by Apr 18, 2019, 11:23 PM

                        @phil-tanguay, I do plan on implementing that ability soon, now that I've added the SendResult script to the .TRIGGERcmdData folder to send a result of a command back to the server.

                        Currently the result just gets logged in the Runs log for the command.

                        It's on my todo list.

                        Russell VanderMey

                        P 1 Reply Last reply Apr 19, 2019, 12:18 AM Reply Quote 0
                        • P
                          Phil Tanguay @Russ
                          last edited by Apr 19, 2019, 12:18 AM

                          @russ Awesome ! Looking forward to it but no rush ๐Ÿ™‚

                          My brain is bubbling with ideas - triggercmd has opened a whole new avenue for cool automations.

                          R 1 Reply Last reply May 18, 2019, 1:55 PM Reply Quote 0
                          • R
                            Russ @Phil Tanguay
                            last edited by Russ May 18, 2019, 6:03 PM May 18, 2019, 1:55 PM

                            @colegl and @phil-tanguay, I implemented this today for Google Assistant. I'm working on Alexa now.

                            I put this in my Voice Reply field of my Notepad command (I should have just created a new command):

                            Running {{trigger}} on {{computer}} with params {{params}} with result {{result}}
                            

                            I put this in the Command field:

                            %USERPROFILE%\.TRIGGERcmdData\sendresult "My command result"
                            

                            I said this:

                            Ask trigger command to run notepad with parameter russ
                            

                            Google Assistant said this:

                            Running notepad on DS with params russ with result My command result
                            

                            I'm pretty happy with how it turned out.

                            I only gave about 4-5 seconds to send a result via that SendResult.bat script. If you take too long, it will say "no result" in the {{result}} placeholder.

                            EDIT: Now you can do this with Alexa too.

                            Russell VanderMey

                            1 Reply Last reply Reply Quote 0
                            • Furkan CevikF Furkan Cevik referenced this topic on Feb 12, 2022, 1:22 PM
                            • R Russ referenced this topic on May 23, 2023, 12:47 AM
                            • First post
                              Last post