Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. 2 Javascript Fragen SetState

    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

    2 Javascript Fragen SetState

    This topic has been deleted. Only users with topic management privileges can see it.
    • hg6806
      hg6806 Most Active last edited by hg6806

      Moin zusammen,

      ich versuche mich mal wieder am Programmieren, bin aber schon wieder direkt an die Grenzen gestoßen.

      Wieso wird folgende Zeile korrekt ausgeführt:

      setState("fhem.0.info.Commands.sendFHEM"/*Command to FHEM*/, ('set myHPSU HPSUVal.Soll_T_Raum_1_[t_room1_setpoint] ' + String(3 + 21)));
      

      und folgende Zeile nicht, obwohl der Wert von "fhem.0.myHPSU.HPSU_Soll_T_Raum_1" 21 entspricht?

      setState("fhem.0.info.Commands.sendFHEM"/*Command to FHEM*/, ('set myHPSU HPSUVal.Soll_T_Raum_1_[t_room1_setpoint] ' + String(3 + getState("fhem.0.myHPSU.HPSU_Soll_T_Raum_1").val)));
      

      Im Log habe ich kein Warning oder Error.


      1. Frage

      Wieso bekomme ich von der Zeile:

      setState("mqtt.0.Wemos6-Brunnen.GPIO.2"/*/Wemos6-Brunnen/GPIO/2*/, 1);
      

      folgende Warnung:

      10:25:06.650	warn	javascript.0 (5150) at Object.<anonymous> (script.js.common.Sonstiges.Brunnenpumpe_einschalten_bis_Brunnen_10%:15:5)
      

      Hier wird es aber trotzdem korrekt ausgeführt.

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

        @hg6806 sagte:

        obwohl der Wert von "fhem.0.myHPSU.HPSU_Soll_T_Raum_1" 21 entspricht?

        Zahl 21 oder String "21" ?

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

          @paul53
          Meines Erachtens Zahl, da ja hinten ".val" steht.

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

            @hg6806 sagte:

            Meines Erachtens Zahl, da ja hinten ".val" steht.

            ".val" kann jeden Datentyp liefern. Ändere einfach mal in

            setState("fhem.0.info.Commands.sendFHEM", 'set myHPSU HPSUVal.Soll_T_Raum_1_[t_room1_setpoint] ' + String(3 + parseFloat(getState("fhem.0.myHPSU.HPSU_Soll_T_Raum_1").val)));
            
            hg6806 1 Reply Last reply Reply Quote 0
            • hg6806
              hg6806 Most Active @paul53 last edited by

              @paul53 sagte in 2 Javascript Fragen SetState:

              setState("fhem.0.info.Commands.sendFHEM", 'set myHPSU HPSUVal.Soll_T_Raum_1_[t_room1_setpoint] ' + String(3 + parseFloat(getState("fhem.0.myHPSU.HPSU_Soll_T_Raum_1").val)));

              Hmm, hatte das in Blockly gemacht.
              Wie mache ich parsefloat( in Blockly?

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

                Gefunden. "Wandle Eingang nach Zahl".
                Hat geklappt.
                Danke.

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

                Support us

                ioBroker
                Community Adapters
                Donate

                1.0k
                Online

                31.8k
                Users

                80.0k
                Topics

                1.3m
                Posts

                2
                6
                330
                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