Hi guys,
I have been endlessly trying to pass parameters to a shell_command with no luck. I have tried every suggestion on the forums and the most progress I have made was to update the value to blank and not the actual value I am specifying in the data template.
My shell_command:
set_location: 'python /home/homeassistant/.homeassistant/scripts/set_global_user_state.py 1 "{{ location }}"'
Executing this script directly from terminal works great. It updates as it is supposed to so the issue is not within the py script.
I have tested the script in services by calling the shell_command.set_location
service with the following service data:
data_template:
location: "Test"
Problem is, the value does update, but it updates to a blank value instead of “Test”? as if the {{ location }}
variable has nothing in it.
I also have the following automation set up and when manually triggered, the result is the same.
- id: 'xxxxx'
alias: Update Global Location State
description: ''
trigger:
- platform: webhook
webhook_id: '2'
condition: []
action:
- data:
data_template:
location: >
{% states(''device_tracker.life360_jj'') %}
service: shell_command.set_location
Any help would be appreciated!
Thanks
J