Commands.json reverting to previous version
-
I have triggercmd working finr on my Raspberry Pi. I have edited before the /root/.TRIGGERcmdData/commands.json (with sudo nano).
I have changed the internal drive of the Pi from SD to nvme with its own SD cloner. So far I had no problem at all and Trigger CMD continues to work.
However, every time I "sudo nano /root/.TRIGGERcmdData/commands.json" I can add new commands, I can save, but as soon as I exit the json reverts back to the previous one (which is not the default one, it's the one I edited before changing the drive).
I tried to text edit with a gui (sudo mousepad ...) and as soon as I edit the file and successful save it, it says 'external program changed the file, do you want to reload?'
If I stop the service and edit the json the modifications stick until I restart triggercmd service, at that point it reverts back to previous.
Could you please help? I am sure I am just missing something. Perhaps I should just ininstall triggercmd and reinstall it on the pi?
-
Now I have uninstalled it with sudo dpkg -P and reinstalled it and it no longer runs.
When reinstalling when I tried to run 'triggercmdagent' to paste the token, it gives me this error: /usr/bin/triggercmdagent: line 5: /usr/share/triggercmdagent/app/null: no such file or directoryso I skipped to installdamon.sh, which seemed to work fine.
However this is the output of systemctl status triggercmdagent:Any help please?
-
I cannot actually reinstall it - it was the residual service after dpkg -P.
I tried reinstalling it and it returns this error
If I run npm audit fix --force I continue to have the same issue
Not sure what's happening, could you help please?
-
Ok, now reverted back to sd card installation.
systemctl status returns that triggercmd is running.
HOWEVER:
Under my computers it shows as GREEN only if I manually start triggercmdagent from terminal (and I don't CTRL-C out of it). This is with the service running.
With triggercmdagent running there are no triggers listed on the website even though my root triggercmd commands.json has the previous triggers in.
I have tried re inputting the token and re-running installdaemon.sh. Both work without errors, but I still can't make it work as a service.
Can you help please? not sure what's going on - sorry for the many messages.
-
Final message, I hope. Now I am back to the starting point: triggercmd works fine on my Pi, but I cannot edit the commands.json file. Every time I edit it, it allows me to save it but then an 'external program' changes it back to a previous version.
Now 'interestingly': if I edit the commands.json.backup and add the new trigger, then when I edit the commands.json it does 'revert' to a previous file... but it is the commands.json.backup file.
Still, the trigger does not show up in triggercmd.com .
All triggers that I have created previously work well -
@Al-S, the agent will restore the commands.json.backup file if it detects invalid json in the commands.json file.
If you have a valid commands.json file and the commands don't get added on the website when you add them to commands.json, the most common reason the agent is running in background mode but you've make the "ground" value equal "foreground". When you install the agent with installdamon.sh, it will run in background mode, so you should make ground=background.
Please copy/paste your commands.json file here. Maybe I can spot the issue. A common problem I've seen is a comma after the last command in the array. You can also test your json by copy/pasting it into an online json parser like this one: https://jsonparser.org
-
@Russ STAR. Yes it was a comma…
Now I ran into another problem I am afraid.
Triggercmd sees the new commands on the webpage and I can trigger them. However no changes are detected by the Alexa skill. I can run all commands I already had via Alexa, but the new ones (which are on triggercmd.com and work) don’t appear as switches. I have removed and reinstalled the skill (the smart home one), but it still detects only the only triggers. Sorry to pester you! Any clue? -
@Al-S, do the new commands have a voice word? That's required for the skill to create devices.