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

Home Assistant syntax question

General Discussion
2
5
354
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.
  • K
    kellanist
    last edited by Mar 16, 2020, 2:18 PM

    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
    • K
      kellanist
      last edited by Mar 16, 2020, 2:29 PM

      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?

      R 1 Reply Last reply Mar 16, 2020, 2:53 PM Reply Quote 0
      • R
        Russ @kellanist
        last edited by Russ Mar 16, 2020, 2:55 PM Mar 16, 2020, 2:53 PM

        @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
        • K
          kellanist
          last edited by Mar 16, 2020, 4:58 PM

          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?

          R 1 Reply Last reply Mar 16, 2020, 5:44 PM Reply Quote 0
          • R
            Russ @kellanist
            last edited by Mar 16, 2020, 5:44 PM

            @kellanis, the delimiter is %20

            Russell VanderMey

            1 Reply Last reply Reply Quote 0
            2 out of 5
            • First post
              2/5
              Last post