Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [Gelößt] Hilfe brauche ein Script

    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

    [Gelößt] Hilfe brauche ein Script

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

      Prima. Kannste aber noch "optimieren".
      Setze bitte ein [gelöst] in Deinem ersten Beitrag-Titel.

      W 1 Reply Last reply Reply Quote 0
      • W
        winny1900 @rantanplan last edited by

        @rantanplan

        eine Frage noch dann ist es wohl Gelößt.

        Wie bekomme ich diese Zahl jetzt in VIS ?

        Ist das erste Blockly für mich in verbindung mit VIS.

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

          @winny1900 sagte:

          Wie bekomme ich diese Zahl jetzt in VIS ?

          Erstelle unter javascript.0 zwei Datenpunkte vom Typ Zahl. Die kannst Du in Vis anzeigen.
          Hier noch eine einfachere Variante in Blockly:

          Blockly_json_temp_hum.JPG

          <xml xmlns="http://www.w3.org/1999/xhtml">
            <variables>
              <variable type="" id="^qm4e^`2czKZoH]v$#fl">svalue</variable>
            </variables>
            <block type="comment" id="9n9v:t+^YMFN!FcVt%`," x="-412" y="37">
              <field name="COMMENT">mqtt.0.domoticz.in</field>
              <next>
                <block type="on_ext" id="GT`:hBV!3yxgm!|!K~71">
                  <mutation items="1"></mutation>
                  <field name="CONDITION">ne</field>
                  <field name="ACK_CONDITION"></field>
                  <value name="OID0">
                    <shadow type="field_oid" id="QsKav`scUw[F2b`k4|:0">
                      <field name="oid">default</field>
                    </shadow>
                  </value>
                  <statement name="STATEMENT">
                    <block type="variables_set" id="Oj_j6{/t`(UmgHca?z{h">
                      <field name="VAR" id="^qm4e^`2czKZoH]v$#fl" variabletype="">svalue</field>
                      <value name="VALUE">
                        <block type="lists_split" id="BWP{vz7kklj8g/$9Z9w1">
                          <mutation mode="SPLIT"></mutation>
                          <field name="MODE">SPLIT</field>
                          <value name="INPUT">
                            <block type="get_attr" id=".(zz43SmwgHL-7;k06`A">
                              <value name="PATH">
                                <shadow type="text" id="p3x_XG,@)4*`}n1$EPK!">
                                  <field name="TEXT">svalue</field>
                                </shadow>
                              </value>
                              <value name="OBJECT">
                                <block type="on_source" id="{ci9/]DbojUFy#dg!346">
                                  <field name="ATTR">state.val</field>
                                </block>
                              </value>
                            </block>
                          </value>
                          <value name="DELIM">
                            <shadow type="text" id="mVDhf?jm!P!+1axeKFt7">
                              <field name="TEXT">;</field>
                            </shadow>
                          </value>
                        </block>
                      </value>
                      <next>
                        <block type="comment" id="vlRRKrcDW%0k~i/!$qCg">
                          <field name="COMMENT">Temperatur</field>
                          <next>
                            <block type="update" id="bEl[~{A}71F!?sOPMSE#">
                              <mutation delay_input="false"></mutation>
                              <field name="OID">Object ID</field>
                              <field name="WITH_DELAY">FALSE</field>
                              <value name="VALUE">
                                <block type="convert_tonumber" id="q4kt:./.w7)aJ@R]Hrdm">
                                  <value name="VALUE">
                                    <block type="lists_getIndex" id="c{lQ3iLBC_o=6LI!9r7j">
                                      <mutation statement="false" at="true"></mutation>
                                      <field name="MODE">GET</field>
                                      <field name="WHERE">FROM_START</field>
                                      <value name="VALUE">
                                        <block type="variables_get" id="C.*hD-!6honAqqOr`{uk">
                                          <field name="VAR" id="^qm4e^`2czKZoH]v$#fl" variabletype="">svalue</field>
                                        </block>
                                      </value>
                                      <value name="AT">
                                        <block type="math_number" id="j}{GiOwS*(,Zgm2]Kcr:">
                                          <field name="NUM">1</field>
                                        </block>
                                      </value>
                                    </block>
                                  </value>
                                </block>
                              </value>
                              <next>
                                <block type="comment" id="7:hpc2shYp-{jw${9Owx">
                                  <field name="COMMENT">Luftfeuchtigkeit</field>
                                  <next>
                                    <block type="update" id="zJiYj1wb9T6W[3{b:ip}">
                                      <mutation delay_input="false"></mutation>
                                      <field name="OID">Object ID</field>
                                      <field name="WITH_DELAY">FALSE</field>
                                      <value name="VALUE">
                                        <block type="convert_tonumber" id="59Kp#ayU+-[lR:fq23M8">
                                          <value name="VALUE">
                                            <block type="lists_getIndex" id="uJH|GQie1lqx|6%EqSpH">
                                              <mutation statement="false" at="true"></mutation>
                                              <field name="MODE">GET</field>
                                              <field name="WHERE">FROM_START</field>
                                              <value name="VALUE">
                                                <block type="variables_get" id="!2HC:9{c}JjO~-b?(bV}">
                                                  <field name="VAR" id="^qm4e^`2czKZoH]v$#fl" variabletype="">svalue</field>
                                                </block>
                                              </value>
                                              <value name="AT">
                                                <block type="math_number" id="G,t04Tbinp}-ph0J;r|~">
                                                  <field name="NUM">2</field>
                                                </block>
                                              </value>
                                            </block>
                                          </value>
                                        </block>
                                      </value>
                                    </block>
                                  </next>
                                </block>
                              </next>
                            </block>
                          </next>
                        </block>
                      </next>
                    </block>
                  </statement>
                </block>
              </next>
            </block>
          </xml>
          
          

          W 1 Reply Last reply Reply Quote 1
          • W
            winny1900 last edited by

            12345.PNG

            Der ansatz ist doch richtig. Der soll den wert in den neu angelegten Datenpunkt schreiben. Wenn ich da Liste eintrage schreibt der mir 3 Werte da rein.
            Wie bekomme ich das gelößt ?

            Ich mus auf jedenfall einen zweiten schreibe Block hinzufügen der mit ID Luftfeuchte.

            Grüße

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

              @winny1900 sagte:

              zweiten schreibe Block hinzufügen der mit ID Luftfeuchte.

              Schau mal in den Post davor: Die Variable Liste heißt dort svalue.

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

                @paul53

                bei aktualisiere Objekt ID kommt domoticz rein oder ?

                Weil das Script bei mir nicht läuft.

                17:30:05.712 error javascript.0 script.js.common.Test_2: Cannot get svalue of undefined
                17:30:05.713 error javascript.0 at Object.<anonymous> (script.js.common.Test_2:7:35)

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

                  @winny1900 sagte in Hilfe brauche ein Script:

                  bei aktualisiere Objekt ID kommt domoticz rein oder ?

                  Nein, beim ersten kommt die ID des Datenpunktes für die Temperaturanzeige und beim zweiten für die Feuchteanzeige rein (steht im Kommentar darüber). domoticz/in kommt beim Trigger rein.

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

                    @paul53 1234.PNG

                    hatte ich auch aber klappt nicht !

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

                      @winny1900 sagte:

                      klappt nicht !

                      Poste mal den Javascript-Code zu dem Blockly.

                      1 Reply Last reply Reply Quote 0
                      • W
                        winny1900 last edited by

                        <xml xmlns="http://www.w3.org/1999/xhtml">
                          <variables>
                            <variable type="" id="M3M(d4mStWF20,0YTs8-">svalue</variable>
                            <variable type="" id="rXRrCB6TjAFBN}u0m?94">Wert</variable>
                          </variables>
                          <block type="on_ext" id="?0aUoyJ54YONx4lpTknk" x="-62" y="38">
                            <mutation items="1"></mutation>
                            <field name="CONDITION">ne</field>
                            <field name="ACK_CONDITION"></field>
                            <value name="OID0">
                              <shadow type="field_oid" id="X@|.GI#NMkm!tpElg:0N">
                                <field name="oid">mqtt.0.domoticz.in</field>
                              </shadow>
                              <block type="field_oid" id="=|F.L85D:FZ~uR(VAqL9">
                                <field name="oid">mqtt.0.domoticz.in</field>
                              </block>
                            </value>
                            <statement name="STATEMENT">
                              <block type="variables_set" id=",$-$oLn`tLQuKnm=HAP?">
                                <field name="VAR" id="M3M(d4mStWF20,0YTs8-" variabletype="">svalue</field>
                                <value name="VALUE">
                                  <block type="lists_split" id="7:n2~,g/#UErIRm78!bd">
                                    <mutation mode="SPLIT"></mutation>
                                    <field name="MODE">SPLIT</field>
                                    <value name="INPUT">
                                      <block type="get_attr" id="P6Gq~]6C.+XQ}:j%rL!Q">
                                        <value name="PATH">
                                          <shadow type="text" id="UA6bAniM.d`]{i.G)AUU">
                                            <field name="TEXT">svalue</field>
                                          </shadow>
                                          <block type="text" id="/]q34ws4q$)`qxanFm83">
                                            <field name="TEXT">svalue</field>
                                          </block>
                                        </value>
                                        <value name="OBJECT">
                                          <block type="variables_get" id="#8(Jdx2lV75rL:?gh}!A">
                                            <field name="VAR" id="rXRrCB6TjAFBN}u0m?94" variabletype="">Wert</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="DELIM">
                                      <shadow type="text" id="YI.KKD*:?hqMram{#d:R">
                                        <field name="TEXT">;</field>
                                      </shadow>
                                      <block type="text" id=",XR}u%x}l|~rfkM?eg/.">
                                        <field name="TEXT">;</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <next>
                                  <block type="update" id="+Qw~Z-c]b(7XXG;SQ=,-">
                                    <mutation delay_input="false"></mutation>
                                    <field name="OID">javascript.0.Außentemp</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="convert_tonumber" id=",KQE85]PB{DEo.#kx,1B">
                                        <value name="VALUE">
                                          <block type="lists_getIndex" id="R+k,Tks}7GP2k!0U7x)8">
                                            <mutation statement="false" at="true"></mutation>
                                            <field name="MODE">GET</field>
                                            <field name="WHERE">FROM_START</field>
                                            <value name="VALUE">
                                              <block type="variables_get" id="wZ6)t!iOCh%It;@{4GZ$">
                                                <field name="VAR" id="M3M(d4mStWF20,0YTs8-" variabletype="">svalue</field>
                                              </block>
                                            </value>
                                            <value name="AT">
                                              <block type="math_number" id="5_zkgF{7ky)jKLqU|;lA">
                                                <field name="NUM">1</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="update" id="idUi)E`+(nGu=!Zgf}L`">
                                        <mutation delay_input="false"></mutation>
                                        <field name="OID">javascript.0.Außenluftfeuchte</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="convert_tonumber" id="(hT.wec}=+(x8(|n@ckG">
                                            <value name="VALUE">
                                              <block type="lists_getIndex" id="|y-mRDdVe%`abvj`+39I">
                                                <mutation statement="false" at="true"></mutation>
                                                <field name="MODE">GET</field>
                                                <field name="WHERE">FROM_START</field>
                                                <value name="VALUE">
                                                  <block type="variables_get" id="|1kG5WAlJ35yF,10|i-h">
                                                    <field name="VAR" id="M3M(d4mStWF20,0YTs8-" variabletype="">svalue</field>
                                                  </block>
                                                </value>
                                                <value name="AT">
                                                  <block type="math_number" id="7)gDqXV+Lv~A9(v,]*;}">
                                                    <field name="NUM">2</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </xml>
                        
                        paul53 1 Reply Last reply Reply Quote 0
                        • paul53
                          paul53 @winny1900 last edited by paul53

                          @winny1900 Wert ist keine Variable, sondern eine Eigenschaft des Triggerdatenpunktes (unter Blöcke Trigger) !
                          Du kannst auch die Variable Wert umbenennen nach value, damit es funktioniert.

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

                            @paul53

                            DANKE !! Danke für dein Geduld es Klappt !!!!

                            1 Reply Last reply Reply Quote 0
                            • W
                              winny1900 last edited by

                              So eins noch . Versprochen !!!

                              Unter JAvascript null zeigt der mir bei der Temp 17 % an statt Grad ?

                              Wie lösen wir das ?

                              1 Reply Last reply Reply Quote 0
                              • W
                                winny1900 last edited by

                                Schon erledigt habe was überlesen. War unter einstellungen.

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

                                Support us

                                ioBroker
                                Community Adapters
                                Donate

                                829
                                Online

                                31.8k
                                Users

                                80.0k
                                Topics

                                1.3m
                                Posts

                                6
                                31
                                1253
                                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