Command line switch: shutdown remote via ssh

Hi all,
For everyone having issues due to home assistant in docker, the information in here helped me a lot:

It s important to put the keys in /config folder, and avoid asking about known_hosts, otherwise it gets silently stuck there.

switch:
  - platform: wake_on_lan
    mac: 94:c6:91:15:6c:6e
    name: nuc_tele
    turn_off:
      service: shell_command.turn_off_nuc_tele

shell_command:
  turn_off_nuc_tele: /usr/bin/ssh [email protected] -o "StrictHostKeyChecking no" -i /config/.ssh_keys/id_rsa "sudo /sbin/poweroff -f"

sudo with NOPASSWD should be enabled in “sudo visudo” for the homeassistant user (in the example above).