Shell_command cant get a script to run

Hi Everyone,

really struggling to get shell_commands to run (hassbian setup)

I need to control a LED dimmer that ive built following quindorian’s awesome LED project (http://blog.quindorian.org/2016/07/esp8266-lighting-revisit-and-history-of-quinled.html/) that responds to commands via netcat

running the scrips via ssh terminal works perfectly fine - but I cant get HA to run them, below is from my current config

shell_commands.yaml
quinled_kitchen_100: /home/homeassistant/.homeassistant/shell_commands/QuinLED_Kitchen_100.sh’
quinled_kitchen_75: /home/homeassistant/.homeassistant/shell_commands/QuinLED_Kitchen_75.sh
quinled_kitchen_50: /home/homeassistant/.homeassistant/shell_commands/QuinLED_Kitchen_50.sh
quinled_kitchen_35: /home/homeassistant/.homeassistant/shell_commands/QuinLED_Kitchen_35.sh
quinled_kitchen_15: /home/homeassistant/.homeassistant/shell_commands/QuinLED_Kitchen_15.sh
quinled_kitchen_00: /home/homeassistant/.homeassistant/shell_commands/QuinLED_Kitchen_00.sh’

scripts.yaml
quinled_kitchen_100:
alias: Set Kitchen to 100% Brightness
sequence:
- service: shell_command.quinled_kitchen_100

quinled_kitchen_00:
alias: Set Kitchen to 0% Brightness
sequence:
- service: shell_command.quinled_kitchen_00

What errors are you getting in the log?

No errors, that’s part of the frustration - just does not seem to run.

try changing one to something like:

quinled_kitchen_100: '/bin/bash -c "/home/homeassistant/.homeassistant/shell_commands/QuinLED_Kitchen_100.sh"'

to force it to run in bash and see if it makes any difference

Also just noticed the odd single quote at the end of your line… and one not at the start on a few of the lines… assume that’s a copy/paste issue into the forum?

managed to get scripts to run by editing sudoers… not ideal, this is just a test environment at the moment. so looks like lack of permissions for homeassistant user to execute

sudo visudo
homeassistant ALL=(ALL) NOPASSWD:8ball:

You can actually do, so it’s only allowed to run that one command as sudo, and block all other sudo tries.

myusername ALL = (root) NOPASSWD: /path/to/my/program

Not too sure how it works with .sh tho.

Thanks - I will give that a try