OmniThing allows you to create a switch that runs a “CommandExecuter” output. In the web configuration tool that runs on your pi locally, it allows you to specify any bash command you want for both “on” and “off” states. You enter the commands directly in the web browser.
In the case of running an arbitrary script already on the pi, the command can just be “/path/to/script.sh”. If you want, you can also write simple scripts directly in the browser (i.e. ‘echo “Task one”; echo “Task two”’).
In the SmartThings app, you will see a switch, and toggling it will run the appropriate script for on/off.
Example of how I turn my windows vm on/off with SmartThings from my linux host: