I dont know if this is the right channel to ask this question but I am trying to send a command through ssh to HA to restart an addon. I want to do this with the command
ssh [email protected] ha addons restart bitwarden
I am trying to do this from my PFSense router to restart the addon once my SSL cert is renewed automatically through ACME. I am getting a error of
Unexpected server response time="2022-12-13T21:28:34-06:00" level=error msg="Unexpected server response"
I have tried manually logging into HA through SSH and typing the command out and it works, but I would like to send that command though PFSense automatically. I have also tried sending other commands to a different server in the same manner and it works (example: ssh [email protected] systemctl restart pveproxy
) what can I do to achieve something like this?
EDIT:
So I posted this question in the Discord as well and someone might have pointed in the right direction. This command is what they suggested
curl -X POST -H "Authorization: Bearer ABCDEFGH" -H "Content-Type: application/json" -d '{"hassio":"a0d7b954_bitwarden"}' https://hassio.local/api/services/hassio/addon_restart
I have never used the RESTful API this way before im getting the error
{"message":"Data should be valid JSON."}
I am not sure what to do.