Synology power on/off with template

I’m trying to build a template to switch on my synology (analke)
Since the synology is on another subnet than my HA, I’m using a template, but I can’t get it working (please keep in mind that I’m sort of a HA noob)

I reuse the templates I build to power on/off my esxi machines. I am able to power on the syno by calling a script on my esxi host which sends a magic packet to my syno. However, I’m not able to power it off.

At first, I tried to use the “service: synology_dsm.shutdown” service in my template, this worked once :slight_smile: Afterwards I got some strange errors in the log that I need to login.
So I switched to the native button, but I cannot get this integrated into my template file in configuration.yaml file.

My template, where analke is the name of the synology.

  - platform: template
    switches:
      analke:
        unique_id: analke
        friendly_name: Analke
        value_template: "{{ is_state('binary_sensor.analke', 'on') }}"
        turn_on:
          - service: shell_command.turn_on_analke
            entity_id: switch.analke
        turn_off:
          - service: button.analke_shutdown
            entity_id: switch.analke

I receive error below:

Service button.analke_shutdown called service switch.turn_off which was not found

I know it has something to do with the way I call the button.

When I add the card from the integration to the dashboard, I get the code below, so need to add the “shutdown” part to my template.

type: entities
entities:
  - entity: button.analke_reboot
    name: Reboot
  - entity: button.analke_shutdown
    name: Shutdown
title: Analke

What is the proper way to integrate the button into a template ?

There is no button. integration. There is a button helper.

I cannot get/figure out what you mean.
How do I link the button helper with the template which I’m trying to build ?