Can't poweroff with WOL

here is my struture of net devices

now i’m tring to control Gen8 NAS as a switch, for now the wol wake is OK, but the poweroff don’t work, I have created the ssh certification files between host and target devices.

turn_off_nas: ssh -i “/certification/hass_rsa” -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no {username}@{gen8 ip} “/sbin/poweroff”

is there anything wrong??

If you use the WOL Switch, the option schould be only turn_off.

yes, i use switch and use turn_off already.

- platform: wake_on_lan
  name: GEN8 NAS
  mac: !secret gen8_nas_mac
  host: !secret gen8_nas_ip
  turn_off:
    service: shell_command.turn_off_nas

sad the command doesn’t work

SSH to your ubuntu vm and try the following command
docker exec -i -t homeassistant /bin/sh
That should give you the console in the HA container.
Now test your shell_command inside the container.