How to create template button to shutdown Synology NAS?

I wanted to expand my Power Outage automation to include the shutdown of my Synology NAS. I have the Synology integration installed. I found this which made it look easy, but then I read the fine print:

image

Then I found this code which I modified and added to my configuration.yaml:

switch:
  - platform: wake_on_lan
    name: "Shutdown Synology NAS"
    mac: "??:CF:67:FD:24:??"
    host: "10.99.??.??"
    turn_off:
      service: synology_dsm.shutdown

It creates a switch which I simply shutoff in my automation. This does work to shut down the NAS. Then I read further and found that “switch” is deprecated, to use a button template.

So, I tried creating a button template helper, and am completely stuck. Can anyone show me the correct way to accomplish shutting down the NAS?

-Thanks

No. The action you are using in the WoL switch is depreciated. Not the WoL switch.

I’m pretty sure you don’t need to.

I don’t use the integration but the way I read it…

The Synology integration should provide a button as well as that shutdown action (at least until the action is depreciated then it will only be the button). Check the entities available at Settings → Devices & Services → Synology. There should be a shutdown button there.

Absolutely correct …


1 Like

Thanks for confirming Jeff.

Just to wrap up, this is how you would use that button in your automation to shutdown your NAS:

actions: 
  - action: button.press 
    target:
      entity_id: button.your_nas_server_name_here_shutdown
1 Like

Thank you, I totally missed that button entity! My first attempt sent me on a fools errand after seeing this “deprecated” message.

image

1 Like