TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Triggers appearing in view runs but not actually triggering.

    Mac
    2
    12
    20
    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.
    • Leron TolmachevL
      Leron Tolmachev
      last edited by

      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?

      RussR 1 Reply Last reply Reply Quote 0
      • RussR
        Russ @Leron Tolmachev
        last edited by

        @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?

        Russell VanderMey

        Leron TolmachevL 1 Reply Last reply Reply Quote 0
        • Leron TolmachevL
          Leron Tolmachev @Russ
          last edited by

          @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

          81424522-a3dd-40e6-9a4e-4322b4ffe0d3-image.png

          RussR 1 Reply Last reply Reply Quote 0
          • RussR
            Russ @Leron Tolmachev
            last edited by Russ

            @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:

            00779bb1-c7a0-431d-a039-95a8841fe02f-image.png

            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.

            Russell VanderMey

            Leron TolmachevL 1 Reply Last reply Reply Quote 0
            • Leron TolmachevL
              Leron Tolmachev @Russ
              last edited by

              @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.

              RussR 1 Reply Last reply Reply Quote 0
              • RussR
                Russ @Leron Tolmachev
                last edited by Russ

                @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).

                d2be9cb0-bd1b-4ae8-977b-ff399a7387e9-image.png

                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.

                Russell VanderMey

                Leron TolmachevL 1 Reply Last reply Reply Quote 0
                • Leron TolmachevL
                  Leron Tolmachev @Russ
                  last edited by

                  @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

                  RussR 1 Reply Last reply Reply Quote 0
                  • RussR
                    Russ @Leron Tolmachev
                    last edited by Russ

                    @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/security

                    And 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.

                    Russell VanderMey

                    Leron TolmachevL 1 Reply Last reply Reply Quote 0
                    • Leron TolmachevL
                      Leron Tolmachev @Russ
                      last edited by

                      @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
                      
                      
                      RussR 1 Reply Last reply Reply Quote 0
                      • RussR
                        Russ @Leron Tolmachev
                        last edited by Russ

                        @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.

                        631a206f-abb9-49c6-8cb8-1990e459c8a6-image.png

                        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.

                        Russell VanderMey

                        Leron TolmachevL 1 Reply Last reply Reply Quote 0
                        • Leron TolmachevL
                          Leron Tolmachev @Russ
                          last edited by

                          @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

                          RussR 1 Reply Last reply Reply Quote 0
                          • RussR
                            Russ @Leron Tolmachev
                            last edited by Russ

                            @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.

                            Russell VanderMey

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post