Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95385

Problem passing parameters to shell_command

$
0
0

@stargex wrote:

So I know this has been talked about a bunch on other threads but nothing mentioned in those seem to be helping me. I’m trying to setup a shell_command for the first time and I can’t seem to get it to accept any parameters. The command does work without parameters though so I’m not sure what is going on.

I’ve defined the shell_command in my configuration.yaml file like this:

shell_command:
  show_toast_command: node C:\path\to\node\script\showToast.js {{ entity_id }}

I’ve then tried to run the command through the web UI under Developer Tools -> Services and provided the following Service Data (YAML):

entity_id: "foobar"

This then produces the following error in the logs:

2020-04-09 12:36:38 ERROR (MainThread) [homeassistant.components.shell_command] Error running command: `node C:\path\to\node\script\showToast.js {{ entity_id }}`, return code: 1
NoneType: None

So if I replace {{ entity_id }} with just a hard coded value and don’t provide any service data the service call works. It only errors as soon as I add that parameter. I have tried wrapping the whole command in single quotes too and that doesn’t seem to change anything.

Any ideas what could be wrong? I’m guessing it is something super simple but I can’t quite figure it out.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95385

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>