Triggers appearing in view runs but not actually triggering.
-
I've installed TRIGGERcmd on my Macbook and have created the following command:
[ { "trigger": "sleep-leron-work-laptop", "command": "pmset sleepnow", "offCommand": "", "ground": "foreground", "voice": "", "voiceReply": "", "allowParams": "false" } ]
When I flip the switch inside of Home Assistant, the "view runs" log updates to show "Trigger sent from Home Assistant" but nothing happens after that and the "Runs" count doesn't increase from zero.
Can someone explain how I bridge the final gap between the website identifying that the trigger was sent from HA and turn that into the trigger actually running on my Macbook?
-
@Leron-Tolmachev, did you install the TRIGGERcmd agent on your Macbook?
You can download it from the bottom of the triggercmd.com home page.If so, are you able to run the command with the green Trigger button from your account on the triggercmd.com website?
-
@Russ, yes I've installed the TriggerCMD agent version 1.0.45, the Icon is present in my menu bar (kinda wish it were monochrome to match the others but that's a very small gripe), and when I click the green
️ button the mac goes to sleep as expected, but for some reason i can't get the same behavior to occur when triggering via HA
-
@Leron-Tolmachev, I'm still not sure whether it works when you click the green Trigger button on the triggercmd.com website. It looks like this:
We need to make sure that works before moving on to HA config.
When you click that green play button in the GUI Editor, that only tests running the command locally, not via the TRIGGERcmd cloud service.
-
@Russ Gotcha, sorry if I misinterpreted your ask. The button you indicated from the website does work, both when used on the Macbook itself and when pressed on my smartphone.
-
@Leron-Tolmachev, good, thank you for confirming that's working.
If you've enabled the Home Assistant Offline Configuration, please try disabling it, then restart the agent. That should allow the agent to run your commands via the Internet (HA -> triggercmd.com -> agent).
I'm thinking maybe the agent is ignoring the commands from the triggercmd.com server because the offline configuration is enabled but not working yet. It does that to avoid running your command twice - once directly from HA, and again from triggercmd.com.
If you want to get HA offline to work, please confirm your Home Assistant server is accessible at http://homeassistant.local:8123 from your laptop.
-
@Russ I unchecked the enable box and then quit & re-launched the agent like you suggested. I then tried triggering the switch in Home Assistant and it successfully turned off the device.
As for the online vs offline functionality, my HA instance is accessible from http://homeassistant.local:8123
If it matters, my Macbook is connected to the internet via an Ethernet cable and only falls back on the Wireless network if that cable gets unplugged.
Any guesses as to how to make the command work directly from HA via that offline option? It sounds realiy nice for not needing to rely on the external network
-
@Leron-Tolmachev, awesome. Thank you for confirming that works.
For the offline config, did you generate a long-lived access token from this page?
http://homeassistant.local:8123/profile/securityAnd you pasted that into the that Home Assistant Token field in your Home Assistant Offline Configuration page?
Also, you can check your ~/.TRIGGERcmdData/debug.log file for clues.
-
@Russ I had done it before, but just in case I made a mistake when copy/pasting I just deleted the old token, generated a new one and configured it in the TRIGGERcmd agent for Mac.
My log shows the following (with individual IDs omitted) when I attempted to flip the switch in HA (which didn't put the mac to sleep)
|> Now connected to https://www.triggercmd.com. \___/ For help, see: http://bit.ly/2q0QDpf (using sails.io.js node SDK @v1.2.1) Connected at: Thu May 29 2025 14:56:10 GMT-0700 (Pacific Daylight Time) { message: 'Subscribed to [alphanumeric_id_omitted]!' } Opening Home Assisant Config Configuration saved: Connected to Local Home Assistant WebSocket API Local Home Assistant Authentication successful! Computer name for Local Home Assistant listener: Leron-SL triggercmd.com data: { trigger: 'sleep-leron-work-laptop', id: '[string_of_digits_omitted]', sender: 'Home Assistant' } Ignored duplicate trigger
-
@Leron-Tolmachev, if you have parameters enabled, please try turning that off because that might explain why it works when you click the green Trigger button on the triggercmd.com website and it doesn't when you run the command via Home Assistant locally.
If parameters are enabled, Home Assistant will send on or off as the parameter, so " on" or " off" will be appended to the end of your command, which could be producing an invalid command.
Alternatively you could fill in the Off Command field, and that command will run when you toggle the HA switch off.
-
@Russ I currently do not have the parameters enabled, but before creating this post, I did try out exactly what you'd suggested (I enabled parameters and set the off-command to be identical to the command), but the behavior was the same, the "view runs" logged the command being sent from HA, but the "Runs" count didn't increment.
Feel free to let me know if we should just give up on troubleshooting this. I'm sure you have more important things to do and I now know that I can disable the offline component as a functional workaround.
Otherwise, I'm happy to keep digging and will perform any troubleshooting steps/provide any logs or screenshots you request
-
@Leron-Tolmachev,
I just realized you're not saying the command doesn't run. So please confirm: the command runs when you trigger it from HA, but it doesn't log "Command ran" in the runs list, correct?If so, that's a known issue with sending triggers direct from HA to the agent. The agent doesn't report that the command ran if the trigger came from HA. There wasn't an efficient way to report it because the ID of the command isn't available in this direct local LAN offline context. If you need to see Command ran logged, you should disable the offline HA integration in the agent config.
HA does still send the trigger to triggercmd.com though (which is logged in the Runs list) so cloud integrations (Zapier, Alexa routines, IFTTT, Make, etc) will still trigger if HA can access triggercmd.com when the command is triggered.