Restart add-on from command line

This is the first thread I found when searching, so I wanted to follow this up with a current working solution:

If you’re okay with turning off protected mode in "terminal & ssh” addon then my ps1 script now has the line:

ssh [email protected] -i D:\keys\DAVID-LAPTOP-2023-12-24_TO_HOME_ASSISTANT_SSH_ADDON -p 3248 'sudo docker restart addon_c6a2317c_netdaemon4'

Where:

  1. pockybum522-ha-ssh is in allowed-users in the ssh addon config.

  2. the public portion of the ssh key specified in -i has been saved in the addon config

(also note there is a specific way you have to add the public key in the addon config, reference: epposan’s answer here: Cannot get SSH & Web Terminal add-on to accept authorized_keys - #5 by epposan )

  1. The private potion of the ssh key has no passphrase (obviously, since I want the script to be non-interactive)

  2. The addon ID given at the end of the line was found by sshing in manually and running ‘docker ps’