Shell Commands not executing successfully

Hi folks - I’ll try to be brief and straight to the point.

New to Home Assistant - but I’ve been able to get pretty far understanding the syntax, Jinga2 templating, and overall layout. Running the latest version - never ran any older versions.

I have a variety of switches and devices configured that are working great. Command line switches performing curl GET/POST requests - dynamic sensors parsing XML data from my Marantz - and IP cameras.

The problem is that I cannot get a single Shell_Command to work - whether it be using automation or a script. If I execute hass from the commandline, and I watch the live feed, I can see the service being called when I do manual calls in the dev tools. However - nothing ever comes of it. Simple curl requests aren’t running - and I’ve compared my shell_commands to every template on github I can find. These same curl requests work if used in a command_line switch, or if run from the local ssh console - so it’s not the command itself.

I even removed all but one shell_command and made it a simple ‘reboot’ to kill the server if it happens to successfully run. I was able to get it to work once - and that’s only instance I’ve ever gotten one to work.

The last thing I’ve done is put my curl command into a script file and call the file itself. Executing the script from the console gets the desired result - but I cannot get Home Assistant to run it when I call the script in the dev console - or through automation tied to input_select or input_sliders.

I know that the yaml files I’ve made are being invoked - because if and when I screw up the formatting, it will error out when I’m starting. The scripts also show up in the dev section on the sidebar. I have also done a tcpdump packet capture and seen that there are no POST/GET requests when I call the service - but obviously everything on command_line switches works just fine.

I’m not sure how else to validate what Home Assistant is doing.

Here’s my most simple reduction just trying to get it to work. A curl command in a script file - remember I have tried doing curl and all that directly in the yaml - didn’t work either.
scripts.yaml (formatting broken by forum - proper spacing in my copy)
` ltson:
sequence:

  • service: shell_command.lights`

shell_commands.yaml
lights: /root/.homeassistant/script/lights_script.sh

PS - Home Assistant is running as root - it’s not a permissions/sudo problem

Fixed my problem - capital letters in the alias names defined in shell_commands causes it to crash.

So do minus signs.

Ended up rebuilding the entire host on Ubuntu instead of Centos because shit was breaking left and right. (History, logbook, automation all failing at startup)

Care to share the Marantz scripts you are using?

Sort of messy - and plan on cleaning up the volume bits, but here’s the shell commands I’m using. It’s documented on OpenRemote for Denon web api handling.

marantz_main_power_on: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutSystem_OnStandby%2FON%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_power_off: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutSystem_OnStandby%2FSTANDBY%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_mute_on: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutVolumeMute%2Fon%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_mute_off: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutVolumeMute%2Fon%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_vol_up: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeBtn%2F%3C marantz_main_vol_down: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeBtn%2F%3E marantz_main_input_bd: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FBD%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_input_cd: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FCD%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_input_dvd: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FDVD%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_input_sat: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FSAT%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_input_game: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FGAME%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_input_aux1: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FAUX1%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_main_input_aux2: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FAUX2%26cmd1=aspMainZone_WebUpdateStatus%2F marantz_zone2_on: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FON%26ZoneName=ZONE2 marantz_zone2_off: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_OnOff%2FOFF%26ZoneName=ZONE2 marantz_zone2_input_bd: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FBD%26ZoneName=ZONE2 marantz_zone2_input_cd: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FCD%26ZoneName=ZONE2 marantz_zone2_input_dvd: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FDVD%26ZoneName=ZONE2 marantz_zone2_input_sat: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FSAT%26ZoneName=ZONE2 marantz_zone2_input_game: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FGAME%26ZoneName=ZONE2 marantz_zone2_input_aux1: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FAUX1%26ZoneName=ZONE2 marantz_zone2_input_aux2: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutZone_InputFunction%2FAUX2%26ZoneName=ZONE2 marantz_main_volume_n80: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-80 marantz_main_volume_n76: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-76 marantz_main_volume_n72: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-72 marantz_main_volume_n68: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-68 marantz_main_volume_n64: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-64 marantz_main_volume_n60: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-60 marantz_main_volume_n56: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-56 marantz_main_volume_n52: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-52 marantz_main_volume_n48: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-48 marantz_main_volume_n44: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-44 marantz_main_volume_n40: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-40 marantz_main_volume_n36: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-36 marantz_main_volume_n32: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-32 marantz_main_volume_n28: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-28 marantz_main_volume_n24: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-24 marantz_main_volume_n20: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-20 marantz_main_volume_n16: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-16 marantz_main_volume_n12: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-12 marantz_main_volume_n8: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-8 marantz_main_volume_n4: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F-4 marantz_main_volume_0: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F0 marantz_main_volume_4: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F4 marantz_main_volume_8: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F8 marantz_main_volume_12: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F12 marantz_main_volume_16: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F16 marantz_main_volume_20: curl -X GET http://[Marantz_Network_IP]/MainZone/index.put.asp?cmd0=PutMasterVolumeSet%2F20