Help with multiple shell_command entries

Would someone help me understand what I’m getting wrong here? I’ve been staring at it too long, I think…

This works:

shell_command:
  kick_station_from_ap: 'ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] /root/bin/kick_station.sh'

But adding a second command, generates a configuration error…

shell_command:
  kick_station_from_ap: 'ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] /root/bin/kick_station.sh'
  restart_SAB_jail: 'ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] /usr/local/bin/iocage'     
Invalid config for [shell_command]: invalid slug restart_SAB_jail (try restart_sab_jail) for dictionary value @ data['shell_command']. Got OrderedDict([('kick_station_from_ap', 'ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] /root/bin/kick_station.sh'), ('restart_SAB_jail', 'ssh -i /config/ssh/id_rsa -o StrictHostKeyChecking=no [email protected] /usr/local/bin/iocage')]). (See /config/configuration.yaml, line 61). 

Thank you!

try rewriting the second with low caps restart_sab_jail

Oh wow… yes, that was it. Thank you.

Is this a yaml thing that I’m not aware of?

It’s a Home Assistant thing. Object ids must be lowercase letters, numbers or underscore characters only. Friendly Names and Names can have capital letters, other characters and spaces as well.

2 Likes

I searched the forum high and low and this is precisely what was happening to me!!! I can’t believe it!!!

thanks a million for this Tom!

1 Like