As an alternative to operate devices from Shelly through the network, certain devices allow to run scripts. The script language is similar to JavaScript.
See the tutorial https://shelly-api-docs.shelly.cloud/gen2/Scripts/Tutorial/
Features are https://shelly-api-docs.shelly.cloud/gen2/Scripts/ShellyScriptLanguageFeatures/
The script has an id number and can be managed with commands over the network see https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Script or more human friendly over its web interface.