So i have a http listener on my pc running waiting to receive start program firefox as an example. This works with the following automation:
alias: Start firefox
description: ""
triggers:
- command:
- firefox
trigger: conversation
conditions: []
actions:
- data:
program_name: firefox
action: shell_command.start_program
mode: single
I want to expand this to whatever programs are defined in my script on my pc without having to "hard code" this into home assistant
this is what i have but when i trace it the program_name is empty in the action part i think
alias: Start any program
description: ""
triggers:
- command:
- open {program_name}
trigger: conversation
conditions: []
actions:
- data:
program_name: "{{ program_name }}"
action: shell_command.start_program
mode: single
this shell command it calls is:
rest_command:
open_program:
url: 'http://ip:port/start/'
method: POST
content_type: 'application/json'
payload: '{"command": "{{ program_name }}" }'