• header.categories
    • header.recent
    • header.tags
    • header.popular
    • register
    • login

    Question: Example script like "Operation send mail"

    scheduled pinned locked moved Developers Zone
    2 posts 2 posters 2.2k views 1 watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • C offline
      cimba007
      global: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 one-reply-to-this-post last-reply-time reply quote 0
      • jkandasaJ offline
        jkandasa @cimba007
        global: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
        one-reply-to-this-post last-reply-time reply quote 0
        • first-post
          last-post

        0

        online

        644

        users

        532

        topics

        3.4k

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