Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Fragen / Antworten rund um die neue Alias Funktion

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Fragen / Antworten rund um die neue Alias Funktion

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

      @apollon77 ich mach ein git auf

      ich prüfe übrigends den state an dieser stelle nicht ab sondern ob es ein dp-object gibt

      erst später bzw seperat wird überprüft, ob alle datenpunkte auch statewerte haben - aber nicht bei aliasen!

      danke dir

      1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @marcuskl last edited by paul53

        @marcuskl sagte:

        Ah jetzt hat sich es grad irgentwie aktualisiert und er ist da
        Komisch

        Der Wert eines neuen Datenpunktes wird nicht gleich im Admin, Reiter "Objekte" angezeigt. Am schnellsten kommt man zu einer Wertanzeige, wenn man den Admin in einem neuen Browser-Tab öffnet. Getestet habe ich es mit folgendem Beispiel, in dem ein String-Datenpunkt, der nur die Werte "Aus" und "Ein" hat, in einen Logikwert gewandelt wird.

          "common": {
            "name": "Bad.Licht.Deckenlampe",
            "role": "switch",
            "type": "boolean",
            "desc": "Wandlung aus String Aus/Ein",
            "alias": {
              "id": "meineDP.0.ch2.on_off",
              "read": "val == 'Aus' ? false : true",
              "write": "val ? 'Ein' : 'Aus'"
            },
            "read": true,
            "write": true,
            "def": false
          },
          "native": {},
        
        apollon77 1 Reply Last reply Reply Quote 0
        • apollon77
          apollon77 @paul53 last edited by

          @paul53 "on"/"off" sollte automatisch konvertiert werden! Da brauchst Du an sich keine read/write function. Es reicht wenn die Datentypen boolean/string sind bei target/source

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

            @apollon77 sagte:

            Da brauchst Du an sich keine read/write function. Es reicht wenn die Datentypen boolean/string sind bei target/source

            Ja, ich weiß, wollte es aber mal mit "read" und "write" testen - eigentlich mit einem Datenpunkt "Aus"/"Ein", den ich aber erst hätte erstellen müssen. Ich passe es mal in meinem Beispiel oben an.

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

              @paul53 ;.) "Ein"/"Aus" geht auch automatisch gg

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

                @apollon77 sagte:

                "Ein"/"Aus" geht auch automatisch

                Wirklich ?

                            if (state.val === 'off' || state.val === 'OFF' || state.val === 'AUS' || state.val === 'aus' || state.val === 0 || state.val === '0') {
                
                apollon77 1 Reply Last reply Reply Quote 0
                • apollon77
                  apollon77 @paul53 last edited by

                  @paul53 ooooojhkkk ... "Aus" nicht ... ich baue es noch in ein lowercase um 🙂

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

                    @apollon77
                    Die Abfrage

                    state.val === 0
                    

                    kann man weglassen, denn der Fall wird abgedeckt durch

                    else state.val = !!state.val;
                    
                    apollon77 1 Reply Last reply Reply Quote 0
                    • apollon77
                      apollon77 @paul53 last edited by

                      @paul53 korrekt

                      1 Reply Last reply Reply Quote 0
                      • X
                        Xyolyp last edited by Xyolyp

                        Ich habe nach dem Update auf den JS-Controller 2.1 einige meiner Skripte umgestellt, so dass jetzt 0_userdata.0 sowie die Alias (anstatt der LinkedDevices Adapter) genutzt wird.
                        0_userdata.0 funktioniert genau wie erwartet; Alias praktisch gar nicht.
                        Im Objektbaum werden die richtigen Werte angezeigt und auch bei Änderungen funktioniert es in beide Richtungen (schreiben auf Alias, sowie schreiben auf Originaldatenpunkt). Sobald aber ein Skript einen Aliasdatenpunkt nutzen soll funktioniert es nicht mehr. Die Trigger lösen nicht aus, wenn ein Skript versucht einen Aliasdatenpunkt zu lesen (gewählt via Objektbaum-Popup im Blockly), den es definitiv gibt, so schlägt es fehl mit folgendem Log:

                        javascript.0	2019-11-17 15:00:35.508	warn	(770) at processImmediate (timers.js:658:5)
                        javascript.0	2019-11-17 15:00:35.507	warn	(770) at tryOnImmediate (timers.js:676:5)
                        javascript.0	2019-11-17 15:00:35.506	warn	(770) at runCallback (timers.js:705:18)
                        javascript.0	2019-11-17 15:00:35.506	warn	(770) at Immediate.setImmediate (/opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInRedis.js:224:41)
                        javascript.0	2019-11-17 15:00:35.505	warn	(770) at change (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:4744:37)
                        javascript.0	2019-11-17 15:00:35.504	warn	(770) at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:364:25)
                        javascript.0	2019-11-17 15:00:35.503	warn	(770) at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:973:38)
                        javascript.0	2019-11-17 15:00:35.502	warn	(770) at Object.<anonymous> (script.js.Phone.Announce_Call:7:55)
                        javascript.0	2019-11-17 15:00:35.500	warn	(770) getState "alias.0.Anwesenheit.Laura" not found (3)
                        javascript.0	2019-11-17 15:00:35.499	warn	(770) at processImmediate (timers.js:658:5)
                        javascript.0	2019-11-17 15:00:35.499	warn	(770) at tryOnImmediate (timers.js:676:5)
                        javascript.0	2019-11-17 15:00:35.498	warn	(770) at runCallback (timers.js:705:18)
                        javascript.0	2019-11-17 15:00:35.497	warn	(770) at Immediate.setImmediate (/opt/iobroker/node_modules/iobroker.js-controller/lib/states/statesInRedis.js:224:41)
                        javascript.0	2019-11-17 15:00:35.497	warn	(770) at change (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:4744:37)
                        javascript.0	2019-11-17 15:00:35.496	warn	(770) at Object.stateChange (/opt/iobroker/node_modules/iobroker.javascript/main.js:364:25)
                        javascript.0	2019-11-17 15:00:35.495	warn	(770) at Object.callback (/opt/iobroker/node_modules/iobroker.javascript/lib/sandbox.js:973:38)
                        javascript.0	2019-11-17 15:00:35.494	warn	(770) at Object.<anonymous> (script.js.Phone.Announce_Call:7:7)
                        javascript.0	2019-11-17 15:00:35.490	warn	(770) getState "alias.0.Anwesenheit.Jonathan" not found (3)
                        


                        Platform: linux
                        Architecture: arm
                        CPUs: 4
                        Speed: 1200 MHz
                        Model: ARMv7 Processor rev 4 (v7l)
                        RAM: 926 MB 
                        System uptime: 02:45:28
                        Node.js: v10.17.0
                        NPM: 6.12.1
                        Disk size: 14.5 GiB
                        Disk free: 10.8 GiB
                        adapters count: 260
                        Uptime: 02:42:30
                        Active instances: 16
                        



                        b85b398c-01a5-4cec-81ff-8c1245905e99-image.png

                        {
                         "from": "system.adapter.admin.0",
                         "user": "system.user.admin",
                         "ts": 1573998134012,
                         "common": {
                           "name": "Laura",
                           "role": "indicator.presence",
                           "type": "boolean",
                           "alias": {
                             "id": "tr-064.0.devices.HUAWEI-Mate-10-lite-584e2.active"
                           }
                         },
                         "native": {},
                         "acl": {
                           "object": 1636,
                           "owner": "system.user.admin",
                           "ownerGroup": "system.group.administrator",
                           "state": 1636
                         },
                         "_id": "alias.0.Anwesenheit.Laura",
                         "type": "state"
                        }
                        

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

                          Welche Version des JavaScript Adapters ist im Einsatz?

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

                            @apollon77 Script engine ist in Version 4.1.14 installiert.
                            Edit: falscher Adaptername

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

                              @Xyolyp Ich meine den "Javascript" ("Script Engine" seit neuestem) Adapter

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

                                @apollon77 den meinte ich auch. Habe nur den falschen Namen geschrieben

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

                                  @Xyolyp Update mal auf was aktuelles bitte ... der ist recht alt. Könnte mir vorstellen das es ggf mit daran liegt

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

                                    @apollon77 im stable ist 4.1.12 der aktuellste. Aktuell bewege ich mich mit meinem System immer mehr in Richtung "nur noch stable", da mein Verständnis von stable ist, dass da keine Experimente passieren, sondern die Funktionalität, die vom Adapterentwickler in der Version beworben wird funktioniert.
                                    Auf welche Version sollte ich denn aktualisieren, damit es funktioniert?

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

                                      @Xyolyp Ich sage es mal so: Wir haben währendder Entwicklung üblicherweise mit javascript 4.3.x getestet was aktuell "latest". Müsste man halt jetzt mal checken ob es da tut.Dann muss das noch fix ins Stable 🙂

                                      X 1 Reply Last reply Reply Quote 1
                                      • X
                                        Xyolyp @apollon77 last edited by

                                        @apollon77 mit der Script Engine v 4.3.2 haben die ersten zwei, drei Tests funktioniert.

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

                                          @Xyolyp Also müssen wir wohl doch für Alias noch javascript im Stable updaten ... hm .... ok!!

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

                                            auch wenn das hier schon ein paar Tage alt ist, ich finde keinen passenderen Thread.

                                            Mein Geräte-Tab macht bisher mehr Probleme als das er nützt....

                                            Mein System


                                            Debian 9 VM auf Proxmox
                                            Node.js v10.17.0
                                            NPM 6.11.3
                                            Script Engine 4.3.4
                                            Admin 3.7.1

                                            Poblem 1: Beim einstellen vom Gerätetyp wir dieser teilweise falsch angezeigt. Typ Medien wurde in der Übersicht als Typ Info angezeigt. (Im Objekte-Tab stehts aber richtig)

                                            Problem 2: Hatte beim Gerätetyp aus versehen auf Typ Instanz geklickt, danach hängte sich der Komplette Adapter auf und ich hatte nur noch einen weißen Bildschirm vor mir....

                                            Problem 3: Neu erstellte Geräte werden teilweise erst nach wegwechseln und wieder hin wechseln vom Gerätetab angezeigt...

                                            Problem 4: und auch das schlimmste Problem: Nachdem ich die angelegten Geräte in ein Blockly einbinden wollte, fuhr sich ioBroker komplett fest. Auf alle geöffnetten Tabs sah ich nur noch den bunten, drehenden Kreis.
                                            Laut top hatten sowohl der Admin-Adapter und der js-controller wechselseitig immer so um die 50-60% CPU-Auslastung. Das Problem war mehrfach reproduzierbar. Immer in der Objektauswahl vom js-Controller ging nix mehr, sobald ich im alias.0 Ordner irgendein Gerät angeklickt habe.

                                            Nachdem ich alle Geräte aus dem Geräte-Tab entfernt habe, läuft wieder alles normal...

                                            Leider kann und will ich das nicht nochmal reproduzieren, da ich nur ein Produktivsystem habe und mir das nicht zerschießen will...
                                            Aber vielleicht hilfts ja trotzdem.

                                            Log hat übrigens nix angezeigt.

                                            apollon77 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

                                            825
                                            Online

                                            31.7k
                                            Users

                                            79.8k
                                            Topics

                                            1.3m
                                            Posts

                                            alias js-controller
                                            85
                                            610
                                            137441
                                            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