Synology Tasks: Run any Synology task from Home Assistant

I put together a small integration for my own setup and thought I’d share it in case it’s useful to others.

:link: bbckr/hacs-synology-tasks on GitHub

This integration exposes Synology Task Scheduler tasks as entities in Home Assistant, allowing you to trigger these tasks or view the attributes, such as next_run_time, enabled, etc. on the task.

Since it basically relies on making API calls to the DSM API (similar to the Synology DSM integration), all you need to do is have Synology DSM integration configured with a working Synology device, then add the Synology Tasks integration, select the device you want to setup with the integration, and then you should see all your tasks under both the Sensors and Configuration for your NAS device.

:warning: Security notice: this integration reuses the same credentials you’ve already configured in the official Synology DSM integration ONLY for Synology devices you explicitly setup with this integration. That means you don’t need to set up a separate login, but it does rely on the DSM integration being present with a working Synology device. I know this may be an anti-pattern for custom integrations, but for me it got the job done for a first pass at the integration.

Note that I’ve only tested this against my setup, which consists of a single NAS server w/ two tasks. Feel free to also test it out yourselves and open an issue/PR to repo if you run into any bugs.

3 Likes

Hi Becker,

Thank you for your integration, this is exactly what I’m looking for to perform a wake on lan on a remote Windows PC. So far I’ve been using the task scheduler in DSM but I would like to trigger the task from a zigbee button so I don’t have to go to the Synology Web UI to trigger the task manually. I managed to install your integration, it looks like everything’s fine since my Synology tasks are now discovered as entities in Home Assistant, but I can’t manage to make them work.

The wake on lan task is just one line:

synonet --wake <MAC address> eth0;

This works fine if I run it in DSM.
How should I trigger the task in HA? Currently I’m using a button with Tap behavior set to “Perform action”>“Run Task”>“The name of my task” but nothing seems to happen. I don’t even see anything in the logs.

Any help would be greatly appreciated!

Thanks