Can't add command with raspberry pi 3b+
-
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. -
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.
-
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"}
] -
@phuong-dinh, I suspect the commands.json file that you're actually using might be /root/.TRIGGERcmdData/commands.json. Can you check that?
-
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"}
] -
@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? -
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. -
@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. -
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.
-