Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. Test Adapter Windows-Control v0.1.x GitHub

    NEWS

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    • Save The Date: ioBroker@Smart Living Forum Solingen, 14.06.

    Test Adapter Windows-Control v0.1.x GitHub

    This topic has been deleted. Only users with topic management privileges can see it.
    • liv-in-sky
      liv-in-sky @Mic last edited by

      @Mic hört sich gut an - hauptsache man kann dieses update sofort machen

      würde mir gefallen 🙂

      1 Reply Last reply Reply Quote 0
      • C
        CruziX last edited by

        Freue mich darauf das morgen auch mal zu testen.
        Benötige eig nur Herunterfahren und hab das bisher über PAW2, tasker und Unified Remote gelöst, ist aber sehr unschön und funktioniert nicht immer korrekt.

        1 Reply Last reply Reply Quote 0
        • Mic
          Mic Developer @liv-in-sky last edited by

          @liv-in-sky sagte in Test Adapter Windows-Control v0.0.x GitHub:

          noch eine frage - man kann auch z.b. "http://192.168.178.36:8585/?chk=chrome" aufrufen und überprüfen, ob dieses programm läuft

          Neue Adapter-Version 0.1.0

          Gibt jetzt 2 neue Datenpunkte _processGetStatus und _processGetStatusResult pro Windows-Gerät.
          0-1-0_1.gif

          Um im JavaScript-Adapter den Status eines Prozesses abzufragen, kann man das Script hier nehmen:

          const pcName = 'Gästezimmer-PC'; // Name des PCs (in Adapter Windows Control)
          const checkProcess = 'chrome' // Welcher Prozess soll geprüft werden? Ohne .exe eingeben. Prüfen ob Chrome-Browser läuft: chrome
          
          const windowsControlAdapterInstance = 0; // Kann man so lassen, wenn nur eine Instanz läuft.
          
          /**
           * Ruft die eigentliche function getWindowsProcessStatus() auf. Im Callback kann dann darauf reagiert werden.
           */
          getWindowsProcessStatus(0, pcName, checkProcess, function(status, device, process) {
          
              switch (status) {
                  case null:
                      log('Windows-Gerät [' + device + '] ist nicht konfiguriert, nicht erreichbar, oder Prozess-Name ist leer. Prozess-Name: [' + checkProcess + ']');
                      break;
                  case true:
                      log('Windows-Gerät ' + device + ': Der Prozess [' + process + '] läuft.');
                      break;
                  case false:
                      log('Windows-Gerät ' + device + ': Der Prozess [' + process + '] läuft nicht.');
                      break;
                  default:
                      log('Windows-Gerät ' + device + ': Unbekannter Status: [' + status + ']');
              }
          
          });
          
          
          /**
           * Check if process is running
           * For adapter: https://github.com/Mic-M/ioBroker.windows-control
           * Change History: 
           *   Mic-M - 0.0.1 - Initial release
           * 
           * @param {number} inst     Instance of adapter windows-control
           * @param {string} device   Windows device to check
           * @param {string} process  Windows Process to check if running or not (like: "chrome")
           * @param {object} callback
           */
          function getWindowsProcessStatus(inst, device, process, callback) {
              
              if (!existsState('windows-control.' + inst + '.' + device + '._processGetStatus')) {
                  return callback(null, device, process); // State, and so the device, not existing
              } else {
                  setState('windows-control.' + inst + '.' + device + '._processGetStatus', process, function(test) {
                      setTimeout(function(){
                          let result = JSON.parse(getState('windows-control.' + inst + '.' + device + '._processGetStatusResult').val);
                          for (let lpEntry of result) {
                              //({process: whichProcess, status: status, ts: Date.now()});
                              if(lpEntry.process == process) {
                                  if( parseInt(lpEntry.ts)+1000 > Date.now()) { // Check if entry within last 1000ms
                                      if (lpEntry.status == 'true') {
                                          return callback(true, device, process);
                                      } else {
                                          return callback(false, device, process);
                                      }
                                  }
                              }
                          }
                          return callback(null, device, process); // we did not have a hit, so return null;
                      }, 300)
                  });
              }
          }
          
          
          

          Gefällt mir aber noch nicht so gut, da sehr umständlich. Aber zumindest kann man es damit abfragen.

          liv-in-sky 1 Reply Last reply Reply Quote 1
          • liv-in-sky
            liv-in-sky @Mic last edited by

            @Mic ist ja doch die json lösung geworden

            getestet - funktioniert - danke

            falls jmd interesse: für die abfrage und zum triggern ein beispiel in js und blockly, wie man da ran kommt

            log((JSON.parse(getState("windows-control.0.NUC2._processGetStatusResult").val))[0].status)
            

            Image 1.png

            Mic 1 Reply Last reply Reply Quote 0
            • Mic
              Mic Developer @liv-in-sky last edited by

              @liv-in-sky sagte in Test Adapter Windows-Control v0.1.x GitHub:

              ist ja doch die json lösung geworden
              getestet - funktioniert - danke

              Danke fürs testen und dein Script 🙂

              Ja, ich habe mich dann doch für json entschieden, da wohl kaum wer ständig sehen muss (z.B. in VIS), welche Apps auf einem Windows-PC laufen. Das geht am Ziel des Adapters vorbei... Daher nur die Status-Abfrage bei Bedarf.

              1 Reply Last reply Reply Quote 0
              • Bostil
                Bostil last edited by Bostil

                Vielen Dank für den schönen Adapter! @Mic

                Habe es an meinem Stick-PC nun eingerichtet, aber m_hibernate und m_sleep kommen zwar beim GetAdmin an, aber leider tut sich nichts. Andere Befehle funktionieren. Hat jemand eine Idee, ob hier eine Windows-Einstellung am Rechnung die Ausführung verhindern könnte.

                Danke euch.

                Mic 1 Reply Last reply Reply Quote 0
                • Mic
                  Mic Developer @Bostil last edited by

                  @Bostil
                  Danke fürs Testen und dein Feedback 🙂

                  Poste bitte am besten mal einen Screenshot von deinem GetAdmin. Wo läuft dieser denn, auf einem PC/Notebook oder einem anderen Endgerät? Welche Windows-Version?

                  Bostil 1 Reply Last reply Reply Quote 0
                  • Bostil
                    Bostil @Mic last edited by Bostil

                    @Mic Danke für deine Rückmeldung @Mic Habe es wirklich so eingestellt, wie auf den von dir gezeigten Screenshorts, die bei der Einrichtung sowieso sehr hilfreich waren. Ist ja eigentlich idiotensicher. Andere Befehle, wie "poweroff" oder "logoff" funktionieren tadellos.

                    Es scheint eine Einstellung in meinem Windows 10 (aktuelle Version) zu sein. Ist ein "günstiger" Stick-Computer aus China, der nicht viel Power hat, aber gerade so eignet, um den Webbrowser mit der VIS per HDMI auf einem Touchscreen darzustellen.

                    Ich teste mal weiter. Aber Danke dir schonmal.

                    By the way hat der Ursprungsautor des Tools auf deinen Kommentar hin angemerkt, dass er das Tool auch um weitere Ideen / Features erweitern könnte 😉 top !

                    Mic 1 Reply Last reply Reply Quote 0
                    • Mic
                      Mic Developer @Bostil last edited by

                      @Bostil
                      Danke für die Rückinfo.
                      Müsstest tatsächlich mal googlen, welche Befehle da sonst noch gehen. Sobald das über die Kommandozeile (also cmd.exe) geht, sollte das auch in den GetAdmin überführbar sein.

                      @Bostil sagte in Test Adapter Windows-Control v0.1.x GitHub:

                      By the way hat der Ursprungsautor des Tools auf deinen Kommentar hin angemerkt, dass er das Tool auch um weitere Ideen / Features erweitern könnte top !

                      Das ist super 😎 Wir können ja mal sehen, ob noch was zusammen kommt. Das Kontextmenü im Systray z.B. zeigt bei mir nur ????? an, weil ich wohl kyrillisch nicht drauf hab, da wäre wohl auch Englisch besser.

                      1 Reply Last reply Reply Quote 0
                      • SBorg
                        SBorg Forum Testing Most Active last edited by

                        Vorweg: tut was es soll 👍
                        Wunschliste: SSL + Auth (IT ler halt 😉 ), damit die Sicherheitslücke nicht wie ein Scheunentor wirkt
                        Hint: auch Linux lässt sich damit steuern... 😁 😇

                        Mic 1 Reply Last reply Reply Quote 0
                        • Mic
                          Mic Developer @SBorg last edited by

                          @SBorg
                          Danke fürs testen und dein Feedback 🙂

                          Wunschliste: SSL + Auth

                          Da kenne ich mich leider null mit aus. Kennst du da ein handliches (am besten portable) Tool für Windows, was man nutzen könnte, also welches die Commands vom ioBroker empfangen kann?
                          Ich bin da offen, das dann in den Adapter einzubauen...

                          SBorg 1 Reply Last reply Reply Quote 0
                          • SBorg
                            SBorg Forum Testing Most Active @Mic last edited by

                            @Mic Muss ich selbst mal schauen. Ich hatte mir mal ein kleines Tool für Windows geschrieben, aber um von Windows per Knopfdruck andere Rechner/Geräte zu steuern. Aber ev. wäre ja auch Vladimir bereit sein GetAdmin auf zu pimpen...

                            Mic 1 Reply Last reply Reply Quote 0
                            • Mic
                              Mic Developer @SBorg last edited by Mic

                              @SBorg sagte in Test Adapter Windows-Control v0.1.x GitHub:

                              Aber ev. wäre ja auch Vladimir bereit sein GetAdmin auf zu pimpen...

                              Ich sammle das mal für die Liste an Vladimir 🙂

                              @ Alle
                              Kurzes Update:

                              Neue Version 0.1.2

                              Danke noch mal an alle Tester!

                              In der Version 0.1.2 - siehe https://github.com/Mic-M/ioBroker.windows-control - wurden nur ein paar Fixes/Verbesserungen unter der Haube durchgeführt, ansonsten hat sich nichts geändert.

                              Ich bin dabei, den Adapter ins Latest Repository aufnehmen zu lassen. Für die Interessierten hier zum lesen: https://github.com/ioBroker/ioBroker.repositories/pull/678
                              @apollon77 hat mir sehr hilfreiches Feedback gegeben, das ist nun in der 0.1.2 integriert.

                              Mic-M created this issue in ioBroker/ioBroker.repositories

                              closed windows-control added #678

                              1 Reply Last reply Reply Quote 2
                              • Mic
                                Mic Developer last edited by

                                Update-Info:
                                Der Adapter ist nun im Latest Repository - (merged #678 into master)

                                1 Reply Last reply Reply Quote 2
                                • surfer09
                                  surfer09 last edited by

                                  Hallo zusammen,

                                  ich fände es noch gut, wenn man aktive Prozesse damit abfragen könnte. Ich weiß nicht, ob das schon auf der Entwicklungs-Agenda steht?
                                  Ich habe nämlich Systeme am laufen, bei denen bestimmte Programme im Hintergrund aktiv sein müssen. Sind sie das nicht, hätte ich gerne eine Meldung, damit ich reagieren kann.
                                  Ansonsten super Adapter! 🙂

                                  liv-in-sky 1 Reply Last reply Reply Quote 0
                                  • liv-in-sky
                                    liv-in-sky @surfer09 last edited by

                                    @surfer09 meinst du das hier ?

                                    https://forum.iobroker.net/post/401300

                                    surfer09 1 Reply Last reply Reply Quote 0
                                    • Kalle Blomquist
                                      Kalle Blomquist @Mic last edited by

                                      @Mic Klasse gemacht. Danke! Läuft bestens.
                                      Gruß
                                      Kalle

                                      Mic 1 Reply Last reply Reply Quote 0
                                      • Mic
                                        Mic Developer @Kalle Blomquist last edited by

                                        @47kohm sagte in Test Adapter Windows-Control v0.1.x GitHub:

                                        @Mic Klasse gemacht. Danke! Läuft bestens.
                                        Gruß
                                        Kalle

                                        Cool, danke für dein Feedback.

                                        Der Adapter ist jetzt eigentlich auch soweit, um ins Stable Repository zu schieben ☺
                                        Keine Fehler soweit, läuft stabil auch lt. all den User-Rückmeldungen, bei mir eh schon seit Tagen stabil, usw.

                                        Ich werde das die Tage anstoßen.

                                        1 Reply Last reply Reply Quote 0
                                        • sigi234
                                          sigi234 Forum Testing Most Active @Mic last edited by

                                          @Mic

                                          Teste gerade, Cooler Adapter.

                                          Habe js-controller 3.0.10 Beta , da kommt diese Warn:

                                          windows-control.0	2020-04-15 22:07:50.768	warn	(740) This value will not be set in future versions. Please report this to the developer.
                                          windows-control.0	2020-04-15 22:07:50.768	warn	(740) State value to set is invalid for windows-control.0.Medion.logoff: The state is missing the required property val!
                                          windows-control.0	2020-04-15 21:54:20.234	warn	(740) This value will not be set in future versions. Please report this to the developer.
                                          windows-control.0	2020-04-15 21:54:20.233	warn	(740) State value to set is invalid for windows-control.0.Medion.process: The state is missing the required property val!
                                          
                                          Mic 1 Reply Last reply Reply Quote 0
                                          • Mic
                                            Mic Developer @sigi234 last edited by Mic

                                            @sigi234

                                            Danke, auf Github bereits behoben (noch nicht hoch-revisioniert).

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            973
                                            Online

                                            31.6k
                                            Users

                                            79.4k
                                            Topics

                                            1.3m
                                            Posts

                                            adapter control getadmin tester windows windows-control
                                            27
                                            211
                                            22740
                                            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