• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
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 Aug 19, 2019, 2:43 AM

    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.

    R 1 Reply Last reply Aug 20, 2019, 1:07 AM Reply Quote 0
    • R
      Russ @Phuong Dinh
      last edited by Russ Aug 20, 2019, 1:08 AM Aug 20, 2019, 1:07 AM

      @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 Aug 20, 2019, 10:06 PM

        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"}
        ]

        R 1 Reply Last reply Aug 21, 2019, 11:19 PM Reply Quote 0
        • R
          Russ @Phuong Dinh
          last edited by Aug 21, 2019, 11:19 PM

          @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 Aug 22, 2019, 6:24 AM

            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"}
            ]

            R 1 Reply Last reply Aug 23, 2019, 12:33 AM Reply Quote 0
            • R
              Russ @Phuong Dinh
              last edited by Aug 23, 2019, 12:33 AM

              @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 Aug 23, 2019, 4:23 AM

                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.

                R 1 Reply Last reply Aug 24, 2019, 2:55 PM Reply Quote 0
                • R
                  Russ @Phuong Dinh
                  last edited by Russ Aug 24, 2019, 2:57 PM Aug 24, 2019, 2:55 PM

                  @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 Aug 25, 2019, 6:28 PM

                    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
                    • T tuicemen moved this topic from Instructions on Jan 30, 2022, 7:55 PM
                    9 out of 9
                    • First post
                      9/9
                      Last post