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

    Timeout not working in TRIGGERcmd

    General Discussion
    2
    9
    663
    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.
    • L
      Luvtoski63
      last edited by

      Running a bat file with the timeout command between turning a light on, and turning it off works fine, but when run through TRIGGERcmd, the Timout function is ignored (light goes off after 1 second), any idea why?

      I want to turn on the porch light for 5min (300sec) to let the dog out, then have the light go off afterwards. Ideally I'd like to say in minutes the amount of time to leave the light on for through Alexa. Any assistance would be appreciated!

      Re: [Stupid Question](but I can't find the answer anywhere: How to make multi-line commands?)

      RussR 1 Reply Last reply Reply Quote 0
      • RussR
        Russ @Luvtoski63
        last edited by Russ

        @Luvtoski63, that's a cool idea.

        I'm not sure why the timeout command is failing. I had the same problem, but I found you can make it work if you prefix it with start /wait like this:

        REM Run calculator:
        calc
        
        REM Wait 5 minutes:
        start /wait timeout 300
        
        REM Kill calculator:
        taskkill /t /f /im calculator.exe
        

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • L
          Luvtoski63
          last edited by

          Dang, thanks Russ, that fixed the problem! It works great with a fixed amount of time. I am very new to this so if you don't mind me asking, the batch file for the variable amount of time works from the command prompt, but how do I get Alexa to pass the Timeout value through TRIGGERcmd?

          I tried saying the amount of time after saying the Voice/Trigger and I hear back that the Voice/Trigger "does not support that." I have "Allow Parameters" set to "true" and here is the batch file:

              "C:\Program Files (x86)\Common Files\X10\Common\ahcmd.exe" sendrf a4 on
          
               start /wait Timeout "%1"
          
               "C:\Program Files (x86)\Common Files\X10\Common\ahcmd.exe" sendrf a4 off
          

          Thanks for any guidance you can provide.

          RussR 1 Reply Last reply Reply Quote 0
          • RussR
            Russ @Luvtoski63
            last edited by

            @Luvtoski63, you could use this format:

            Alexa, ask triggercmd to run (trigger) with parameter (number of seconds)

            You don't need to quote the %1 in your batch file, fyi.

            Russell VanderMey

            1 Reply Last reply Reply Quote 0
            • L
              Luvtoski63
              last edited by

              Thanks Russ I do appreciate your help; however, either the time parameter is not getting passed correctly or the Timeout function is not working again (back to the original problem even with using "start /wait Timeout %1") as the light goes on then off in about 1 second no matter how much time I say.

              RussR 1 Reply Last reply Reply Quote 0
              • RussR
                Russ @Luvtoski63
                last edited by

                @Luvtoski63, have your tried typing your parameter into the prompt on the website first? That would determine whether it's an Alexa problem or not.

                Russell VanderMey

                1 Reply Last reply Reply Quote 0
                • L
                  Luvtoski63
                  last edited by

                  I hadn't but just did and the timer indeed works through the website...so I guess that leaves the problem with Alexa not passing the parameter to TRIGGERcmd...

                  RussR 1 Reply Last reply Reply Quote 0
                  • RussR
                    Russ @Luvtoski63
                    last edited by

                    @Luvtoski63, maybe you're saying, "... with parameter 10" and the batch file is getting "ten" instead of "10".

                    You should add a line to your batch file to log the parameter to a text file, like this:

                    echo %1 >> c:\tools\params.log
                    

                    Russell VanderMey

                    1 Reply Last reply Reply Quote 0
                    • L
                      Luvtoski63
                      last edited by

                      @Russ said in Timeout not working in TRIGGERcmd:

                      echo %1 >> c:\tools\params.log

                      That is exactly what is happening...and I can't find a way to get her to pass a number instead of text...she just takes the first word after "parameter". I may have to just go with a number of set durations for the timer...thanks for your help.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post