Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Wert aus javaScript an CCu2 senden

    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

    Wert aus javaScript an CCu2 senden

    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bumbumb last edited by

      Hallo,

      ich möchte einen Wert aus einem Javascript an die CCu2 senden. Dazu habe ich in der CCu2 einen Systemvariable "BioTonne" angelegt.

      mein Scrip sieht so aus:

      on({id: 'javascript.0.muell.Biotonne', change: "ne"}, function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        setState("hm-rega.0.2149"/*BioTonne*/, ('' + getState("javascript.0.muell.Biotonne").val));
      });
      
      

      Javascript wie screenshot.

      Leider funktioniert nicht.

      Wo ist der Fehler, könnt ihr mir helfen?
      8702_java.png

      1 Reply Last reply Reply Quote 0
      • Homer.J.
        Homer.J. last edited by

        So sollte es klappen.

        // DP in SV schreiben
        const idDP = "javascript.0.muell.Biotonne";
        const idSV = "hm-rega.0.2149";
        
        setState("hm-rega.0.2149", getState("javascript.0.muell.Biotonne").val); // Skriptstart
        
        on("javascript.0.muell.Biotonne","hm-rega.0.2149");  // Wertänderung
        
        1 Reply Last reply Reply Quote 0
        • B
          bumbumb last edited by

          ja danke aber es steht null drin und nicht der Wert aus dem Skript. Wo kann der Fehler sein. Danke

          1 Reply Last reply Reply Quote 0
          • Homer.J.
            Homer.J. last edited by

            Script vom Müllkalender neu starten das der Wert neu gesetzt wird vermute ich.

            1 Reply Last reply Reply Quote 0
            • B
              bumbumb last edited by

              Hi,

              leider funktioniert es nicht. Hast du eine Idee?.

              Wer kann mir etwas helfen?

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

                Wie?

                1 Reply Last reply Reply Quote 0
                • sigi234
                  sigi234 Forum Testing Most Active last edited by

                  Es funktioniert auch bei mir…........ehrlicherweise weis ich nicht so genau wie ich das hingebracht habe............ 😉

                  2858_screenshot2__679_.png

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

                  Support us

                  ioBroker
                  Community Adapters
                  Donate

                  459
                  Online

                  31.7k
                  Users

                  79.9k
                  Topics

                  1.3m
                  Posts

                  4
                  7
                  492
                  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