• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    Question: Example script like "Operation send mail"

    Scheduled Pinned Locked Moved Developers Zone
    2 Posts 2 Posters 2.0k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      cimba007
      last edited by

      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!

      jkandasaJ 1 Reply Last reply Reply Quote 0
      • jkandasaJ Offline
        jkandasa @cimba007
        last edited by

        @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
        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        0

        Online

        586

        Users

        529

        Topics

        3.4k

        Posts
        Copyright © 2015-2025 MyController.org | Contributors | Localization