Advice for best way to execute Scripts


I am trying to use the Synology-VM API to turn on / Shut down my virtual machine with the use of a openhab switch item.

In the past i implemented a python script which i put into the scripts folder.
I had to install python for this (i used it a while ago when i was runnint openhabian on a debian vm so i installed python there). Now i am running openhab in a docker container on my synology nas.

I did a little research and found different approaches.
Would you recommend setting up HABApp?

Should I install python in the openhab docker container or is there a more elegant way?

There is the documentation for the api so you know what i try to achieve:

Synology Virtual Machine Manager API Guide

Thank you for your support!

If you must use Python, then HabApp seems to be the way to go in terms of a currently supported solution.

Alternatively you could use jsscripting or jruby. There is no need to run external scripts. jsscripting / jruby is just as capable as any external scripting and can certainly deal with the synology api.

For example, you can find a synology api implementation in ruby: synowebapi | | your community gem host
And in javascript:

Or, since only want to perform a shutdown, you could write your own implementation using any of the available http interface in the respective language ecosystem.

1 Like