Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Einsteigerfragen
    4. Pythonaufrufe per Blockly

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Pythonaufrufe per Blockly

    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tklein last edited by

      Hallo,

      wie kann ich die Eingabe von einem Python3 Aufruf nebst Eingabe in der Shell in Blockly per exce simulieren?

      Hintergrund: Durch die Nutzung von der Geckolib (https://github.com/gazoodle/geckolib) kann ich meinen Whirlpool steuern. Über die Kommandozeile / Geckoshell klappt das. Nun möchte ich das am liebsten per Blockly triggern. Zur Not ginge auch ein JS-Script. Wobei ch das noch nie selbst geschrieben habe.

      Mein erfolgloses Blockly sieht so aus:

      7764b625-b58b-4398-b924-8777672eda65-grafik.png

      Hier die Logausgabe:

      javascript.0 (20560) script.js.common.Draussen.Wellis_Whirlpool.Spa_Test: exec: python3 from geckolib import GeckoShell GeckoShell.run() LI ON
      

      Aber es passiert nix am Whirlpool.

      So sieht der Aufruf in der Konsole aus:

      pi@raspberrypi-iob:~ $ python3
      Python 3.7.3 (default, Jan 22 2021, 20:04:44)
      [GCC 8.3.0] on linux
      Type "help", "copyright", "credits" or "license" for more information.

      from geckolib import GeckoShell
      GeckoShell.run()

          <Disclaimer>
          ----------------------------- USE AT YOUR OWN RISK -----------------------------
      
          This code will allow you to make changes to your spa configuration that is
          outside of what the app, top panel and side panel settings allow. I've not
          tested every setting and it might be that you prevent your spa pack from
          operating as it used to do.
      
          I strongly suggest dumping the configuration values with the "config" command
          and recording them somewhere safe.
      
          </Disclaimer>
      

      Starting discovery process...Found 1 spas
      Connecting to spa Wellness at 192.168.0.167 ... connected!
      Heater: Temperature 37.5°C, SetPoint 37.5°C, Real SetPoint 37.5°C, Operation Idle
      Pump 2: OFF
      Pump 1: OFF
      Waterfall: ON
      Lights: OFF
      WaterCare: Waiting...
      Smart Winter Mode:Risk: NO
      Circulating Pump: ON
      Ozone: OFF
      Smart Winter Mode:Active: False
      Filter Status:Clean: True
      Filter Status:Purge: False
      Economy Mode: False
      Welcome to the Gecko shell. Type help or ? to list commands.

      DJMarc75 1 Reply Last reply Reply Quote 0
      • DJMarc75
        DJMarc75 @tklein last edited by DJMarc75

        @tklein sagte in Pythonaufrufe per Blockly:

        GeckoShell.run()

        Nicht schön, aber ein Versuch ists mal Wert: funktioniert leider nicht !!

        Screenshot 2022-12-28 124356.png

        haus-automatisierung 1 Reply Last reply Reply Quote 0
        • haus-automatisierung
          haus-automatisierung Developer Most Active @DJMarc75 last edited by

          @djmarc75 So funktioniert das nicht. So wird jeder einzelne Befehl von /bin/sh ausgeführt.

          Am einfachsten ist es ein python Script anzulegen und das auszuführen

          DJMarc75 T 2 Replies Last reply Reply Quote 0
          • DJMarc75
            DJMarc75 @haus-automatisierung last edited by

            @haus-automatisierung sagte in Pythonaufrufe per Blockly:

            So funktioniert das nicht. So wird jeder einzelne Befehl von /bin/sh ausgeführt.

            Da hast Du Recht - Denkfehler von mir !

            1 Reply Last reply Reply Quote 0
            • T
              tklein @haus-automatisierung last edited by

              @haus-automatisierung

              danke für den hinweis,

              dann bekomme ich folgendes:

              pi@raspberrypi-iob:~/wellis $ python test.py
                File "test.py", line 5
                  LI ON
                      ^
              
              

              Hier der Dateiinhalt:

              from geckolib import GeckoShell
              GeckoShell.run()
              LI ON
              

              Falls das läuft, kann ich ja die Geräte (Licht, Pumpe 1 etc) sowie die Schaltaktion (an/aus/tempwert) bestimmt als parameter beim aufruf mit übergeben

              T 1 Reply Last reply Reply Quote 0
              • T
                tklein @tklein last edited by tklein

                wenn ich das "LI ON" auskommentiere, wird etwas ausgeführt. Ein sleep hat auch nix gebracht.

                Skript:

                import sys
                import time
                
                # test argv by commandline
                print(sys.argv[1])
                time.sleep(1)
                print(sys.argv[2])
                
                
                #call of python
                from geckolib import GeckoShell
                GeckoShell.run()
                time.sleep(8)
                #print("LI ON")
                #LI ON
                
                

                Ausgabe bei Aufruf:

                pi@raspberrypi-iob:~/wellis $ python3 test.py aber hallo
                aber
                hallo
                
                
                        <Disclaimer>
                        ----------------------------- USE AT YOUR OWN RISK -----------------------------
                
                        This code will allow you to make changes to your spa configuration that is
                        outside of what the app, top panel and side panel settings allow. I've not
                        tested every setting and it might be that you prevent your spa pack from
                        operating as it used to do.
                
                        I strongly suggest dumping the configuration values with the "config" command
                        and recording them somewhere safe.
                
                        </Disclaimer>
                
                
                Starting discovery process...Found 1 spas
                Connecting to spa `Wellness` at 192.168.0.167 ... connected!
                Heater: Temperature 37.5°C, SetPoint 37.5°C, Real SetPoint 37.5°C, Operation Idle
                Pump 1: OFF
                Pump 2: OFF
                Waterfall: OFF
                Lights: HI
                WaterCare: Waiting...
                Smart Winter Mode:Risk: NO
                Circulating Pump: OFF
                Ozone: OFF
                Smart Winter Mode:Active: False
                Filter Status:Clean: False
                Filter Status:Purge: False
                Economy Mode: False
                Welcome to the Gecko shell. Type help or ? to list commands.
                
                Wellness$
                
                

                Evtl weil ich da in einer Shell (Wellness) in der Pythonshell drin bin?

                OliverIO 1 Reply Last reply Reply Quote 0
                • OliverIO
                  OliverIO @tklein last edited by OliverIO

                  @tklein
                  Das funktioniert so nicht.
                  Gibt es da nur die interaktive Shell?
                  Kein echter Shell Befehl an den man dann Parameter dran hängen kann?

                  Du könntest mal folgendes probieren
                  python test.py < „LI ON“

                  Die beiden Anführungsstriche bitte umwandeln in normale . das Handy macht mir daraus immer die lexikalischen

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    tklein @OliverIO last edited by

                    @oliverio said in Pythonaufrufe per Blockly:

                    @tklein
                    Das funktioniert so nicht.
                    Gibt es da nur die interaktive Shell?
                    Kein echter Shell Befehl an den man dann Parameter dran hängen kann?

                    Du könntest mal folgendes probieren
                    python test.py < „LI ON“

                    Die beiden Anführungsstriche bitte umwandeln in normale . das Handy macht mir daraus immer die lexikalischen

                    klappt auch leider nicht:

                    pi@raspberrypi-iob:~/wellis $ python3 test.py < "LI ON"
                    -bash: LI ON: No such file or directory
                    
                    
                    OliverIO 1 Reply Last reply Reply Quote 0
                    • OliverIO
                      OliverIO @tklein last edited by

                      @tklein
                      Dann das

                      echo „LI ON“ | python text.py

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post

                      Support us

                      ioBroker
                      Community Adapters
                      Donate

                      371
                      Online

                      31.9k
                      Users

                      80.3k
                      Topics

                      1.3m
                      Posts

                      4
                      9
                      291
                      Loading More Posts
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes
                      Reply
                      • Reply as topic
                      Log in to reply
                      Community
                      Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                      The ioBroker Community 2014-2023
                      logo