shell_command:
send_alert816: "/usr/bin/curl -X GET http://IP/get?input1=CheckMe"
clear_alert816: "/usr/bin/curl -X GET http://IP/get?input1="
I am trying to send dynamic infodata , i added a few shell command and they work but can not figure
out how to pass the infodata separate from the command without hard coding the command in the configuration.yaml , not sure that’s curl related or HA but any hits will be appreciated . I am assuming there is a simple way to send different http commands from within automation . Not also sure if REST API is any different then shell commands
Logger: homeassistant.components.shell_command
Source: helpers/template.py:425
Integration: Shell Command (documentation, issues)
First occurred: 12:41:11 AM (2 occurrences)
Last logged: 12:42:57 AM
Error rendering command template: JSONDecodeError: unexpected character: line 1 column 43 (char 42)
Error rendering command template: JSONDecodeError: unexpected character: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 423, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1950, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1854, in from_json
return json_loads(value)
orjson.JSONDecodeError: unexpected character: line 1 column 43 (char 42)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/shell_command/__init__.py", line 51, in async_service_handler
rendered_args = args_compiled.async_render(
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 425, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: JSONDecodeError: unexpected character: line 1 column 43 (char 42)
Because this is broken up into two different sections I don’t know if this refers to the line in configuration.yaml or in Developer Tools.
EDIT: Fixed the “column 43” error, was missing input1=