Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Wie nutze ich eine custom class / npm Modul?

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Wie nutze ich eine custom class / npm Modul?

    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Kentrath @disaster123 last edited by Kentrath

      @disaster123

      Teilweise fehlt die Auswahl von Brightness und Color. Bei den Lampen kommt die Fehlermeldung:

      TypeError: AllDeviceAttributes.ESP21_SHTW_01 is not a function
      
      D 1 Reply Last reply Reply Quote 0
      • D
        disaster123 @Kentrath last edited by

        @kentrath sagte in Wie nutze ich eine custom class / npm Modul?:

        @disaster123

        Teilweise fehlt die Auswahl von Brightness und Color. Bei den Lampen kommt die Fehlermeldung:

        TypeError: AllDeviceAttributes.ESP21_SHTW_01 is not a function
        

        Device ESP21_SHTW_01 war bisher nicht implementiert - bitte einmal Modul updaten. Lampe löschen und speichern. Object im Tree löschen. Lampe wieder hinzufügen.

        K 1 Reply Last reply Reply Quote 1
        • K
          Kentrath @disaster123 last edited by

          @disaster123

          Hat geklappt 😀

          1 Reply Last reply Reply Quote 0
          • K
            Kentrath @disaster123 last edited by

            @disaster123
            Leider kommen die Meldungen

            State "wizconnect.0.192_168_178_121.led.sceneId" has no existing object, this might lead to an error in future versions
            

            auch nach mehreren Neustarts noch und "spammen" mein Protokoll voll. Hast Du eine Idee, wie wir das abstellen könnten? Vielen Dank

            D 1 Reply Last reply Reply Quote 0
            • D
              disaster123 @Kentrath last edited by

              @kentrath am 17.01. hieß es noch - hat geklappt. Jetzt bin ich irritiert. Welche Version nutzt du vom Adapter? Kannst du ein debug log Posten?

              K 1 Reply Last reply Reply Quote 0
              • K
                Kentrath @disaster123 last edited by

                @disaster123
                Der Adapter funktioniert auch mit der Variante ESP21_SHTW_01, das meinte ich mit hat geklappt. Die Fehlermeldungen sind ja eher kosmetik als ein wirkliches Problem. Wäre trotzdem schön, die weg zu bekommen.
                Die Version, die ich benutze, ist die vom 17.01.

                D 1 Reply Last reply Reply Quote 0
                • D
                  disaster123 @Kentrath last edited by

                  @kentrath ah alles klar. Bitte mal updaten auf die aktuelle 0.0.5 von gestern und dann ggf. mal das Debug Log posten.

                  K 1 Reply Last reply Reply Quote 0
                  • K
                    Kentrath @disaster123 last edited by

                    @disaster123
                    Hat leider noch nicht geholfen. Ich habe auch die gesamte Instanz gelöscht und neu gemacht. Die Fehlermeldung kommt nach wie vor (siehe Zeile 2).
                    Wenn ich den Datenpunkt sceneId händisch anlege, dann wird die Meldung ausgegeben, dass string erwartet wird, aber number übermittelt wird. Der Datenpunkt steht aber auf string (siehe Zeile 1).

                    wizconnect.0 2023-01-25 23:09:30.013	info	State value to set for "wizconnect.0.192_168_178_125.led.sceneId" has to be type "string" but received type "number"
                    wizconnect.0 2023-01-25 23:09:05.030	warn	State "wizconnect.0.192_168_178_125.led.sceneId" has no existing object, this might lead to an error in future versions
                    
                    D 1 Reply Last reply Reply Quote 0
                    • D
                      disaster123 @Kentrath last edited by

                      @kentrath wie gesagt ich brauche ein kompletten log mit dem Adapter auf Einstellung debug.

                      K 1 Reply Last reply Reply Quote 0
                      • K
                        Kentrath @disaster123 last edited by

                        @disaster123
                        Da passiert leider so gut wie nichts im log trotz Stufe debug:

                        wizconnect.0
                        2023-01-27 08:41:08.498	info	State value to set for "wizconnect.0.192_168_178_125.led.sceneId" has to be type "string" but received type "number"
                        wizconnect.0
                        2023-01-27 08:41:08.301	info	config udpip: 192.168.178.5
                        wizconnect.0
                        2023-01-27 08:41:08.300	info	config udpmac: 26:8c:05:f2:0c:a9
                        wizconnect.0
                        2023-01-27 08:41:08.300	info	config bind_ip: 0.0.0.0
                        wizconnect.0
                        2023-01-27 08:41:08.289	info	starting. Version 0.0.5 (non-npm: disaster123/ioBroker.wizconnect#ad84f06e2e5e73de575ad53b91c9d7a24d8b9384) in /opt/iobroker/node_modules/iobroker.wizconnect, node: v16.19.0, js-controller: 4.0.24
                        
                        D 1 Reply Last reply Reply Quote 0
                        • D
                          disaster123 @Kentrath last edited by

                          @kentrath Hast du das Loglevel auf debug gesetzt für die Instanz? Das sieht im Log nicht so aus.

                          K 1 Reply Last reply Reply Quote 0
                          • K
                            Kentrath @disaster123 last edited by

                            @disaster123
                            Ja, habe ich.

                            D 1 Reply Last reply Reply Quote 0
                            • D
                              disaster123 @Kentrath last edited by

                              @kentrath Bitte einmal Instanz stoppen. Object 192_168_178_125 im Objekttree unter wizconnect.0 löschen. Dann Adapter wieder starten und debug anlassen.

                              K 1 Reply Last reply Reply Quote 0
                              • K
                                Kentrath @disaster123 last edited by

                                @disaster123

                                wizconnect.0
                                2023-01-27 09:15:42.258	warn	State "wizconnect.0.192_168_178_125.led.sceneId" has no existing object, this might lead to an error in future versions
                                wizconnect.0
                                2023-01-27 09:15:37.347	warn	State "wizconnect.0.192_168_178_125.led.dimming" has no existing object, this might lead to an error in future versions
                                wizconnect.0
                                2023-01-27 09:15:37.347	warn	State "wizconnect.0.192_168_178_125.led.temp" has no existing object, this might lead to an error in future versions
                                wizconnect.0
                                2023-01-27 09:15:37.346	warn	State "wizconnect.0.192_168_178_125.led.sceneId" has no existing object, this might lead to an error in future versions
                                wizconnect.0
                                2023-01-27 09:15:37.110	info	config udpip: 192.168.178.5
                                wizconnect.0
                                2023-01-27 09:15:37.110	info	config udpmac: 26:8c:05:f2:0c:a9
                                wizconnect.0
                                2023-01-27 09:15:37.110	info	config bind_ip: 0.0.0.0
                                wizconnect.0
                                2023-01-27 09:15:37.099	info	starting. Version 0.0.5 (non-npm: disaster123/ioBroker.wizconnect#ad84f06e2e5e73de575ad53b91c9d7a24d8b9384) in /opt/iobroker/node_modules/iobroker.wizconnect, node: v16.19.0, js-controller: 4.0.24
                                host.IoBroker
                                2023-01-27 09:15:36.444	info	instance system.adapter.wizconnect.0 started with pid 3317605
                                host.IoBroker
                                2023-01-27 09:15:36.329	info	"system.adapter.wizconnect.0" enabled
                                
                                D 1 Reply Last reply Reply Quote 0
                                • D
                                  disaster123 @Kentrath last edited by

                                  @kentrath Sorry aber der adapter kan nicht auf debug stehen oder aber du filterst die Einträge in der Logausgabe.

                                  K 1Topf 2 Replies Last reply Reply Quote 0
                                  • K
                                    Kentrath @disaster123 last edited by

                                    @disaster123
                                    Tut mir leid, das Log war tatsächlich gefiltert. Habe ich nicht gesehen 😕

                                    wizconnect.0
                                    2023-01-27 10:14:30.312	warn	State "wizconnect.0.192_168_178_125.led.sceneId" has no existing object, this might lead to an error in future versions
                                    wizconnect.0
                                    2023-01-27 10:14:30.299	debug	Nachricht 83ff1daf-44df-48bf-86eb-9dca0cfde7ff gesendet -> 192.168.178.125 192.168.178.125 Versuch: 1
                                    wizconnect.0
                                    2023-01-27 10:14:00.339	warn	State "wizconnect.0.192_168_178_125.led.sceneId" has no existing object, this might lead to an error in future versions
                                    wizconnect.0
                                    2023-01-27 10:14:00.300	debug	Nachricht 03c2b39f-dcce-4b8c-8a89-62a38256ceb6 gesendet -> 192.168.178.125 192.168.178.125 Versuch: 1
                                    wizconnect.0
                                    2023-01-27 10:14:00.300	debug	Nachricht 286d0001-09e9-4305-9578-fed1a8d7e9ff gesendet -> 192.168.178.125 192.168.178.125 Versuch: 1
                                    wizconnect.0
                                    2023-01-27 10:14:00.299	debug	Nachricht f9922605-4af7-41c2-b87d-89d474ea3f41 gesendet -> 192.168.178.125 192.168.178.125 Versuch: 1
                                    wizconnect.0
                                    2023-01-27 10:14:00.186	debug	-> CREATE DeviceType: EVAL ESP17_SHTW9_01
                                    wizconnect.0
                                    2023-01-27 10:14:00.186	debug	-> CREATE DeviceType: ESP17_SHTW9_01
                                    wizconnect.0
                                    2023-01-27 10:14:00.179	debug	server error:Error: bind EADDRINUSE 0.0.0.0:38900 at node:dgram:359:20 at processTicksAndRejections (node:internal/process/task_queues:84:21)
                                    wizconnect.0
                                    2023-01-27 10:14:00.177	debug	-> CREATE Device: 192_168_178_125
                                    wizconnect.0
                                    2023-01-27 10:14:00.177	debug	__START -> WIZ__INIT_DEVICES [ 192.168.178.125 : Schlafzimmer ]
                                    wizconnect.0
                                    2023-01-27 10:14:00.176	info	config udpip: 192.168.178.5
                                    wizconnect.0
                                    2023-01-27 10:14:00.176	info	config udpmac: 26:8c:05:f2:0c:a9
                                    wizconnect.0
                                    2023-01-27 10:14:00.175	info	config bind_ip: 0.0.0.0
                                    wizconnect.0
                                    2023-01-27 10:14:00.161	info	starting. Version 0.0.5 (non-npm: disaster123/ioBroker.wizconnect#ad84f06e2e5e73de575ad53b91c9d7a24d8b9384) in /opt/iobroker/node_modules/iobroker.wizconnect, node: v16.19.0, js-controller: 4.0.24
                                    wizconnect.0
                                    2023-01-27 10:14:00.050	debug	States connected to redis: 127.0.0.1:9000
                                    wizconnect.0
                                    2023-01-27 10:13:59.991	debug	States create User PubSub Client
                                    wizconnect.0
                                    2023-01-27 10:13:59.991	debug	States create System PubSub Client
                                    wizconnect.0
                                    2023-01-27 10:13:59.982	debug	Redis States: Use Redis connection: 127.0.0.1:9000
                                    wizconnect.0
                                    2023-01-27 10:13:59.966	debug	Objects connected to redis: 127.0.0.1:9001
                                    wizconnect.0
                                    2023-01-27 10:13:59.963	debug	Objects client initialize lua scripts
                                    wizconnect.0
                                    2023-01-27 10:13:59.935	debug	Objects create User PubSub Client
                                    wizconnect.0
                                    2023-01-27 10:13:59.934	debug	Objects create System PubSub Client
                                    wizconnect.0
                                    2023-01-27 10:13:59.934	debug	Objects client ready ... initialize now
                                    wizconnect.0
                                    2023-01-27 10:13:59.911	debug	Redis Objects: Use Redis connection: 127.0.0.1:9001
                                    
                                    D 1 Reply Last reply Reply Quote 0
                                    • 1Topf
                                      1Topf @disaster123 last edited by

                                      @disaster123

                                      Hab mir heut aus Blödsinn eine WIZ-Glühlampe gekauft (OBI Abverkauf 1,94€) und finde auch noch deinen Adapter. Funzt auf Anhieb. Sehr geil. 😀

                                      1 Reply Last reply Reply Quote 1
                                      • D
                                        disaster123 @Kentrath last edited by

                                        @kentrath sagte in Wie nutze ich eine custom class / npm Modul?:

                                        @disaster123
                                        Tut mir leid, das Log war tatsächlich gefiltert. Habe ich nicht gesehen 😕

                                        wizconnect.0
                                        2023-01-27 10:14:30.312	warn	State "wizconnect.0.192_168_178_125.led.sceneId" has no existing object, this might lead to an error in future versions
                                        wizconnect.0
                                        2023-01-27 10:14:30.299	debug	Nachricht 83ff1daf-44df-48bf-86eb-9dca0cfde7ff gesendet -> 192.168.178.125 192.168.178.125 Versuch: 1
                                        wizconnect.0
                                        2023-01-27 10:14:00.339	warn	State "wizconnect.0.192_168_178_125.led.sceneId" has no existing object, this might lead to an error in future versions
                                        wizconnect.0
                                        2023-01-27 10:14:00.300	debug	Nachricht 03c2b39f-dcce-4b8c-8a89-62a38256ceb6 gesendet -> 192.168.178.125 192.168.178.125 Versuch: 1
                                        wizconnect.0
                                        2023-01-27 10:14:00.300	debug	Nachricht 286d0001-09e9-4305-9578-fed1a8d7e9ff gesendet -> 192.168.178.125 192.168.178.125 Versuch: 1
                                        wizconnect.0
                                        2023-01-27 10:14:00.299	debug	Nachricht f9922605-4af7-41c2-b87d-89d474ea3f41 gesendet -> 192.168.178.125 192.168.178.125 Versuch: 1
                                        wizconnect.0
                                        2023-01-27 10:14:00.186	debug	-> CREATE DeviceType: EVAL ESP17_SHTW9_01
                                        wizconnect.0
                                        2023-01-27 10:14:00.186	debug	-> CREATE DeviceType: ESP17_SHTW9_01
                                        wizconnect.0
                                        2023-01-27 10:14:00.179	debug	server error:Error: bind EADDRINUSE 0.0.0.0:38900 at node:dgram:359:20 at processTicksAndRejections (node:internal/process/task_queues:84:21)
                                        wizconnect.0
                                        2023-01-27 10:14:00.177	debug	-> CREATE Device: 192_168_178_125
                                        wizconnect.0
                                        2023-01-27 10:14:00.177	debug	__START -> WIZ__INIT_DEVICES [ 192.168.178.125 : Schlafzimmer ]
                                        wizconnect.0
                                        2023-01-27 10:14:00.176	info	config udpip: 192.168.178.5
                                        wizconnect.0
                                        2023-01-27 10:14:00.176	info	config udpmac: 26:8c:05:f2:0c:a9
                                        wizconnect.0
                                        2023-01-27 10:14:00.175	info	config bind_ip: 0.0.0.0
                                        wizconnect.0
                                        2023-01-27 10:14:00.161	info	starting. Version 0.0.5 (non-npm: disaster123/ioBroker.wizconnect#ad84f06e2e5e73de575ad53b91c9d7a24d8b9384) in /opt/iobroker/node_modules/iobroker.wizconnect, node: v16.19.0, js-controller: 4.0.24
                                        wizconnect.0
                                        2023-01-27 10:14:00.050	debug	States connected to redis: 127.0.0.1:9000
                                        wizconnect.0
                                        2023-01-27 10:13:59.991	debug	States create User PubSub Client
                                        wizconnect.0
                                        2023-01-27 10:13:59.991	debug	States create System PubSub Client
                                        wizconnect.0
                                        2023-01-27 10:13:59.982	debug	Redis States: Use Redis connection: 127.0.0.1:9000
                                        wizconnect.0
                                        2023-01-27 10:13:59.966	debug	Objects connected to redis: 127.0.0.1:9001
                                        wizconnect.0
                                        2023-01-27 10:13:59.963	debug	Objects client initialize lua scripts
                                        wizconnect.0
                                        2023-01-27 10:13:59.935	debug	Objects create User PubSub Client
                                        wizconnect.0
                                        2023-01-27 10:13:59.934	debug	Objects create System PubSub Client
                                        wizconnect.0
                                        2023-01-27 10:13:59.934	debug	Objects client ready ... initialize now
                                        wizconnect.0
                                        2023-01-27 10:13:59.911	debug	Redis Objects: Use Redis connection: 127.0.0.1:9001
                                        

                                        Sorry deine Antwort ist scheinbar untergegangern. Erstes Problem ist, dass laut Log bereits ein anderer Dienst an Port 38900 lauscht. Damit funktioniert der Adapter nicht richtig.

                                        Siehe:

                                        2023-01-27 10:14:00.179	debug	server error:Error: bind EADDRINUSE 0.0.0.0:38900 at node:dgram:359:20 at processTicksAndRejections (node:internal/process/task_queues:84:21)
                                        
                                        
                                        K 1 Reply Last reply Reply Quote 0
                                        • K
                                          Kentrath @disaster123 last edited by

                                          @disaster123

                                          OK, jetzt gibt es aber ein anderes Problem, das vermutlich mit dem Update von node.js zusammen hängt. Der Adapter startet nach dem Hinzufügen eines weiteren Leuchtmittels gar nicht mehr. Auch ein löschen und neu installieren hilft nicht. Ich hätte wirklich gerne mehr Ahnung von der Materie, aber bin da (noch) völlig hilflos 😞
                                          Brauchst Du noch weitere Infos oder hilft das schon einmal? Node.js ist bei mir v16.19.0

                                          host.IoBroker
                                          2023-02-21 11:49:54.769	warn	adapter "wizconnect" seems to be installed for a different version of Node.js. Trying to rebuild it... 3 attempt
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	info	system.adapter.wizconnect.0 will be rebuilt
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	info	Adapter system.adapter.wizconnect.0 needs rebuild and will be restarted afterwards.
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	instance system.adapter.wizconnect.0 terminated with code 1 (JS_CONTROLLER_STOPPED)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: }
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: requireStack: [ '/opt/iobroker/node_modules/iobroker.wizconnect/main.js' ]
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: code: 'MODULE_NOT_FOUND',
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at Function.Module._load (node:internal/modules/cjs/loader:904:12)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at Module.load (node:internal/modules/cjs/loader:1069:32)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at Module._compile (node:internal/modules/cjs/loader:1191:14)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at Object.<anonymous> (/opt/iobroker/node_modules/iobroker.wizconnect/main.js:10:22)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at require (node:internal/modules/cjs/helpers:108:18)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at Module.require (node:internal/modules/cjs/loader:1093:19)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at Function.Module._load (node:internal/modules/cjs/loader:866:27)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1021:15)
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: - /opt/iobroker/node_modules/iobroker.wizconnect/main.js
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: Require stack:
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: Error: Cannot find module '@apollon/iobroker-tools'
                                          host.IoBroker
                                          2023-02-21 11:49:54.769	error	Caught by controller[0]: ^
                                          host.IoBroker
                                          2023-02-21 11:49:54.768	error	Caught by controller[0]: throw err;
                                          host.IoBroker
                                          2023-02-21 11:49:54.768	error	Caught by controller[0]: node:internal/modules/cjs/loader:1024
                                          
                                          wendy2702 1 Reply Last reply Reply Quote 0
                                          • wendy2702
                                            wendy2702 @Kentrath last edited by

                                            @kentrath sagte in Wie nutze ich eine custom class / npm Modul?:

                                            host.IoBroker
                                            2023-02-21 11:49:54.769 warn adapter "wizconnect" seems to be installed for a different version of Node.js. Trying to rebuild it... 3 attempt
                                            host.IoBroker
                                            2023-02-21 11:49:54.769 info system.adapter.wizconnect.0 will be rebuilt
                                            host.IoBroker
                                            2023-02-21 11:49:54.769 info Adapter system.adapter.wizconnect.0 needs rebuild and will be restarted afterwards.

                                            Wie lange hast du das System, den Adapter, danach in Ruhe gelassen?

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            1.1k
                                            Online

                                            31.7k
                                            Users

                                            79.7k
                                            Topics

                                            1.3m
                                            Posts

                                            7
                                            65
                                            3690
                                            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