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

    Home Assistant syntax question

    General Discussion
    2
    5
    337
    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
      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
        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
          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
            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
              Russ @kellanist
              last edited by

              @kellanis, the delimiter is %20

              Russell VanderMey

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