+ Antworten
Ergebnis 1 bis 4 von 4
  1. #1
    Registriert seit
    Dec 2014
    Beiträge
    4

    Standard Calling a python script and using the result as an variable?

    I have several raspberry pies around my house for various purposes. Amongst others measuring the moisture of the soil in my (comming) cucumber plants. Because I barely know what I'm doing the easiest route for me to get the walue of the probe to IPS is to call a python script which came with the probe on the rPi, and get the result to IPS. But I can't get the result to the variable in question. For now I'm content with running the script on the local Pie, bu eventually I'll be wanting to un the script on another Pie in my home network.

    I have tried:
    $output = IPS_Execute ("whoami", "", true, true);
    SetValue (52245, $output);

    which gets the correct result in the variable, but:
    $output = IPS_Execute ("python", "/home/pi/vanning.py", false, true);
    SetValue (52245, $output);

    won't give any result.

    Is it possible to get what I want done?

    I have tried searching the forum, but I can't seem to find what I'm looking for, und meine deutsch ist nicht gut, leider


    cinemarillion

  2. #2
    Registriert seit
    Sep 2014
    Ort
    Limeshain (Hessen)
    Beiträge
    5,276

    Hi!

    Search forum for „exec“ or „shell_exec“. There are some threads about this topic.
    Essential thing - your python script has to „output“/echo the result to shell >> If you run your python script directly via ssh, the result must be shown in shell.

    Another possibility is to call your python script from IPS, but pass your result(s) back to IPS via IPS-API (IPS Documentation - „Datenaustausch“) or via WebHook.

    Kind regards,
    Chris
    IP-Symcon Module >> www.bayaro.net << Verfügbare Module: BatterieMonitor, BundesligaTabelle, Enigma2BY, HeizölPreise, Helios, Horoskop, HostMonitor, IPSInformations, MELCloud, Müllabfuhr, PJLink, RSS, TankerkönigSpritpreise, xREL
    IPS Unlimited, ~1200 Scripte, ~7000 Variablen

  3. #3
    Registriert seit
    Mar 2014
    Beiträge
    12

    Standard Use JSON-RPC

    I use JSON RPC, see thread
    JSON-RPC über Python

  4. #4
    Registriert seit
    Dec 2014
    Beiträge
    4

    Viele Danke

    I thought I had it, but I just fooled myself... I got the python script to send the variable to IPS, but I still can't call it from ips. I thought that going through tasker and autoremote om my android would help me, but alas, although I manage to call the script from the phone, I still cant make it do as I want from IPS. I guess it's a basic error, but I cant get response through any of the exec/system/shell_exec/IPS_execute commands I have tried. : Banghead:

    Do either of you have a noob-approach for me?

    Andreas

Ähnliche Themen

  1. SetValue and calling custom action
    Von roelv im Forum General Discussion
    Antworten: 1
    Letzter Beitrag: 24.02.17, 21:28
  2. Symcon 4.1 auf Raspberry - Python script einbinden
    Von babba im Forum Allgemeine Diskussion
    Antworten: 5
    Letzter Beitrag: 11.01.17, 20:15
  3. XmlRpcClient error calling system.multicall
    Von chrissiboy im Forum HomeMatic
    Antworten: 1
    Letzter Beitrag: 26.01.16, 13:36
  4. Antworten: 5
    Letzter Beitrag: 08.10.12, 10:26
  5. Warum geht ISDN-Status auf Calling?
    Von tommi im Forum Allgemeine Diskussion
    Antworten: 4
    Letzter Beitrag: 15.06.05, 20:31