Create automation to shutdown a pi with motioneyeOS via ssh command

Hi there! Hope my topic is in the right category.

I have a pi running motioneyeOS (a surveillance camera server so to say) on the same network as my HA (also runs on a pi). The pi with motioneye runs 24/7, however I would like to shut it down at night. To automate that I would like to use an ssh command. I already found out that the required command is “halt”. When I ssh into the motioneye pi (no password required) via the ssh terminal of my HA ( “Advanced SSH & Web Terminal”-Addon) and enter the “halt” command it does exactly what I want and shuts itself down.
When trying to put that in an automation however, I can’t get it to run. My config.yaml looks like that:

shell_command:
send_ssh_command1: ‘[email protected] “halt”’

I’ve tried both combinations of double / single quotes, but I always get an error in the log:

Logger: homeassistant.components.shell_command
Source: /usr/src/homeassistant/homeassistant/components/shell_command/init.py:117
Integration: Shell Command (documentation, issues)
First occurred: 10:42:00 (1 occurrences)
Last logged: 10:42:00

Error running command: [email protected] 'halt', return code: 127
NoneType: None

Does someone have an idea on what I’m doing wrong here? Thanks!

I think your config needs to be:

shell_command:
send_ssh_command1: ‘ssh [email protected] “halt”’

Thanks for your feedback! I now get another error:

Error running command: ssh [email protected] "halt", return code: 255

seems like the issue fixed for me with 2023.7.0 update