Template Switch or command_line - How do you combine

Oh! I see what you are saying. I missed that your off command was a switch, sorry. Change this:

platform: command_line
switches:
  switch_nas_off:
    command_off: "ssh -l sshd 192.168.1.30 'sh /usr/sbin/shutdown.sh'"
    command_state: binary_sensor.nas
    friendly_name: "Switch Off NAS"

To a shell command.

Something like this (no idea it it will work like this):

shell_command:
  switch_nas_off: "ssh -l sshd 192.168.1.30 'sh /usr/sbin/shutdown.sh'"

You will probably need to read this:

Though if it is working for the switch, it should work for the shell command.

Then this part of the WoL switch will be valid:

turn_off: command.switch_nas_off # used to turn off the switch

You will then have created one entity switch.nas and one service command.switch_nas_off, rather than two entities.