Nice @karnold69 ! Thanks for sharing your working script.
-
RE: Can't add triggercmd to Google Home
@Abel-Boby, do you see a list of voice commands on this page?
You should have one voice command for each of your triggercmd commands that has a voice word, but only if the computer is your default computer or it has a voice word assigned to it. You can set your default computer on your profile page.
In other words, these are the requirements for creating virtual devices in Google Home for your commands:
- Each command must have a voice word.
- Each computer must have a voice word, or it must be your default computer.
-
RE: Dimming X10 modules
@karnold69 sorry, I didn't read your first post well enough. Now I understand you want to be able to dim your X10 bulbs with a Windows batch file using Alexa. Please try this script:
Be aware though, you can't dim smart bulbs or send a percentage to a triggercmd acommand by saying to Alexa, "Alexa, dim bulb X". You have to say "Alexa, dim bulb X to 20 percent", or something like that (where X is the bulb name or voice name for your triggercmd command.
I used ChatGPT to create this script, and tested it. I think it could work for you.
https://chatgpt.com/share/67a91dfc-f4a4-8004-bfd5-09f488830d9e
Here’s a revised version of your script that allows you to specify a percentage instead of the word "dim." It ensures the dim level is one of the allowed values (10, 20, 30, etc.) and calculates the number of dim commands needed accordingly.
script.bat:
batch @echo off set "level=%1" :: Ensure the input is a valid percentage (10, 20, ..., 90) if "%level%"=="10" goto valid if "%level%"=="20" goto valid if "%level%"=="30" goto valid if "%level%"=="40" goto valid if "%level%"=="50" goto valid if "%level%"=="60" goto valid if "%level%"=="70" goto valid if "%level%"=="80" goto valid if "%level%"=="90" goto valid echo Invalid dim level. Please enter 10, 20, 30, ..., 90. exit /b :valid :: Turn on the light (assumes it starts at 100) curl http://127.0.0.1:8086/?x10command=DEVICE~sendplc~"K4 on" :: Calculate the number of dim commands (each step reduces by 10%) set /a "steps=(100 - %level%) / 10" :: Send the dim commands for /l %%i in (1,1,%steps%) do ( curl http://127.0.0.1:8086/?x10command=DEVICE~sendplc~"K4 dim" ) echo Dimmed to %level%%
-
RE: Issues following installation instructions
@jcksnftsn, the Raspberry Pi agent is meant to run as a systemctl daemon. Will you please confirm it's running with this command?
systemctl status triggercmdagent
Hopefully you'll see this as part of that output:
Active: active (running) since ....
Only your "background" commands will be runnable because the daemon runs the agent in background mode. The agent will ignore attempts to run the foreground commands.
The easiest background command to test that comes with the default commands.json file is this one:
{"trigger":"Reboot","command":"shutdown -r","ground":"background","voice":"reboot","allowParams": "false"},
Notice that command's ground value is background.
That one is easy to test because it's easy to observe your Raspberry Pi rebooting.
Please tell me if that works, and what you want to try next.
EDIT 2/8/25: I fixed the Raspberry Pi .deb installer. Now the triggercmdagent command works again. Thanks again for reporting that issue.
-
RE: Issues following installation instructions
@jcksnftsn, thank you again for reporting this. I think I have a bug in this latest version. I'll fix it this weekend.
In the meantime you could replace the contents of your /usr/bin/triggercmdagent script with what I have and it should work.
Alternatively, you could run the agent with like this instead:
sudo su - node /usr/share/triggercmdagent/app/src/agent.js --console ( Paste in your token, and press ENTER. ) ( Press CTRL-C to quit. )
Then install the background agent.
/usr/share/triggercmdagent/app/src/installdaemon.sh
-
RE: Triggercmd does not open on Fedora 41 GNOME
@ess__gabriel, I remember now. Tray icons no longer work by default, so you have to install this Gnome shell extension: https://extensions.gnome.org/extension/615/appindicator-support/
-
RE: Dimming X10 modules
@karnold69, you can send a dim level from 0 to 100 percent.
For example, I have a command called "logger" with parameters enabled. I just said, "Alexa, logger 10 percent" and it ran my command with 10 as the parameter.
Here's the Runs list entry:
-
RE: Triggercmd does not open on Fedora 41 GNOME
@ess__gabriel, thanks for reporting it. I'll test it and get back to you soon.
In the meantime you can edit your commands in the ~/. TRIGGERcmdData/commands.json file.
I assume the agent is working otherwise.
-
RE: Issues following installation instructions
@jcksnftsn, thank you for reporting it. I'll test it on the latest Raspberry Pi OS and get back to you soon.
In the meantime, can you check these and let me know what you see?
This is what the /usr/bin/triggercmdagent script should look like:
#!/bin/bash # This file was autogenerated by node-deb 0.5.0 set -e set -o pipefail cd /usr/share/triggercmdagent/app /usr/bin/env node src/agent.js --console "$@"
Also, this is what should be in that /usr/share/triggercmdagent/app folder:
root@raspberrypi:/usr/share/triggercmdagent/app# ls LICENSE node_modules package.json src