Home Assistant syntax question
-
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:
- For triggercmd_calculator in the second line, can that be anything? Where is that variable used?
- If I have a trigger called "Lock My PC" what do I use as a delimiter for the spaces? -? ""?
- Any fun script that anyone has kicking around that will parse the existing commands into the format above?
-
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?
-
@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)
-
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?
-
@kellanis, the delimiter is %20