Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Tester
    4. Test Adapter HAM 5.2.0 (GitHub)

    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

    Test Adapter HAM 5.2.0 (GitHub)

    This topic has been deleted. Only users with topic management privileges can see it.
    • iPhilBln
      iPhilBln @apollon77 last edited by iPhilBln

      @apollon77 ja bin mir da absolut sicher.
      Ich bearbeite die über VS Code mit nem ssh Zugang.

      Dein Wrapper Modul lädt die Module unter folgendem Pfad:
      /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-xiaomi-fan

      Die index.js sieht aktuell wie folgt aus:

       /*----------========== HOMEBRIDGE STATE SETTERS/GETTERS ==========----------*/
      
        getPowerState(callback) {
          let isFanOn = false;
          if (this.fanDevice && this.fanDevice.isFanConnected()) {
            isFanOn = this.fanDevice.isPowerOn();
          }
          this.logInfo(`DEBUG: getPowerState() -> Callback: ${isFanOn}`);
          callback(null, isFanOn ? Characteristic.Active.ACTIVE : Characteristic.Active.INACTIVE);
        }
      
        setPowerState(state, callback) {
          this.logInfo(`DEBUG: setPowerState() -> value: ${state}`);
          if (this.fanDevice && this.fanDevice.isFanConnected()) {
            let isPowerOn = state === Characteristic.Active.ACTIVE;
            // only fire the setPowerOn method when we want to turn off the fan or the fan is off
            // the rotaion speed slider fires this method many times even when the fan is already on so i need to limit that
            if (isPowerOn === false || this.fanDevice.isPowerOn() === false) {
              this.fanDevice.setPowerOn(isPowerOn);
            }
            this.logInfo(`DEBUG: setPowerState() -> Callback: ${isPowerOn}`);
            callback();
          } else {
            this.logInfo(`DEBUG: setPowerState() -> Callback: cannot set power state`);
            callback(this.createError(`cannot set power state`));
          }
        }
      
        getFanState(callback) {
          let fanState = Characteristic.CurrentFanState.INACTIVE;
          if (this.fanDevice && this.fanDevice.isFanConnected()) {
            fanState = this.fanDevice.isPowerOn() ? Characteristic.CurrentFanState.BLOWING_AIR : Characteristic.CurrentFanState.IDLE
          }
          this.logInfo(`DEBUG: getFanState() -> Callback: ${fanState}`);
          callback(null, fanState);
        }
      
        getRotationSpeed(callback) {
          let fanRotationSpeed = 0;
          if (this.fanDevice && this.fanDevice.isFanConnected()) {
            fanRotationSpeed = this.fanDevice.getRotationSpeed();
            fanRotationSpeed = this.adjustToPercentageRange(fanRotationSpeed);
          }
          this.logInfo(`DEBUG: getRotationSpeed() -> Callback: ${fanRotationSpeed}`);
          callback(null, fanRotationSpeed);
        }
      
        setRotationSpeed(value, callback) {
          this.logInfo(`DEBUG: setRotationSpeed() -> value: ${value}`);
          if (this.fanDevice && this.fanDevice.isFanConnected()) {
            // use debounce to limit the number of calls when the user slides the rotation slider
            if (this.rotationSpeedTimeout) clearTimeout(this.rotationSpeedTimeout);
            this.rotationSpeedTimeout = setTimeout(() => this.fanDevice.setRotationSpeed(value), 500);
            this.logInfo(`DEBUG: setRotationSpeed() -> Callback: ${value}`);
            callback();
          } else {
            this.logInfo(`DEBUG: setRotationSpeed() -> Callback: cannot set rotation speed`);
            callback(this.createError(`cannot set rotation speed`));
          }
        }
      

      Hab es eben nochmal über das Terminal kontrolliert dass auch die richtige index.js editiert wird in VS Code.

      Ich logge mit folgendem Befehl:
      tail -f /opt/iobroker/log/iobroker.current.log | grep ham.0 > ham.log

      Danach kopiere ich es rüber auf meine Mac mit dem Befehl:
      scp ham.log philippmielke@10.0.10.4:/Users/philippmielke/Desktop/ham.log

      Im Log steht dann folgendes:
      states können gesetzt werden: ham.log.zip
      states können NICHT gesetzt werden: ham_kaputt.log.zip

      apollon77 1 Reply Last reply Reply Quote 0
      • apollon77
        apollon77 @iPhilBln last edited by

        @iphilbln sagte in Test Adapter HAM 5.2.0 (GitHub):

        DEBUG:

        Hm ... haste mal nach "DEBUG: set" gegreppt in dem File ... da ist was drin

        2022-09-14 13:25:00.723 - debug: ham.0 (111330) [9/14/2022, 1:25:00 PM] [xiaomifan] [Standventilator] DEBUG: setPowerState() -> value: 0
        2022-09-14 13:25:31.921 - debug: ham.0 (111330) [9/14/2022, 1:25:31 PM] [xiaomifan] [Standventilator] DEBUG: setRotationSpeed() -> value: 30

        ... ... ...

        Gefühlt sendet der das nur raus wenn das gerät auch an ist ...

        iPhilBln 1 Reply Last reply Reply Quote 0
        • iPhilBln
          iPhilBln @apollon77 last edited by

          @apollon77 du kannst dir das logfile auch einfach in den Chrome Browser ziehen und dann nach Begriffen durchsuchen. So mach ich das aktuell.

          14dcb28c-d38b-4b53-be08-d128bfc57406-image.png

          rechts wird einem auch angezeigt wo er die Begriffe gefunden hat. Finde ich recht praktisch.

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

            Ok, dann hoffe ich das die 5.2.3 jetzt endgültig alle Issues löst 🙂

            Fabio iPhilBln 2 Replies Last reply Reply Quote 1
            • Fabio
              Fabio @apollon77 last edited by

              @apollon77 Guten Morgen,
              musste nur noch im Ham Adapter von homebridge-tahoma@2.241 auf homebridge-tahoma ändern.
              Alles läuft sehr gut, keine Fehler Daten werden alle empfangen.👍

              apollon77 1 Reply Last reply Reply Quote 0
              • apollon77
                apollon77 @Fabio last edited by

                @fa-bio Die "Gefahr" wenn Du es ohne Version angibst ist halt das pot der Start des Adapters wieder ein update installiert und was nicht geht ... als vorsichtig sein

                Fabio 1 Reply Last reply Reply Quote 1
                • Fabio
                  Fabio @apollon77 last edited by

                  @apollon77 ja das dachte ich auch, aber als ich den Ham Adapter heute morgen aktualisiert habe, hat er im Log ein Fehler ausgeben wegen der Version Angabe. Dadurch konnte ich dann die Markisen nicht steuern, also habe ich dann die Version Angabe entfernt und dann funktionierte alles wieder wie immer.

                  apollon77 1 Reply Last reply Reply Quote 0
                  • apollon77
                    apollon77 @Fabio last edited by

                    @fa-bio haste den Fehler noch? Log is ja unter /opt/iobroker/log/...

                    Fabio 1 Reply Last reply Reply Quote 0
                    • Fabio
                      Fabio @apollon77 last edited by

                      @apollon77 nein leider gelöscht. Jetzt steht da auch wieder von alleine die Version mit drin drin. ham.jpg

                      apollon77 1 Reply Last reply Reply Quote 0
                      • iPhilBln
                        iPhilBln @apollon77 last edited by

                        @apollon77 hier wie versprochen mein Feedback zur Race condition:

                        Adapter abonniert jetzt zuverlässig die states. 👍
                        Was mich irritiert hat, dass wenn in der config.JSON des Geräts die einzelnen Optionen auf false stehen und man den Datenpunkt im iobroker steuern möchte weil er noch aus einer älteren config existiert, führt das zum Absturz des ham Adapters. Soll heißen, es existieren Datenpunkte im iobroker die zum Absturz des Adapters führen wenn sie auf false in der config stehen.
                        Ansonsten funktioniert jetzt aber alles einwandfrei. Nochmals riesen Dank.

                        apollon77 1 Reply Last reply Reply Quote 0
                        • apollon77
                          apollon77 @Fabio last edited by

                          @fa-bio Hm ... aber von alleine tut sie das nicht wirklich ... strange. Naja hauptsache es geht

                          Fabio 2 Replies Last reply Reply Quote 0
                          • apollon77
                            apollon77 @iPhilBln last edited by

                            @iphilbln Wie sieht denn der Absturz aus? Bitte mal error log posten ... das sollte an sich nicht passieren ...

                            iPhilBln 1 Reply Last reply Reply Quote 0
                            • iPhilBln
                              iPhilBln @apollon77 last edited by

                              @apollon77 Schick ich dir wenn ich von der Arbeit zurück bin.

                              apollon77 1 Reply Last reply Reply Quote 1
                              • Fabio
                                Fabio @apollon77 last edited by

                                @apollon77 was soll ich dir sagen so war es aber.🤔

                                1 Reply Last reply Reply Quote 0
                                • apollon77
                                  apollon77 @iPhilBln last edited by apollon77

                                  @iphilbln Ahhh ... habs lokal mal getestet ... denke wenn du heim kommst hste ne 5.2.4 🙂

                                  ETA für 5.2.4 ca. 20-30Mins (die automatisierten tests dauern eewewig)

                                  iPhilBln 1 Reply Last reply Reply Quote 1
                                  • Fabio
                                    Fabio @apollon77 last edited by

                                    @apollon77 so hab es jetzt mal auf meinem Reservesytem gemacht er macht das alles von ganz alleine egal welche Version ich vorher angeben hatte.

                                    
                                    ham.0
                                    2022-09-15 09:01:50.845	info	Adapter uses Wrapper mode
                                    
                                    ham.0
                                    2022-09-15 09:01:50.843	info	All Libraries installed/updated
                                    
                                    ham.0
                                    2022-09-15 09:01:50.801	info	found 0 vulnerabilities
                                    
                                    ham.0
                                    2022-09-15 09:01:50.796	info	run `npm fund` for details
                                    
                                    ham.0
                                    2022-09-15 09:01:50.793	info	18 packages are looking for funding
                                    
                                    ham.0
                                    2022-09-15 09:01:50.792	info	
                                    
                                    ham.0
                                    2022-09-15 09:01:50.788	info	added 75 packages, and audited 76 packages in 1m
                                    
                                    ham.0
                                    2022-09-15 09:00:47.803	info	npm install homebridge-tahoma@2.2.28 --production --loglevel error (System call)
                                    
                                    ham.0
                                    2022-09-15 09:00:47.801	info	Install/Update homebridge-tahoma@2.2.28
                                    
                                    ham.0
                                    2022-09-15 09:00:47.799	info	Install/Update the following Libraries: homebridge-tahoma@2.2.28
                                    
                                    ham.0
                                    2022-09-15 09:00:47.762	info	starting. Version 5.2.3 (non-npm: ioBroker/ioBroker.ham) in /opt/iobroker/node_modules/iobroker.ham, node: v16.17.0, js-controller: 4.0.23
                                    
                                    apollon77 1 Reply Last reply Reply Quote 0
                                    • apollon77
                                      apollon77 @Fabio last edited by

                                      @fa-bio sagte in Test Adapter HAM 5.2.0 (GitHub):

                                      2022-09-15 09:00:47.799 info Install/Update the following Libraries: homebridge-tahoma@2.2.28

                                      ALso laut dem steht in der konfig diese version

                                      Fabio 1 Reply Last reply Reply Quote 0
                                      • Fabio
                                        Fabio @apollon77 last edited by

                                        @apollon77 ja korrekt hab es gerade geprüft. Kann laut Ham Adapter jetzt auf Version 2.2.41 gehen. Schon komisch

                                        apollon77 1 Reply Last reply Reply Quote 0
                                        • apollon77
                                          apollon77 @Fabio last edited by

                                          @fa-bio Zeig mal die Konfig nochmal vom Adapter bitte

                                          Fabio 1 Reply Last reply Reply Quote 0
                                          • Fabio
                                            Fabio @apollon77 last edited by Fabio

                                            @apollon77 ```
                                            {
                                            "bridge": {
                                            "name": "somfy connectivity kit",
                                            "username": "xxxxx",
                                            "pin": "xxxxx"
                                            },
                                            "description": "...",
                                            "accessories": [],
                                            "platforms": [
                                            {
                                            "platform": "Tahoma",
                                            "name": "My Tahoma Bridge",
                                            "user": "xxxx@xxxxx",
                                            "password": "xxxx",
                                            "service": "tahoma",
                                            "exclude": [
                                            "rts"
                                            ]
                                            }
                                            ]
                                            }

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            777
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            10
                                            93
                                            7092
                                            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