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

    Can't add command with raspberry pi 3b+

    Raspberry Pi
    2
    9
    1.2k
    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.
    • P
      Phuong Dinh
      last edited by

      Re: Raspberry Pi setup
      I have tried opening the commands.json file and add
      {"trigger":"shutdown","command":"shutdown now","ground":"background","voice":"shutdown","allowParams": "false"}
      inside the parameters. However, the command does not show up on the website; and when I tried to execute the shutdown command through Alexa, it just beeped and did nothing. Can somebody help me with this problem?
      P.S: It does work with the original commands.

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

        @phuong-dinh,

        I'm glad you told me it works with the original commands. These are the original commands:

        [
          {"trigger":"Reboot","command":"shutdown -r","ground":"background","voice":"reboot","allowParams": "false"},
          {"trigger":"Gnome Editor","command":"gedit","ground":"foreground","voice":"edit","allowParams": "false"},
          {"trigger":"yum update","command":"yum -y update","ground":"background","voice":"yum update","allowParams": "false"},
          {"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update","allowParams": "false"}
        ]
        

        Can you paste your commands.json file here?

        If the Reboot command works, then could you just try changing that to shutdown now instead of shutdown -r

        Also - just to make sure you know - you need a comma at the end of any line except the last one.

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • P
          Phuong Dinh
          last edited by

          Below is the full commands.json file; it is under /home/pi/.TRIGGERcmdData.
          {"trigger":"Reboot","command":"shutdown -r","ground":"background","voice":"reboot","allowParams": "false"},
          {"trigger":"Gnome Editor","command":"gedit","ground":"foreground","voice":"edit","allowParams": "false"},
          {"trigger":"yum update","command":"yum -y update","ground":"background","voice":"yum update","allowParams": "false"},
          {"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update","allowParams": "false"},
          {"trigger":"shutdown","command":"shutdown now","ground":"background","voice":"shutdown","allowParams": "false"}
          ]

          Even when I changed the original reboot command to shutdown. The system still reboots.
          [
          {"trigger":"Reboot","command":"shutdown -P now","ground":"background","voice":"reboot","allowParams": "false"},
          {"trigger":"Gnome Editor","command":"gedit","ground":"foreground","voice":"edit","allowParams": "false"},
          {"trigger":"yum update","command":"yum -y update","ground":"background","voice":"yum update","allowParams": "false"},
          {"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update","allowParams": "false"},
          {"trigger":"shutdown","command":"shutdown now","ground":"background","voice":"shutdown","allowParams": "false"}
          ]

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

            @phuong-dinh, I suspect the commands.json file that you're actually using might be /root/.TRIGGERcmdData/commands.json. Can you check that?

            Russell VanderMey

            1 Reply Last reply Reply Quote 0
            • P
              Phuong Dinh
              last edited by

              Okay, I was editing the wrong file all along. Now I do see my trigger online, and I can activate it. However, I still can't tell Alexa to execute the new command. Once again, Alexa just beeped and then nothing happened. So right now this is what I have under /root/.TRIGGERcmdData/commands.json.
              [
              {"trigger":"Reboot","command":"shutdown -r","ground":"background","voice":"reboot","allowParams": "false"},
              {"trigger":"Gnome Editor","command":"gedit","ground":"foreground","voice":"edit","allowParams": "false"},
              {"trigger":"yum update","command":"yum -y update","ground":"background","voice":"yum update","allowParams": "false"},
              {"trigger":"apt update","command":"apt-get -y update","ground":"background","voice":"update","allowParams": "false"},
              {"trigger":"shutdown","command":"shutdown now","ground":"background","voice":"shutdown","allowParams": "false"}
              ]

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

                @phuong-dinh, ok, that's progress at least.

                You could try unlinking and re-linking your Alexa account to your TRIGGERcmd account.
                Also, what exactly are you saying to Alexa?

                Russell VanderMey

                1 Reply Last reply Reply Quote 0
                • P
                  Phuong Dinh
                  last edited by

                  Unlinking the Trigger CMD with Alexa doesn't seem to help.
                  My conversation with Alexa is like this:
                  Me: Alexa, open Trigger CMD
                  Alexa: Say something like: open calculator on ...
                  Me: Shutdown Magic Mirror (Magic Mirror is the name of the device)
                  Alexa: Beeped... and nothing happen.

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

                    @phuong-dinh, saying "shutdown magic mirror" is not a valid phrase for TRIGGERcmd.

                    Please try saying these:

                    Alexa, open TRIGGERcmd, (wait for the prompt), run shutdown.
                    Alexa, ask TRIGGERcmd to run shutdown.
                    Alexa, ask TRIGGERcmd to run shutdown on magic mirror.

                    Russell VanderMey

                    1 Reply Last reply Reply Quote 0
                    • P
                      Phuong Dinh
                      last edited by

                      Okay, the command lines you provided work, and I also changed my command word to just "shut" so Alexa can recognize it better. Overall, thanks a lot for helping me, TriggerCMD is definitely a great tool for the raspberry pi.

                      1 Reply Last reply Reply Quote 0
                      • tuicemenT tuicemen moved this topic from Instructions on
                      • First post
                        Last post