Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Osram Lightyfy Adapter Problem

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    UNSOLVED Osram Lightyfy Adapter Problem

    This topic has been deleted. Only users with topic management privileges can see it.
    • Asgothian
      Asgothian Developer @Torsten Bahlert last edited by

      @Torsten-Bahlert
      JS hat meines Wissens nach nur einen "number" Datentyp, es gibt keine Unterscheidung zwischen float und int. Deswegen wuerde ich mit

      var cnt = data.readUInt8(Math.floor(pos + 0.5) + 16);
      

      arbeiten.

      Das +0.5 dient dazu sauber zu runden, wenn das nicht gewünscht ist reicht auch Math.floor(pos).

      A.

      Torsten Bahlert 1 Reply Last reply Reply Quote 0
      • Torsten Bahlert
        Torsten Bahlert @Asgothian last edited by

        @Asgothian
        OK, danke für die Antwort.
        Ich bin da kein Experte. Mir ist nur aufgefallen, dass ein Integerwert erwartet wird und deswegen habe ich das mal mit ~~ ausprobiert.
        Ich werde deine Lösung mal ausprobieren.

        Das ist natürlich auch nur ein Workaround, denn man müsste sich eigentlich die Frage stellen, warum der Wert der Variable 'pos' nicht wie erwartet ein Integerwert ist?

        Ich habe mich oben vielleicht etwas falsch ausgedrückt:
        ~~ dient natürlich nicht dazu Fließkommazahlen in Integer umzuwandeln, sondern es hat nur den Effekt.
        (Werde ich korrigieren)

        Asgothian 1 Reply Last reply Reply Quote 0
        • Asgothian
          Asgothian Developer @Torsten Bahlert last edited by

          @Torsten-Bahlert sagte in Osram Lightyfy Adapter Problem:

          @Asgothian

          Das ist natürlich auch nur ein Workaround, denn man müsste sich eigentlich die Frage stellen, warum der Wert der Variable 'pos' nicht wie erwartet ein Integerwert ist?

          klar. Die Frage ist zu stellen. Allerdings ist es denkbar das intern eine Berechnung durchgeführt wird die

          • nicht korrekt gerundet wird
          • in deinem speziellen Fall halt keinen Ganzzahl wert liefert.

          Ich denke es macht immer Sinn berechnete Indices vor der Benutzung zu runden.

          A.

          1 Reply Last reply Reply Quote 0
          • hg6806
            hg6806 Most Active last edited by

            Hallo zusammen,

            bin gerade auf den Thread gestoßen, denn ich habe auch Probleme mit dem Lightify Adapter und Node 10.
            Beide Workarounds funktionieren leider nicht.
            Gibt es hier noch weitere Lösungsansätze?

            Asgothian 1 Reply Last reply Reply Quote 0
            • Asgothian
              Asgothian Developer @hg6806 last edited by

              @hg6806

              Nur den allgemeinen:

              Fehlermeldung posten, schauen was die Ursache ist, abstellen (lassen)

              A.

              1 Reply Last reply Reply Quote 0
              • hg6806
                hg6806 Most Active last edited by

                OK, hatte immer folgendes Problem:

                host.rock64	2019-08-28 22:04:52.979	error	instance system.adapter.lightify.0 terminated with code 0 (OK)
                host.rock64	2019-08-28 22:04:52.979	error	Caught by controller[0]: at Socket.Readable.push (_stream_readable.js:224:10)
                host.rock64	2019-08-28 22:04:52.979	error	Caught by controller[0]: at readableAddChunk (_stream_readable.js:269:11)
                host.rock64	2019-08-28 22:04:52.979	error	Caught by controller[0]: at addChunk (_stream_readable.js:288:12)
                host.rock64	2019-08-28 22:04:52.978	error	Caught by controller[0]: at Socket.emit (events.js:198:13)
                host.rock64	2019-08-28 22:04:52.978	error	Caught by controller[0]: at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:151:18)
                host.rock64	2019-08-28 22:04:52.978	error	Caught by controller[0]: at lightify.onData (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:173:18)
                host.rock64	2019-08-28 22:04:52.978	error	Caught by controller[0]: at lightify.processData (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:116:32)
                host.rock64	2019-08-28 22:04:52.978	error	Caught by controller[0]: at Object.cb (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:463:28)
                host.rock64	2019-08-28 22:04:52.978	error	Caught by controller[0]: at Uint8Array.readUInt8 (internal/buffer.js:137:5)
                host.rock64	2019-08-28 22:04:52.977	error	Caught by controller[0]: at boundsError (internal/buffer.js:43:11)
                host.rock64	2019-08-28 22:04:52.977	error	Caught by controller[0]: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be an integer. Received 43.33333333333333
                lightify.0	2019-08-28 22:04:52.914	error	RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be an integer. Received 43.33333333333333 at boundsError (internal/buffer.js:43:11) at Uint8Array.readUInt8 (inter
                lightify.0	2019-08-28 22:04:52.910	error	uncaught exception: The value of "offset" is out of range. It must be an integer. Received 43.33333333333333
                lightify.0	2019-08-28 22:04:52.015	info	starting. Version 0.2.16 in /opt/iobroker/node_modules/iobroker.lightify, node: v10.16.2
                javascript.0	2019-08-28 22:04:51.587	info	script.js.common.Stromverbrauch.Strom_Zaehlerstaende_Verbrauch_Kosten: Fehler beim Auslesen des Datums. Eventuell falsche Syntax? null (Error:TypeError: Cannot read property 'match' of null)
                smartmeter.0	2019-08-28 22:04:51.322	info	Received 10 values, 3 updated
                host.rock64	2019-08-28 22:04:49.487	info	instance system.adapter.lightify.0 started with pid 30091
                host.rock64	2019-08-28 22:04:49.436	info	object change system.adapter.lightify.0
                host.rock64	2019-08-28 22:04:48.380	info	instance system.adapter.lightify.0 terminated with code 0 (OK)
                Caught	2019-08-28 22:04:48.380	error	by controller[0]: at Socket.Readable.push (_stream_readable.js:224:10)
                Caught	2019-08-28 22:04:48.380	error	by controller[0]: at readableAddChunk (_stream_readable.js:269:11)
                Caught	2019-08-28 22:04:48.379	error	by controller[0]: at addChunk (_stream_readable.js:288:12)
                Caught	2019-08-28 22:04:48.379	error	by controller[0]: at Socket.emit (events.js:198:13)
                Caught	2019-08-28 22:04:48.379	error	by controller[0]: at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:151:18)
                Caught	2019-08-28 22:04:48.379	error	by controller[0]: at lightify.onData (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:173:18)
                Caught	2019-08-28 22:04:48.379	error	by controller[0]: at lightify.processData (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:116:32)
                Caught	2019-08-28 22:04:48.379	error	by controller[0]: at Object.cb (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:463:28)
                Caught	2019-08-28 22:04:48.379	error	by controller[0]: at Uint8Array.readUInt8 (internal/buffer.js:137:5)
                Caught	2019-08-28 22:04:48.379	error	by controller[0]: at boundsError (internal/buffer.js:43:11)
                Caught	2019-08-28 22:04:48.379	error	by controller[0]: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be an integer. Received 43.33333333333333
                host.rock64	2019-08-28 22:04:48.307	info	stopInstance system.adapter.lightify.0 killing pid 30076
                host.rock64	2019-08-28 22:04:48.307	info	stopInstance system.adapter.lightify.0
                host.rock64	2019-08-28 22:04:48.306	info	object change system.adapter.lightify.0
                lightify.0	2019-08-28 22:04:48.297	info	terminating
                lightify.0	2019-08-28 22:04:48.268	error	at Socket.Readable.push (_stream_readable.js:224:10)
                lightify.0	2019-08-28 22:04:48.268	error	at readableAddChunk (_stream_readable.js:269:11)
                lightify.0	2019-08-28 22:04:48.268	error	at addChunk (_stream_readable.js:288:12)
                lightify.0	2019-08-28 22:04:48.268	error	at Socket.emit (events.js:198:13)
                lightify.0	2019-08-28 22:04:48.268	error	at Socket.<anonymous> (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:151:18)
                lightify.0	2019-08-28 22:04:48.268	error	at lightify.onData (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:173:18)
                lightify.0	2019-08-28 22:04:48.268	error	at lightify.processData (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:116:32)
                lightify.0	2019-08-28 22:04:48.268	error	at Object.cb (/opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js:463:28)
                lightify.0	2019-08-28 22:04:48.268	error	at Uint8Array.readUInt8 (internal/buffer.js:137:5)
                lightify.0	2019-08-28 22:04:48.268	error	at boundsError (internal/buffer.js:43:11)
                lightify.0	2019-08-28 22:04:48.268	error	RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be an integer. Received 43.33333333333333
                lightify.0	2019-08-28 22:04:48.256	error	uncaught exception: The value of "offset" is out of range. It must be an integer. Received 43.33333333333333
                lightify.0	2019-08-28 22:04:47.260	info	starting. Version 0.2.16 in /opt/iobroker/node_modules/iobroker.lightify, node: v10.16.2
                

                Nachdem ich dann von dir die Zeile 463 wie folgt geändert hatte:

                var cnt = data.readUInt8(Math.floor(pos + 0.5) + 16);
                

                erhalte ich nun:

                lightify.0	2019-10-16 10:48:18.149	error	at process._tickCallback (internal/process/next_tick.js:68:7)
                lightify.0	2019-10-16 10:48:18.149	error	at promise.then (/opt/iobroker/node_modules/standard-as-callback/built/index.js:19:49)
                lightify.0	2019-10-16 10:48:18.149	error	at tryCatcher (/opt/iobroker/node_modules/standard-as-callback/built/utils.js:11:23)
                lightify.0	2019-10-16 10:48:18.149	error	at (anonymous function).(anonymous function)._0x2f5fa7 (/opt/iobroker/node_modules/iobroker.objects-redis/index.js:17:72663)
                lightify.0	2019-10-16 10:48:18.149	error	at /opt/iobroker/node_modules/soef/soef.js:609:26
                lightify.0	2019-10-16 10:48:18.149	error	at Devices.setState (/opt/iobroker/node_modules/soef/soef.js:642:36)
                lightify.0	2019-10-16 10:48:18.149	error	(6129) TypeError: Cannot read property 'val' of undefined
                lightify.0	2019-10-16 10:48:18.147	error	(6129) uncaught exception: Cannot read property 'val' of undefined
                lightify.0	2019-10-16 10:48:17.470	info	(6129) starting. Version 0.2.16 in /opt/iobroker/node_modules/iobroker.lightify, node: v10.16.3
                ```#
                Asgothian 1 Reply Last reply Reply Quote 0
                • hg6806
                  hg6806 Most Active last edited by

                  Hallo nochmal,

                  kann hier jemand was dazu sagen, wie ich den Fehler abstellen kann?

                  H 1 Reply Last reply Reply Quote 0
                  • H
                    HeliosFan @hg6806 last edited by

                    @hg6806
                    Osram Bridge rauschschmeissen, durch Hue Bridge ersetzen. 😁 😁 😁

                    1 Reply Last reply Reply Quote 0
                    • Asgothian
                      Asgothian Developer @hg6806 last edited by

                      @hg6806 hier muss der Adapterentwickler ran. Es wird auf eine nicht korrekt mit Info gefüllten Variable zugegriffen.

                      Eine Lösung ohne im Detail den Adapter zu debuggen wird schwer zu finden sein.

                      A.

                      1 Reply Last reply Reply Quote 0
                      • hg6806
                        hg6806 Most Active last edited by

                        Hat doch funktioniert.
                        Keine Ahnung warum jetzt erst. Vielleicht nach einem Reboot oder so.

                        Auf jeden Fall funktioniert es mit dem Ändern der Zeile 463 in

                                    var cnt = data.readUInt8(Math.floor(pos + 0.5) + 16);
                        
                        

                        Endlich....eine Baustelle weniger und Frau ist auch happy 🙂

                        Asgothian 1 Reply Last reply Reply Quote 0
                        • Asgothian
                          Asgothian Developer @hg6806 last edited by

                          @hg6806 Hattest du ein Upload gemacht nachdem du die Zeile angepasst hast ?

                          A.

                          1 Reply Last reply Reply Quote 0
                          • hg6806
                            hg6806 Most Active last edited by

                            Glaube hatte ich nicht getan...

                            1 Reply Last reply Reply Quote 0
                            • A
                              AgentLibelle last edited by

                              Hallo an alle,

                              habe seit einigen Tagen auch diesen Fehler in meinem System. Zufällig habe ich dann diesen Thread gefunden und war direkt froh, dass dieser auch noch "lebt". Auf dem Adapter "Osram Ligtify" liegt mittlerweile auch viel Staub.....
                              IOBroker läuft bei mir in einem Hyper-V Container, Betriebssystem CentOS, seit ein paar Monaten keine Updates durchgeführt. Nach allen möglichen Updates verbindet sich der Adapter Osram nicht mehr.

                              Also habe ich einen weiteren Container für IOBroker eingerichtet, um den Osram Adapter alleine laufen zu lassen und Fehler zu suchen.

                              Das Workaround habe ich versucht, ohne Erfolg....

                              /opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js        ///   Zeile 463 modifizieren
                              
                              var cnt = data.readUInt8(Math.floor(pos + 0.5) + 16);
                              

                              Wird jemand aus den Angaben meines LOGs schlau?

                              undefined2019-11-28 13:30:12.110 - info: host.iobroker "system.adapter.lightify.0" enabled
                              2019-11-28 13:30:12.121 - info: host.iobroker instance system.adapter.lightify.0 started with pid 2405
                              2019-11-28 13:30:12.403 - info: lightify.0 (2405) starting. Version 0.2.16 in /opt/iobroker/node_modules/iobroker.lightify, node: v10.17.0
                              2019-11-28 13:30:12.956 - error: lightify.0 (2405) uncaught exception: Cannot read property 'val' of undefined
                              2019-11-28 13:30:12.956 - error: lightify.0 (2405) TypeError: Cannot read property 'val' of undefined
                              at Devices.setState (/opt/iobroker/node_modules/soef/soef.js:642:36)
                              at /opt/iobroker/node_modules/soef/soef.js:609:26
                              at (anonymous function).(anonymous function)._0x344e03 (/opt/iobroker/node_modules/iobroker.objects-redis/index.js:17:77549)
                              at tryCatcher (/opt/iobroker/node_modules/standard-as-callback/built/utils.js:11:23)
                              at promise.then (/opt/iobroker/node_modules/standard-as-callback/built/index.js:19:49)
                              at process._tickCallback (internal/process/next_tick.js:68:7)
                              2019-11-28 13:30:12.961 - info: lightify.0 (2405) terminating
                              2019-11-28 13:30:12.961 - info: lightify.0 (2405) Terminated (NO_ERROR): Without reason
                              2019-11-28 13:30:13.465 - error: host.iobroker Caught by controller[0]: TypeError: Cannot read property 'val' of undefined
                              2019-11-28 13:30:13.465 - error: host.iobroker Caught by controller[0]: at Devices.setState (/opt/iobroker/node_modules/soef/soef.js:642:36)
                              2019-11-28 13:30:13.465 - error: host.iobroker Caught by controller[0]: at /opt/iobroker/node_modules/soef/soef.js:609:26
                              2019-11-28 13:30:13.465 - error: host.iobroker Caught by controller[0]: at (anonymous function).(anonymous function)._0x344e03 (/opt/iobroker/node_modules/iobroker.objects-redis/index.js:17:77549)
                              2019-11-28 13:30:13.465 - error: host.iobroker Caught by controller[0]: at tryCatcher (/opt/iobroker/node_modules/standard-as-callback/built/utils.js:11:23)
                              2019-11-28 13:30:13.465 - error: host.iobroker Caught by controller[0]: at promise.then (/opt/iobroker/node_modules/standard-as-callback/built/index.js:19:49)
                              2019-11-28 13:30:13.465 - error: host.iobroker Caught by controller[0]: at process._tickCallback (internal/process/next_tick.js:68:7)
                              2019-11-28 13:30:13.465 - info: host.iobroker instance system.adapter.lightify.0 terminated with code 0 (NO_ERROR)
                              2019-11-28 13:30:13.465 - info: host.iobroker Restart adapter system.adapter.lightify.0 because enabled
                              2019-11-28 13:30:15.664 - info: host.iobroker "system.adapter.lightify.0" disabled
                              
                              Asgothian 1 Reply Last reply Reply Quote 0
                              • Asgothian
                                Asgothian Developer @AgentLibelle last edited by

                                @AgentLibelle
                                Es scheint so das in einer Bibliothek ein umgesetzter Wert nicht abgefangen wird. Das im Detail zu finden ist nicht einfach, insbesondere weil ich den Adapter selber nicht laufen lassen kann - ich hab die Hardware nicht.

                                Du kannst versuchen im Modul soef in der Datei /opt/iobroker/node_modules/soef/soef.js folgende Anpassung vornehmen:

                                this.setState = function (o, id, val, ack) {
                                  if (val !== undefined) objects[id].val = val
                                

                                zu

                                this.setState = function (o, id, val, ack) {
                                  if (objects[id] == undefined) return;
                                  if (val !== undefined) objects[id].val = val
                                

                                ändern.

                                Alles auf eigene Gefahr.

                                A.

                                1 Reply Last reply Reply Quote 0
                                • M
                                  Marc-Nied last edited by Marc-Nied

                                  Das Problem besteht bei mir auch. Vor Wochen hatte die Anpassung "var cnt = data.readUInt8(~~pos + 16);" mal geholfen aber nach der heutigen Neuinstallation, klappt keine von den Lösungen. Hat jemand Kontakt zum Adapter Entwickler und kann mal darauf hinweisen?

                                  @soef Der Adapter war doch von dir, oder? Kannst du uns vielleicht helfen?

                                  1 Reply Last reply Reply Quote 0
                                  • F
                                    fischmir last edited by fischmir

                                    Gleiches Problem hier:

                                    host.ioBroker-Pi	2019-12-11 10:21:00.024	info	instance system.adapter.dwd.0 started with pid 29168
                                    host.ioBroker-Pi	2019-12-11 10:20:57.495	info	Restart adapter system.adapter.lightify.0 because enabled
                                    host.ioBroker-Pi	2019-12-11 10:20:57.495	info	instance system.adapter.lightify.0 terminated with code 0 (NO_ERROR)
                                    host.ioBroker-Pi	2019-12-11 10:20:57.495	error	Caught by controller[0]: at process._tickCallback (internal/process/next_tick.js:68:7)
                                    host.ioBroker-Pi	2019-12-11 10:20:57.494	error	Caught by controller[0]: at promise.then (/opt/iobroker/node_modules/standard-as-callback/built/index.js:19:49)
                                    host.ioBroker-Pi	2019-12-11 10:20:57.494	error	Caught by controller[0]: at tryCatcher (/opt/iobroker/node_modules/standard-as-callback/built/utils.js:11:23)
                                    host.ioBroker-Pi	2019-12-11 10:20:57.494	error	Caught by controller[0]: at client.set.err (/opt/iobroker/node_modules/iobroker.js-controller/lib/objects/objectsInRedis.js:2044:51)
                                    host.ioBroker-Pi	2019-12-11 10:20:57.494	error	Caught by controller[0]: at /opt/iobroker/node_modules/soef/soef.js:609:26
                                    host.ioBroker-Pi	2019-12-11 10:20:57.493	error	Caught by controller[0]: at Devices.setState (/opt/iobroker/node_modules/soef/soef.js:642:36)
                                    host.ioBroker-Pi	2019-12-11 10:20:57.493	error	Caught by controller[0]: TypeError: Cannot read property 'val' of undefined
                                    

                                    Was kann man nun machen?

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      Marc-Nied last edited by

                                      Seit dem heutigen Versuch mit den Anpassungen:

                                      var cnt = data.readUInt8(~~pos + 16);

                                      und

                                      if (objects[id] == undefined) return;

                                      Funktioniert mein Lightify Adapter wieder! Endlich ist das Thema vom Tisch!

                                      F 1 Reply Last reply Reply Quote 0
                                      • F
                                        fischmir @Marc-Nied last edited by

                                        @Marc-Nied
                                        Wie Wo mache ich diese Änderung?

                                        M 1 Reply Last reply Reply Quote 0
                                        • M
                                          Marc-Nied @fischmir last edited by

                                          @fischmir

                                          in der Datei

                                          /opt/iobroker/node_modules/iobroker.lightify/lib/lightify.js

                                          in Zeile 463, in der Datei

                                          sudo nano lightify.js aufrufen und zu der Zeile gehen

                                          Dann Eintrag “var cnt = data.readUInt8(pos + 16);"

                                          in "var cnt = data.readUInt8(~~pos + 16);" ändern und speichern.

                                          Dann noch die Anpassung in der Datei soef

                                          /opt/iobroker/node_modules/soef/soef.js

                                          sudo nano soef.js aufrufen (die Zeile weiß ich nicht, habe es stumpf gesucht) und in diesen Code

                                          this.setState = function (o, id, val, ack) {
                                          if (val !== undefined) objects[id].val = val

                                          ergänzen um if (objects[id] == undefined) return;

                                          Also so muss es gesamt aussehen

                                          this.setState = function (o, id, val, ack) {
                                          if (objects[id] == undefined) return;
                                          if (val !== undefined) objects[id].val = val

                                          Speichern, Linux Reboot und danach Adapter starten und es lief bei mir.

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            struppi_2000 last edited by

                                            der Vorschlag von Marc Nied war klasse die Änderung in Zeile 463 hat geholfen!

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate
                                            FAQ Cloud / IOT
                                            HowTo: Node.js-Update
                                            HowTo: Backup/Restore
                                            Downloads
                                            BLOG

                                            771
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            20
                                            56
                                            4526
                                            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