Question: Example script like "Operation send mail"



  • Hello,

    I want to create a simple operation using scripting support and python.

    The python file should be executed and the parameter to the pythonfile should be the reason the operation triggered.

    It should be similar to the "send mail" operation but the parameters should be passed to a python script. Can anybodyd provide some basic information or an example as how to pass the parameters to a python script?

    In the end I would like to run an other command from python:

    yowsup-cli demos -l XXXX "Test"

    where "Test" should be replaced with the trigger reason.

    Thanks in advance!


  • ADMIN

    @cimba007

    MyController supports to execute operations from script. You can pass bindings as JSON key-values. For now we cannot pass dynamic detail from Operations. But you have query options to communicate with MyController. You can get details like Node, Gateway, Sensors, Rules, Operations, etc., Refer MyController document on downloads page

    MyController supports for Python scripts. But by default it's not shipped with Python-Java support engine which is www.jython.org

    Steps to add new script engine

    Download jar file and place it under mycontroller/lib/ and restart MyController services.
    For example if you want to add Python support on MyController, you need to add Jython library.

    • Download jython-standalone-*.jar from Jython website.
    • Place it under mycontroller/lib/
    • Stop MyContorller
    • Start MyController

Log in to reply
 

5
Online

309
Users

206
Topics

1216
Posts

Looks like your connection to MYCONTROLLER.ORG was lost, please wait while we try to reconnect.