Shell_command not showing in states

Hi,

I am trying to set up a shell command in home assistant. I have tried multiple ways but for some reason, after adding the shell command to directly to my configuration.yaml file like this:

shell_command:
  play_emo_punk_lr_cmd: 'curl 192.168.88.235/api/v1/commands/\?cmd\=playplaylist\&name=EmoPunk'

It does not show on the states page in home assistant and when I try to call the service, home assistant logs that it cannot find the service with the name of the command shell. This same command use to work previously but I recently fresh installed the latest version on a Raspberry Pi. What am I doing wrong?

Thanks
J

Does the command work from the shell?

Listening to emopunk.

But seriously, what happens if you try it with http:

'curl ‘http://192.168.88.235/api/v1/commands/\?cmd\=playplaylist\&name=EmoPunk

1 Like

Indeed it does. The problem is its like ha is not seeing the shell command in the config file so it does not show in the states page like all the other script.myscript etc

Lol. It could be worse. Could have been a justin bieber playlist. It does work in the terminal yes.

Ok but what if you add http to your shell command (compare mine to yours)?

Hi Tom,

Tested again by adding http:// to the curl command but still nothing. I don’t think it has anything to do with the actual command reason being that even though the command is invalid and won’t work, home assistant should still pick it up in the configuration file and display the command on the states page in home assistant as service.my_shell_command along with all the other light.mylight, switch.my_switch etc entities? This is what it is not doing. I can see all my entities in home assistant except for the shell command entities.

Thanks
J

Have you tried configuring other shell commands? Do they show up on the states page?

Somehow, I seemed to have fixed it. One thing I have noticed is that I was looking in the wrong place. the commands are not available on the states page but on the services page. Through my edits, I must have somehow fixed the config as it can call the services just fine now. I do not, however, know what was wrong with the config.

Thanks for all your help. Time to listen to some emo punk :stuck_out_tongue:

1 Like