Shell-command to power-off linux target not working

I try to setup a switch to turn a linux server on and off.
The remote host is configured to run the sudo /sbin/poweroff command without password and when I’m logged in there via ssh, it works.
However If I try ssh -i /ssl/ha_key -o StrictHostKeyChecking=no user@server sudo /sbin/poweroff, it gives me:

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper

So why is it working, when I’m logged in, but not if I want pass the command directly to ssh?

Oh wait - just discovered that it worked while logged in, because my sudo PW was cached because I used it shortly before - so going to look through the target machines configuration again…

The error was, that the entry in my sudoers file wasn’t at the end…

Sorry for bothering.