Change the command to:
ssh -i /config/ssh_keys/id_rsa -o 'StrictHostKeyChecking=no' pi@###.###.#.### sudo reboot
Got it from here: Running a shell command from Home Assistant to remote linux PC
Change the command to:
ssh -i /config/ssh_keys/id_rsa -o 'StrictHostKeyChecking=no' pi@###.###.#.### sudo reboot
Got it from here: Running a shell command from Home Assistant to remote linux PC