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

    Home Assistant syntax question

    Scheduled Pinned Locked Moved General Discussion
    5 Posts 2 Posters 1.1k Views 1 Watching
    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.
    • kellanistK Offline
      kellanist
      last edited by

      Setting up Home Assistant.

      I saw the post here: https://www.triggercmd.com/forum/topic/193/how-to-run-commands-from-home-assistant

      This is what needs to be entered in the .yml

      rest_command:
      triggercmd_calculator:
      url: 'https://www.triggercmd.com/api/run/triggerSave'
      method: "post"
      content_type: "application/x-www-form-urlencoded"
      payload: "trigger=calculator&computer=russfam&token=(your token from Instructions page)"

      Questions:

      1. For triggercmd_calculator in the second line, can that be anything? Where is that variable used?
      2. If I have a trigger called "Lock My PC" what do I use as a delimiter for the spaces? -? ""?
      3. Any fun script that anyone has kicking around that will parse the existing commands into the format above?
      1 Reply Last reply Reply Quote 0
      • kellanistK Offline
        kellanist
        last edited by

        Tried adding this to the yml file:

        rest_command:
        triggercmd_mute:
        url: 'https://www.triggercmd.com/api/run/triggerSave'
        method: "post"
        content_type: "application/x-www-form-urlencoded"
        payload: "trigger=mute&computer=VIEWSCREEN&token=MYTOKEN"

        Doesn't seem to show up in the Home Assistant dashboard.

        Anyone have any ideas?

        RussR 1 Reply Last reply Reply Quote 0
        • RussR Online
          Russ @kellanist
          last edited by Russ

          @kellanist, maybe you have to reload the config?

          I see mine if I click Services under Developer tools, and click the down arrow. It's called "rest_command.triggercmd_calculator".

          This is what's at the end of my configuration.yaml file:

          rest_command:
            triggercmd_calculator:
              url: 'https://www.triggercmd.com/api/run/triggerSave'
              method: "post"
              content_type: "application/x-www-form-urlencoded"
              payload: "trigger=calculator&computer=russfam&token=(mytoken)
          

          Russell VanderMey

          1 Reply Last reply Reply Quote 0
          • kellanistK Offline
            kellanist
            last edited by

            Ahhhh Ok I see it now! I thought it was going to add them to the dashboard directly but I need to add the service to an automation for it to work.

            For trigger names with spaces what is the delimiter?

            RussR 1 Reply Last reply Reply Quote 0
            • RussR Online
              Russ @kellanist
              last edited by

              @kellanis, the delimiter is %20

              Russell VanderMey

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • First post
                Last post