The Wiser-by-Feller µGateway provides a script-engine to extend the Wiser-by-Feller functionality of smartbuttons with 3rd party services.
Some infos about the script-engine:
- Minimum required Wiser-by-Feller µGateway SW-Version
>= 5.1.25 - Script-langauge is (Micro-)Python
- The script-engine is still in Beta/Experimental state!
Using scripting allows you to invoke an action on 3rd party devices e.g. smart-lights that provides a REST-API by pressing a Wiser-by-Feller smartbutton.
The execution of a script is configured in a job and a job can be marriage with a smartbutton. That means, by pressing a smartbutton your script will be executed.
Uses-Cases:
-
Turn on or off a smart-light via REST-API.
- Button-type:
scene - Example:
hue_scene.py
- Button-type:
-
Increase or decrease the volume of your music-box via REST-API.
- Button-type
groupctrl - Example:
sonos.py
- Button-type
On the Wiser-by-Feller µGateway there is a simple Web-GUI used for Customer-Support. Use a browser and enter the IP-address or hostname of your µGateway e.g. "http://192.168.1.123". On first-time use, you need to create an account.
There is an easy way to create a script and link it with a smartbutton, without breaking your head by using the µGateway Web-GUI. Of course, you can do all the steps using the µGateway REST-API.
-
Login to the Web-GUI of your Wiser-by-Feller µGateway e.g. "http://192.168.1.123" and click on tab scripts.
Here you can upload your script or you can create a new one.
-
Lets create a new script by pressing button [
Create File 🆕] and named itcowsay.py.Note: Have a look at the script examples/templates in the dropdown-list:
- hue_scene.py
- hue_ctrl.py
- sonos.py
-
The new script file is created.
File-Actions:
Action Description 
Run/start the script. This will invoke first the function onStopand thenonStart
Stop the script. This will invoke the function onStop
Edit the script 
Delete the script -
Lets write some code. Press the pencil-button [✎] and copy the code inside.
#!/usr/bin/env micropython from sf.lib import alog # Called from job on smart-button event async def onButtonEvent(*argv): await alog(str(argv)) await alog('%s %s on smartbutton %s', argv[0], argv[1], argv[2]) # Called from the Web-GUI 'start'-button async def onStart(*argv): await alog(str(argv)) await alog('Lets dance...') # Called from the Web-GUI 'stop'-button async def onStop(*argv): await alog(str(argv)) await alog('Stop dance!')
-
Press the start-button [🚀]
-
To link the script-file with a smartbutton, press the button [Link to SmartButton🔗].
Now a popup-window will appears. Choose your file
cowsay.pyand button-typescene.Afterwards press button [Link to SmartButton].
-
At this moment all available smartbuttons from type
scenewill start blinking (color:purple) and wait until one is pressed. -
After pressed smartbutton from type
scenethe script is linked and ready for use. -
Now click the smartbutton (that you linked before) and your script will be executed.
Lets decorate your Wiser-by-Feller buttons with different icons such as: play, stop, ...
Example (EDIZIOdue push button size 1/4):
🐮 Click button below for clean up this mess









