Getting HA config error for having more than 1 shell_command

Hi,

I wanted to create two shell commands as below:

shell_command:

  • setcam5overlay: ‘/scripts/setcam5overlay.sh {{ states.sensor.nursery_11_1.state }} {{ states.sensor.nursery_11_0.state }}’
  • poll_locations: ‘ssh [email protected] /scripts/poll_locations.sh’

But this is an error message I’m getting in the log file:

17-02-25 14:27:47 ERROR (MainThread) [homeassistant.bootstrap] Invalid config for [shell_command]: expected a dictionary for dictionary value @ data[‘shell_command’]. Got [OrderedDict([(‘setcam5overlay’, ‘/scripts/setcam5overlay.sh {{ states.sensor.nursery_11_1.state }} {{ states.sensor.nursery_11_0.state }}’)]), OrderedDict([(‘polllocation s’, ‘ssh [email protected] /scripts/poll_locations.sh’)])]. (See /home/hass1user/.homeassistant/configuration.yaml, line 242). Please check the docs at https://home-a ssistant.io/components/shell_command/

Any idea why I’m getting this? Thanks!

Shell_command indentation is not being displayed correctly here, but I do have two leading spaces before each shell command.

As per the big blue banner at the top of every forum page, you can use the code blocks (preformatted text) to ensure things are displayed correctly.

That said, a quick test suggests that the issue is that it’s not expecting the dashes (see here for some details on the differences).

Try:

shell_command:
  setcam5overlay: '/scripts/setcam5overlay.sh {{ states.sensor.nursery_11_1.state }} {{ states.sensor.nursery_11_0.state }}'
  poll_locations: 'ssh [email protected] /scripts/poll_locations.sh'
1 Like

That worked. Thanks!