Sending JSON-RPC Data via shell-command

Hi all,

First post as I’m just getting started with Home-Assistant.

I’m trying to send some data to a separate system via JSON-RPC.
This is an extract of my config file:

  domotiganesthumidity: curl -sS -X POST -H "Content-Type:application/json" -H "Accept:application/json" -d '{"jsonrpc":"2.0", "method":"device.set", "params":{"device_id":122, "valuenum":"2", "value":"{{sensor.hallway_thermostat_humidity}}"}, "id":122}' SERVERIPADDRESS:9090

  alias: Update Nest Temp
    platform: time
    seconds: '/30'
    service: shell_command.domotiganesthumidity

And this is what I get when it runs: (preformatted text doesn’t seem to work for this)

17-01-21 14:25:00 homeassistant.components.shell_command: Error rendering command template: UndefinedError: 'sensor' is undefined
    Traceback (most recent call last):
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/", line 99, in async_render
        return self._compiled.render(kwargs).strip()
      File "/usr/local/lib/python3.4/dist-packages/jinja2/", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "/usr/local/lib/python3.4/dist-packages/jinja2/", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/usr/local/lib/python3.4/dist-packages/jinja2/", line 37, in reraise
        raise value.with_traceback(tb)
      File "<template>", line 1, in top-level template code
      File "/usr/local/lib/python3.4/dist-packages/jinja2/", line 385, in getattr
        value = getattr(obj, attribute)
    jinja2.exceptions.UndefinedError: 'sensor' is undefined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/", line 52, in service_handler
    rendered_args = args_compiled.render(
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/", line 86, in render
    self.hass.loop, self.async_render, kwargs).result()
  File "/usr/lib/python3.4/concurrent/futures/", line 402, in result
    return self.__get_result()
  File "/usr/lib/python3.4/concurrent/futures/", line 354, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/util/", line 167, in run_callback
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/", line 101, in async_render
    raise TemplateError(err)
homeassistant.exceptions.TemplateError: UndefinedError: 'sensor' is undefined

if I replace {{sensor.hallway_thermostat_humidity}} with a numeric value (like 45) it all works fine.

Q: How do I parse the humidity value as a parameter to the command?

This could help

And “Developer tools” -> Templates

Thanks Fabaff, though I’ve not found a solution there.
How would one pass parameters in a shell_command?

I’ve also tried a REST option without luck.