Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Yahka und Zeitsteuerung ESPeasy

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Yahka und Zeitsteuerung ESPeasy

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

      @xxx_turbo_xxx sagte:

      Der Wemos sendet ja nur 0 und 1

      Wird die Pumpe nicht geschaltet, wenn der Wert im Objekt-Tab geändert wird (0 --> 1 / 1 --> 0) ?

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

        @paul53 Nein, ioBroker empfängt den Wert nur, wenn ich das richtig sehe

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

          @xxx_turbo_xxx sagte:

          ioBroker empfängt den Wert nur

          Dann benötigst Du einen Alias-Datenpunkt mit getrenntem Kommando / Status.

          • alias.id.write: "0_userdata.0.Pool.Pumpe"
          • alias.id.read: "mqtt.0.ESP_Easy_pro_11.Pumpe.State"
          • alias.read: "!!val"
          xxx_turbo_xxx 1 Reply Last reply Reply Quote 0
          • xxx_turbo_xxx
            xxx_turbo_xxx @paul53 last edited by

            @paul53 Ok. Kannst du mir das bitte etwas genauer darstellen? Wo trage ich die Werte ein?

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

              @xxx_turbo_xxx
              Kopiere folgendes Script und starte es kurz einmal:

              // Original-Datenpunkt
              const idOrigin = '0_userdata.0.Pool.Pumpe'; 
              // Optional: Status-Datenpunkt, wenn Kommando und Status getrennt.
              // Bei Nicht-Verwendung Leerstring '' zuweisen
              const idRead = 'mqtt.0.ESP_Easy_pro_11.Pumpe.State';
               
              // Alias-Datenpunkt
              const idAlias = 'Pool.Pumpe';
              var typeAlias, read, write, nameAlias, role, desc, min, max, unit, states, custom, raum, gewerk;
              // Folgende kommentieren, wenn keine Änderung der Eigenschaft erforderlich
              nameAlias = 'Pool Pumpe';
              desc = 'per Script erstellt';
              typeAlias = 'boolean'; // oder 'number'
              read = "!!val";   
              // write = "val ? true : true";
              role = 'switch';
              // min = 0; // nur Zahlen
              // max = 100; // nur Zahlen
              // unit = '%'; // nur für Zahlen
              // states = {0: 'Aus', 1: 'Auto', 2: 'Ein'}; // Zahlen (Multistate) oder Logikwert (z.B. Aus/Ein)
              // custom = []; // verhindert doppelte Ausführung von history, ...
              // raum = 'EG_Flur'; // Groß-/Kleinschreibung in der ID beachten !
              // gewerk = 'Licht'; // Groß-/Kleinschreibung in der ID beachten !
              
              // Ab hier nichts ändern !!
              function createAlias(idDst, idSrc, idRd) {
                 if(existsState(idDst)) log(idDst + ' schon vorhanden !', 'warn');
                 else {
                    var obj = {};
                    obj.type = 'state';
                    obj.common = getObject(idSrc).common;
                    obj.common.alias = {};
                    if(idRd) {
                        obj.common.alias.id = {};
                        obj.common.alias.id.read = idRd;
                        obj.common.alias.id.write = idSrc;
                        obj.common.read = true;
                    } else obj.common.alias.id = idSrc;
                    if(typeAlias) obj.common.type = typeAlias;
                    if(obj.common.read !== false && read) obj.common.alias.read = read;
                    if(obj.common.write !== false && write) obj.common.alias.write = write;
                    if(nameAlias) obj.common.name = nameAlias;
                    if(role) obj.common.role = role;
                    if(desc) obj.common.desc = desc;
                    if(min !== undefined) obj.common.min = min;
                    if(max !== undefined) obj.common.max = max;
                    if(unit) obj.common.unit = unit;
                    if(states) obj.common.states = states;
                    if(custom && obj.common.custom) obj.common.custom = custom;
                    obj.native = {};
                    setObject(idDst, obj);
                    if(raum && existsObject('enum.rooms.' + raum)) {
                       let obj = getObject('enum.rooms.' + raum)
                       obj.common.members.push(idDst);
                       setObject('enum.rooms.' + raum, obj);
                    }
                    if(gewerk && existsObject('enum.functions.' + gewerk)) {
                       let obj = getObject('enum.functions.' + gewerk)
                       obj.common.members.push(idDst);
                       setObject('enum.functions.' + gewerk, obj);
                    }
                 } 
              }
               
              createAlias('alias.0.' + idAlias, idOrigin, idRead);
              
              xxx_turbo_xxx 1 Reply Last reply Reply Quote 0
              • xxx_turbo_xxx
                xxx_turbo_xxx @paul53 last edited by

                @paul53 ok... hab ich

                paul53 xxx_turbo_xxx 2 Replies Last reply Reply Quote 0
                • paul53
                  paul53 @xxx_turbo_xxx last edited by

                  @xxx_turbo_xxx sagte:

                  hab ich

                  Dann sollte ein Datenpunkt "alias.0.Pool.Pumpe" vorhanden sein, den Du mit Yahka verwenden kannst.

                  xxx_turbo_xxx 2 Replies Last reply Reply Quote 0
                  • xxx_turbo_xxx
                    xxx_turbo_xxx @xxx_turbo_xxx last edited by

                    @xxx_turbo_xxx Wenn ich das richtig verstehe legt das Script nur den Datenpunkt unter alias an, richtig?

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

                      @paul53 Läuft! Danke!!! Dann kann ich das Skript theoretisch wieder löschen bzw. deaktivieren? Jetzt muss ich nur noch verstehen, was da im Hintergrund läuft 🙂

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

                        @paul53 eines ist mir allerdings noch aufgefallen. Wenn ich die Pumpe manuell per Browserkommando starte kann ich sie nicht per Homekit deaktivieren...

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

                          @xxx_turbo_xxx sagte:

                          Dann kann ich das Skript theoretisch wieder löschen bzw. deaktivieren?

                          Nein, das Skript wandelt das Kommando (false/true) vom Datenpunkt in eine gesendete URL, wird also weiterhin benötigt.

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

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          910
                          Online

                          32.0k
                          Users

                          80.4k
                          Topics

                          1.3m
                          Posts

                          blockly monitoring
                          2
                          14
                          634
                          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