Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag)

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag)

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

      @tomate sagte in Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag):

      Ich würde aber gerne das "Instanz Stop Problem" lösen.
      Wie kann ich das am besten angehen?

      Ich würde erstmal dafür sorgen dass die Scripte sauber laufen und Dir nicht das Log vollmüllen.

      1 Reply Last reply Reply Quote 1
      • Thomas Braun
        Thomas Braun Most Active @Tomate last edited by

        @tomate sagte in Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag):

        Wie kann ich das am besten angehen?

        Schau in das Log, wenn der wieder abknickt. Dazu hilft es, wenn der Rest möglichst wenig zusätzliches Zeug in das Log rotzt. Also Skripte sauber anlegen.

        T 1 Reply Last reply Reply Quote 0
        • T
          Tomate @Thomas Braun last edited by

          @thomas-braun said in Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag):

          @tomate sagte in Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag):

          Wie kann ich das am besten angehen?

          Schau in das Log, wenn der wieder abknickt. Dazu hilft es, wenn der Rest möglichst wenig zusätzliches Zeug in das Log rotzt. Also Skripte sauber anlegen.

          Das Protokoll steht dann einfach und es steht nichts drin, was nicht sonst auch drin steht.
          Aber ich habe verstanden. Ich räume jetzt erstmal weiter auf.

          Wie geschrieben bin ich ja schon am "aufräumen".
          Hierbei bin ich über diese Problem gestoßen.
          Könnt ihr hierbei vielleicht auch helfen?
          MariaDB - SQL Datenpunkt löschen

          1 Reply Last reply Reply Quote 0
          • T
            Tomate @Codierknecht last edited by

            @codierknecht
            Den Eintrag

            timerId=undefined
            

            sehe ich des öfteren.
            Exemplarisch so......

            getState(id=modbus.0.holdingRegisters.0_Active_power+, timerId=undefined) => {"val":2196.1,"ack":true,"ts":1679000222368,"q":0,"from":"system.adapter.modbus.0","user":"system.user.admin","lc":1679000222368}
            

            Was ist hierfür die Ursache?

            Codierknecht 1 Reply Last reply Reply Quote 0
            • Codierknecht
              Codierknecht Developer Most Active @Tomate last edited by

              @tomate Wo kommt das her?
              Aus 'nem Script oder vom Modbus-Adapter? Bei zweiterem kann ich leider nicht sinnvolles beitragen.

              T 1 Reply Last reply Reply Quote 0
              • T
                Tomate @Codierknecht last edited by

                @codierknecht
                Der Eintrag ist jetzt aus dem Modbus Adapter.

                Den "timerId=undefined" Eintrag gibt es aber auch hier zum Beispiel:

                
                getState(id=0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave, timerId=undefined) => {"val":0,"ack":false,"ts":1679000222124,"q":0,"c":"script.js.common.Kostal.Kostal2von2","from":"system.adapter.javascript.0","user":"system.user.admin","lc":1678989765166}
                
                Codierknecht 1 Reply Last reply Reply Quote 0
                • Codierknecht
                  Codierknecht Developer Most Active @Tomate last edited by

                  @tomate sagte in Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag):

                  Kostal2von2

                  Gibt es ein Script "Kostal2von2"?
                  Zeig mal ...

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    Tomate @Codierknecht last edited by

                    @codierknecht said in Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag):

                    Script "Kostal2von2"

                    <xml xmlns="https://developers.google.com/blockly/xml">
                      <block type="on" id="Ov.=`e?|BF;:NKk%]0}l" x="-763" y="-313">
                        <field name="OID">0_userdata.0.Zyklus-Blinker.1Sekunden-Takt</field>
                        <field name="CONDITION">ne</field>
                        <field name="ACK_CONDITION"></field>
                        <statement name="STATEMENT">
                          <block type="comment" id="hYY`}cf(5yxmf8ApKrA5">
                            <field name="COMMENT">Hausverbrauch_berechnen</field>
                            <next>
                              <block type="comment" id="{]-ZugJEAj`h}8aN.:Cc">
                                <field name="COMMENT">Bedingung bei Verbrauch (Zukauf)</field>
                                <next>
                                  <block type="controls_if" id="d?Ut}rB7U;nn8h~1DTs{">
                                    <value name="IF0">
                                      <block type="logic_compare" id="!]]V*$Cx=JORAcy.#S%@">
                                        <field name="OP">GT</field>
                                        <value name="A">
                                          <block type="get_value" id="TmGEO_`~#`j@QI1X-f*_">
                                            <field name="ATTR">val</field>
                                            <field name="OID">modbus.0.holdingRegisters.0_Active_power+</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="zu@Q;yF5a!`g#@/m*2@[">
                                            <field name="NUM">0</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <statement name="DO0">
                                      <block type="control" id="5cqKzvHOm.t0dVcgGIC{">
                                        <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                        <field name="OID">0_userdata.0.Photovoltaik.PV-Hausverbrauch</field>
                                        <field name="WITH_DELAY">FALSE</field>
                                        <value name="VALUE">
                                          <block type="math_arithmetic" id="B-`bM)2M!I+^nb-_zk;E">
                                            <field name="OP">ADD</field>
                                            <value name="A">
                                              <shadow type="math_number" id="W`T6v0$]V:C5j)w%%$=x">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="get_value" id="yGtvKad$M~tIQP1oicuQ">
                                                <field name="ATTR">val</field>
                                                <field name="OID">0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave</field>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <shadow type="math_number" id="]H3?6[!S^?8OU}Tq#1q4">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="get_value" id="yw_zU(^N!S^YXL$MqJM0">
                                                <field name="ATTR">val</field>
                                                <field name="OID">modbus.0.holdingRegisters.0_Active_power+</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                      </block>
                                    </statement>
                                    <next>
                                      <block type="comment" id="NQRiW:4qvPO_/_g]zrN4">
                                        <field name="COMMENT">Bedingung bei Einspeisung (Verkauf)</field>
                                        <next>
                                          <block type="controls_if" id="3hl65%3DD-$lD.,_o#+]">
                                            <value name="IF0">
                                              <block type="logic_compare" id="J!V:qpcNTtI?-+QX$=|p">
                                                <field name="OP">GT</field>
                                                <value name="A">
                                                  <block type="get_value" id="YL*bbXgXN,_!Xa}d4_):">
                                                    <field name="ATTR">val</field>
                                                    <field name="OID">modbus.0.holdingRegisters.3_Active_power-</field>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <block type="math_number" id="SIInUpV_ZZg)[.h;0u.E">
                                                    <field name="NUM">0</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <statement name="DO0">
                                              <block type="control" id="KgKhBC/re=xPvd6-a4zO">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                <field name="OID">0_userdata.0.Photovoltaik.PV-Hausverbrauch</field>
                                                <field name="WITH_DELAY">FALSE</field>
                                                <value name="VALUE">
                                                  <block type="math_arithmetic" id="7xRPKP]pfG68Mjc^z_td">
                                                    <field name="OP">MINUS</field>
                                                    <value name="A">
                                                      <shadow type="math_number">
                                                        <field name="NUM">1</field>
                                                      </shadow>
                                                      <block type="get_value" id="b5-Y@2^4Qg*S)Zz?_vb-">
                                                        <field name="ATTR">val</field>
                                                        <field name="OID">0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave</field>
                                                      </block>
                                                    </value>
                                                    <value name="B">
                                                      <shadow type="math_number" id="@8uR6C(!}Cdxgd[X5:BQ">
                                                        <field name="NUM">1</field>
                                                      </shadow>
                                                      <block type="get_value" id="5`B(@z1]=^is.+[Ut]x?">
                                                        <field name="ATTR">val</field>
                                                        <field name="OID">modbus.0.holdingRegisters.3_Active_power-</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                              </block>
                                            </statement>
                                            <next>
                                              <block type="comment" id="/@#}F@E?(VaR3NWdp|8E">
                                                <field name="COMMENT">MAster + Slave addiert</field>
                                                <next>
                                                  <block type="control" id="iWN|=KsdUNHnigm_L*`L">
                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                    <field name="OID">0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave</field>
                                                    <field name="WITH_DELAY">FALSE</field>
                                                    <value name="VALUE">
                                                      <block type="math_arithmetic" id="v8|u+o|+wH`mlay/.pxq">
                                                        <field name="OP">ADD</field>
                                                        <value name="A">
                                                          <shadow type="math_number">
                                                            <field name="NUM">1</field>
                                                          </shadow>
                                                          <block type="get_value" id="aLh[RWvw~Iys^B8B^-L5">
                                                            <field name="ATTR">val</field>
                                                            <field name="OID">plenticore.0.devices.local.ac.P</field>
                                                          </block>
                                                        </value>
                                                        <value name="B">
                                                          <shadow type="math_number">
                                                            <field name="NUM">1</field>
                                                          </shadow>
                                                          <block type="get_value" id="(dK6wM~5W,{YDM4WVK.4">
                                                            <field name="ATTR">val</field>
                                                            <field name="OID">plenticore.1.devices.local.ac.P</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="comment" id="B-BgIgiV3fL6:my};bcN">
                                                        <field name="COMMENT">Wert von Smartmeter zu S7 schicken</field>
                                                        <next>
                                                          <block type="control" id=":Q@wY8XR6#uF=@.y3UG9">
                                                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                            <field name="OID">s7.0.DBs.DB30.PV_Smartmeter_Wirkleistung_verkaufen</field>
                                                            <field name="WITH_DELAY">FALSE</field>
                                                            <value name="VALUE">
                                                              <block type="get_value" id="59eJEd=v7?]v6r1dSBR)">
                                                                <field name="ATTR">val</field>
                                                                <field name="OID">modbus.0.holdingRegisters.3_Active_power-</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                      </block>
                    </xml>
                    
                    Codierknecht 1 Reply Last reply Reply Quote 0
                    • Codierknecht
                      Codierknecht Developer Most Active @Tomate last edited by Codierknecht

                      @tomate
                      Du liest mehrfach den gleichen Wert aus den Objekten.
                      Das verbrät reichlich Ressourcen. Ich würde das anders lösen:
                      280687d8-4799-47e8-aa18-c976b0c5929b-image.png

                      T 1 Reply Last reply Reply Quote 0
                      • T
                        Tomate @Codierknecht last edited by

                        @codierknecht said in Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag):

                        @tomate
                        Du liest mehrfach den gleichen Wert aus den Objekten.
                        Das verbrät reichlich Ressourcen. Ich würde das anders lösen:
                        280687d8-4799-47e8-aa18-c976b0c5929b-image.png

                        Das schaut super und interessant aus.
                        Würdest du mir den Code (Export) schicken?
                        (-:

                        Codierknecht 1 Reply Last reply Reply Quote 0
                        • Codierknecht
                          Codierknecht Developer Most Active @Tomate last edited by

                          @tomate sagte in Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag):

                          Würdest du mir den Code (Export) schicken?

                          Versuch's mal nachzubauen - das ist nicht schwer ... und übt 😉
                          Ich kann mir gut vorstellen, dass es da noch andere Kandidaten für Optimierung gibt.

                          <block xmlns="https://developers.google.com/blockly/xml" type="on" id="Ov.=`e?|BF;:NKk%]0}l" x="-1387" y="-288">
                           <field name="OID">0_userdata.0.Zyklus-Blinker.1Sekunden-Takt</field>
                           <field name="CONDITION">ne</field>
                           <field name="ACK_CONDITION"></field>
                           <statement name="STATEMENT">
                             <block type="variables_set" id="[hH9D(tTm.F##k(srQQe">
                               <field name="VAR" id="~PqS$DEl$%W9TL=1=40M">wattMaster</field>
                               <value name="VALUE">
                                 <block type="get_value" id="yGtvKad$M~tIQP1oicuQ">
                                   <field name="ATTR">val</field>
                                   <field name="OID">0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave</field>
                                 </block>
                               </value>
                               <next>
                                 <block type="variables_set" id="ApEaj_lM}!PvPIV(`{[B">
                                   <field name="VAR" id="@D?1=I6dj/.p(Xq+8@}}">activePower</field>
                                   <value name="VALUE">
                                     <block type="get_value" id="yw_zU(^N!S^YXL$MqJM0">
                                       <field name="ATTR">val</field>
                                       <field name="OID">modbus.0.holdingRegisters.0_Active_power+</field>
                                     </block>
                                   </value>
                                   <next>
                                     <block type="comment" id="hYY`}cf(5yxmf8ApKrA5">
                                       <field name="COMMENT">Hausverbrauch_berechnen</field>
                                       <next>
                                         <block type="controls_if" id="d?Ut}rB7U;nn8h~1DTs{">
                                           <value name="IF0">
                                             <block type="logic_compare" id="!]]V*$Cx=JORAcy.#S%@">
                                               <field name="OP">GT</field>
                                               <value name="A">
                                                 <block type="variables_get" id="jlql((_%4a,e6;%X4}YF">
                                                   <field name="VAR" id="@D?1=I6dj/.p(Xq+8@}}">activePower</field>
                                                 </block>
                                               </value>
                                               <value name="B">
                                                 <block type="math_number" id="zu@Q;yF5a!`g#@/m*2@[">
                                                   <field name="NUM">0</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                           <statement name="DO0">
                                             <block type="comment" id="{]-ZugJEAj`h}8aN.:Cc">
                                               <field name="COMMENT">Bedingung bei Verbrauch (Zukauf)</field>
                                               <next>
                                                 <block type="control" id="5cqKzvHOm.t0dVcgGIC{">
                                                   <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                   <field name="OID">0_userdata.0.Photovoltaik.PV-Hausverbrauch</field>
                                                   <field name="WITH_DELAY">FALSE</field>
                                                   <value name="VALUE">
                                                     <block type="math_arithmetic" id="B-`bM)2M!I+^nb-_zk;E" inline="false">
                                                       <field name="OP">ADD</field>
                                                       <value name="A">
                                                         <shadow type="math_number" id="W`T6v0$]V:C5j)w%%$=x">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                         <block type="variables_get" id="@RFUjIDgV1IfY7_d?!Q_">
                                                           <field name="VAR" id="~PqS$DEl$%W9TL=1=40M">wattMaster</field>
                                                         </block>
                                                       </value>
                                                       <value name="B">
                                                         <shadow type="math_number" id="]H3?6[!S^?8OU}Tq#1q4">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                         <block type="variables_get" id="lRSEau:T@0l`|y;_prfz">
                                                           <field name="VAR" id="@D?1=I6dj/.p(Xq+8@}}">activePower</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <next>
                                                     <block type="comment" id="NQRiW:4qvPO_/_g]zrN4">
                                                       <field name="COMMENT">Bedingung bei Einspeisung (Verkauf)</field>
                                                       <next>
                                                         <block type="control" id="KgKhBC/re=xPvd6-a4zO">
                                                           <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                           <field name="OID">0_userdata.0.Photovoltaik.PV-Hausverbrauch</field>
                                                           <field name="WITH_DELAY">FALSE</field>
                                                           <value name="VALUE">
                                                             <block type="math_arithmetic" id="7xRPKP]pfG68Mjc^z_td" inline="false">
                                                               <field name="OP">MINUS</field>
                                                               <value name="A">
                                                                 <shadow type="math_number">
                                                                   <field name="NUM">1</field>
                                                                 </shadow>
                                                                 <block type="variables_get" id="hep(UV!AT5BD*7rp7ZDW">
                                                                   <field name="VAR" id="~PqS$DEl$%W9TL=1=40M">wattMaster</field>
                                                                 </block>
                                                               </value>
                                                               <value name="B">
                                                                 <shadow type="math_number" id="@8uR6C(!}Cdxgd[X5:BQ">
                                                                   <field name="NUM">1</field>
                                                                 </shadow>
                                                                 <block type="variables_get" id="Bw7//XozDyW6;I0XZ+;^">
                                                                   <field name="VAR" id="@D?1=I6dj/.p(Xq+8@}}">activePower</field>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </next>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </statement>
                                           <next>
                                             <block type="comment" id="/@#}F@E?(VaR3NWdp|8E">
                                               <field name="COMMENT">Master + Slave addiert</field>
                                               <next>
                                                 <block type="control" id="iWN|=KsdUNHnigm_L*`L">
                                                   <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                   <field name="OID">0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave</field>
                                                   <field name="WITH_DELAY">FALSE</field>
                                                   <value name="VALUE">
                                                     <block type="math_arithmetic" id="v8|u+o|+wH`mlay/.pxq" inline="false">
                                                       <field name="OP">ADD</field>
                                                       <value name="A">
                                                         <shadow type="math_number">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                         <block type="get_value" id="aLh[RWvw~Iys^B8B^-L5">
                                                           <field name="ATTR">val</field>
                                                           <field name="OID">plenticore.0.devices.local.ac.P</field>
                                                         </block>
                                                       </value>
                                                       <value name="B">
                                                         <shadow type="math_number">
                                                           <field name="NUM">1</field>
                                                         </shadow>
                                                         <block type="get_value" id="(dK6wM~5W,{YDM4WVK.4">
                                                           <field name="ATTR">val</field>
                                                           <field name="OID">plenticore.1.devices.local.ac.P</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <next>
                                                     <block type="comment" id="B-BgIgiV3fL6:my};bcN">
                                                       <field name="COMMENT">Wert von Smartmeter zu S7 schicken</field>
                                                       <next>
                                                         <block type="control" id=":Q@wY8XR6#uF=@.y3UG9">
                                                           <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                           <field name="OID">s7.0.DBs.DB30.PV_Smartmeter_Wirkleistung_verkaufen</field>
                                                           <field name="WITH_DELAY">FALSE</field>
                                                           <value name="VALUE">
                                                             <block type="variables_get" id="!5pOe43vCl_,(U0ICh,v">
                                                               <field name="VAR" id="@D?1=I6dj/.p(Xq+8@}}">activePower</field>
                                                             </block>
                                                           </value>
                                                         </block>
                                                       </next>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </next>
                                         </block>
                                       </next>
                                     </block>
                                   </next>
                                 </block>
                               </next>
                             </block>
                           </statement>
                          </block>
                          

                          T 1 Reply Last reply Reply Quote 0
                          • T
                            Tomate @Codierknecht last edited by

                            @codierknecht Danke erstmal.
                            Direkt reinkopiert läuft es noch nicht.
                            Da schau ich noch woran das liegt.
                            Sicher habe ich noch viel Optimierungsbedarf. (-:

                            Zum Thema "timerId=undefined" fällt dir bei dem Skript auch nichts ein, oder?

                            Codierknecht 1 Reply Last reply Reply Quote 0
                            • Codierknecht
                              Codierknecht Developer Most Active @Tomate last edited by Codierknecht

                              @tomate sagte in Javascript-Instanz ist deaktiviert (sporad. ca. nach 1 Tag):

                              Zum Thema "timerId=undefined" fällt dir bei dem Skript auch nichts ein, oder?

                              Nö - ist ja kein Timer im Script.
                              Aber warte mal ab - vielleicht kann ja eine der Koniferen etwas dazu sagen 😉

                              Hattest Du da mal mit Timeouts gespielt?
                              Schau mal in den JS Quellcode Deines Scripts - vielleicht ist da noch 'ne Leiche versteckt.
                              Kann ich mir aber eigentlich nicht vorstellen.

                              T 1 Reply Last reply Reply Quote 0
                              • T
                                Tomate @Codierknecht last edited by

                                @codierknecht
                                Hab jetzt ein wenig aufgeräumt.
                                Die Meldungen stehen aber immer noch im LOG.
                                Den Eintrag "timerId=undefined" findet mal ziemlich oft.
                                Kann mir jemand sagen, was es damit auf sich hat?

                                2023-03-22 18:53:26.815  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: setForeignState(id=s7.0.DBs.DB30.PV_Smartmeter_Wirkleistung_verkaufen, state={"val":0,"ack":false,"ts":1679507606815,"q":0,"from":"system.adapter.javascript.0","lc":1679507569781,"c":"script.js.common.Kostal.Kostal2von2"})
                                2023-03-22 18:53:27.814  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=plenticore.0.devices.local.ac.P, timerId=undefined) => {"val":0,"ack":true,"ts":1679507605830,"q":0,"from":"system.adapter.plenticore.0","user":"system.user.admin","lc":1679507443679}
                                2023-03-22 18:53:27.815  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=plenticore.1.devices.local.ac.P, timerId=undefined) => {"val":0,"ack":true,"ts":1679507605718,"q":0,"from":"system.adapter.plenticore.1","user":"system.user.admin","lc":1679507254097}
                                2023-03-22 18:53:27.815  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: setForeignState(id=0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave, state={"val":0,"ack":false,"ts":1679507607815,"q":0,"from":"system.adapter.javascript.0","lc":1679507443736,"c":"script.js.common.Kostal.Kostal2von2"})
                                2023-03-22 18:53:27.815  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave, timerId=undefined) => {"val":0,"ack":false,"ts":1679507606814,"q":0,"c":"script.js.common.Kostal.Kostal2von2","from":"system.adapter.javascript.0","user":"system.user.admin","lc":1679507443736}
                                2023-03-22 18:53:27.815  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=modbus.0.holdingRegisters.3_Active_power-, timerId=undefined) => {"val":0,"ack":true,"ts":1679504181421,"q":0,"from":"system.adapter.modbus.0","user":"system.user.admin","lc":1679504181421}
                                2023-03-22 18:53:27.815  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=modbus.0.holdingRegisters.0_Active_power+, timerId=undefined) => {"val":842.9,"ack":true,"ts":1679507607070,"q":0,"from":"system.adapter.modbus.0","user":"system.user.admin","lc":1679507607070}
                                2023-03-22 18:53:27.815  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: setForeignState(id=0_userdata.0.Photovoltaik.PV-Hausverbrauch, state={"val":842.9,"ack":false,"ts":1679507607815,"q":0,"from":"system.adapter.javascript.0","lc":1679507607815,"c":"script.js.common.Kostal.Kostal2von2"})
                                2023-03-22 18:53:27.815  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: setForeignState(id=s7.0.DBs.DB30.PV_Smartmeter_Wirkleistung_verkaufen, state={"val":0,"ack":false,"ts":1679507607815,"q":0,"from":"system.adapter.javascript.0","lc":1679507569781,"c":"script.js.common.Kostal.Kostal2von2"})
                                2023-03-22 18:53:28.815  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=plenticore.0.devices.local.ac.P, timerId=undefined) => {"val":0,"ack":true,"ts":1679507608577,"q":0,"from":"system.adapter.plenticore.0","user":"system.user.admin","lc":1679507443679}
                                2023-03-22 18:53:28.816  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=plenticore.1.devices.local.ac.P, timerId=undefined) => {"val":0,"ack":true,"ts":1679507608467,"q":0,"from":"system.adapter.plenticore.1","user":"system.user.admin","lc":1679507254097}
                                2023-03-22 18:53:28.816  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: setForeignState(id=0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave, state={"val":0,"ack":false,"ts":1679507608816,"q":0,"from":"system.adapter.javascript.0","lc":1679507443736,"c":"script.js.common.Kostal.Kostal2von2"})
                                2023-03-22 18:53:28.816  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave, timerId=undefined) => {"val":0,"ack":false,"ts":1679507607815,"q":0,"c":"script.js.common.Kostal.Kostal2von2","from":"system.adapter.javascript.0","user":"system.user.admin","lc":1679507443736}
                                2023-03-22 18:53:28.816  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=modbus.0.holdingRegisters.3_Active_power-, timerId=undefined) => {"val":0,"ack":true,"ts":1679504181421,"q":0,"from":"system.adapter.modbus.0","user":"system.user.admin","lc":1679504181421}
                                2023-03-22 18:53:28.816  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: getState(id=modbus.0.holdingRegisters.0_Active_power+, timerId=undefined) => {"val":836.3,"ack":true,"ts":1679507608131,"q":0,"from":"system.adapter.modbus.0","user":"system.user.admin","lc":1679507608131}
                                2023-03-22 18:53:28.816  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: setForeignState(id=0_userdata.0.Photovoltaik.PV-Hausverbrauch, state={"val":836.3,"ack":false,"ts":1679507608816,"q":0,"from":"system.adapter.javascript.0","lc":1679507608816,"c":"script.js.common.Kostal.Kostal2von2"})
                                2023-03-22 18:53:28.816  - info: javascript.0 (3766800) script.js.common.Kostal.Kostal2von2: setForeignState(id=s7.0.DBs.DB30.PV_Smartmeter_Wirkleistung_verkaufen, state={"val":0,"ack":false,"ts":1679507608816,"q":0,"from":"system.adapter.javascript.0","lc":1679507569781,"c":"script.js.common.Kostal.Kostal2von2"})
                                
                                
                                T 1 Reply Last reply Reply Quote 0
                                • T
                                  Tomate @Tomate last edited by

                                  Das Script von Kostal2von2:

                                  <xml xmlns="https://developers.google.com/blockly/xml">
                                    <variables>
                                      <variable id="!WZBe;{`hZ_A:/_%1~.K">Var_PV_addiere_Watt_Master_und_Watt_Slave</variable>
                                      <variable id="ddq^0tp(GPEs4g+1BS5w">Var_WirkleistungSmartMeterEinspeisung-VERKAUF</variable>
                                      <variable id="3+QuPjTrBo,!hDErGT(:">Var_WirkleistungSmartMeterVerbrauch-ZUKAUF</variable>
                                    </variables>
                                    <block type="on" id="Ov.=`e?|BF;:NKk%]0}l" x="-737" y="-287">
                                      <field name="OID">0_userdata.0.Zyklus-Blinker.1Sekunden-Takt</field>
                                      <field name="CONDITION">ne</field>
                                      <field name="ACK_CONDITION"></field>
                                      <statement name="STATEMENT">
                                        <block type="comment" id="/@#}F@E?(VaR3NWdp|8E">
                                          <field name="COMMENT">Master + Slave addiert</field>
                                          <next>
                                            <block type="control" id="iWN|=KsdUNHnigm_L*`L">
                                              <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                              <field name="OID">0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave</field>
                                              <field name="WITH_DELAY">FALSE</field>
                                              <value name="VALUE">
                                                <block type="math_arithmetic" id="v8|u+o|+wH`mlay/.pxq">
                                                  <field name="OP">ADD</field>
                                                  <value name="A">
                                                    <shadow type="math_number">
                                                      <field name="NUM">1</field>
                                                    </shadow>
                                                    <block type="get_value" id="aLh[RWvw~Iys^B8B^-L5">
                                                      <field name="ATTR">val</field>
                                                      <field name="OID">plenticore.0.devices.local.ac.P</field>
                                                    </block>
                                                  </value>
                                                  <value name="B">
                                                    <shadow type="math_number">
                                                      <field name="NUM">1</field>
                                                    </shadow>
                                                    <block type="get_value" id="(dK6wM~5W,{YDM4WVK.4">
                                                      <field name="ATTR">val</field>
                                                      <field name="OID">plenticore.1.devices.local.ac.P</field>
                                                    </block>
                                                  </value>
                                                </block>
                                              </value>
                                              <next>
                                                <block type="variables_set" id="?-p8mD1~@)HX/qJ@cX~y">
                                                  <field name="VAR" id="!WZBe;{`hZ_A:/_%1~.K">Var_PV_addiere_Watt_Master_und_Watt_Slave</field>
                                                  <value name="VALUE">
                                                    <block type="get_value" id="jD{_z|vy(SHp7u$H}}1.">
                                                      <field name="ATTR">val</field>
                                                      <field name="OID">0_userdata.0.Photovoltaik.PV_addiere_Watt_Master_und_Watt_Slave</field>
                                                    </block>
                                                  </value>
                                                  <next>
                                                    <block type="variables_set" id="*Wryv4gfA/kuYq#/xBj}">
                                                      <field name="VAR" id="ddq^0tp(GPEs4g+1BS5w">Var_WirkleistungSmartMeterEinspeisung-VERKAUF</field>
                                                      <value name="VALUE">
                                                        <block type="get_value" id="ofA-J@2Q5HfH%/e%i/jl">
                                                          <field name="ATTR">val</field>
                                                          <field name="OID">modbus.0.holdingRegisters.3_Active_power-</field>
                                                        </block>
                                                      </value>
                                                      <next>
                                                        <block type="variables_set" id="g;/Ch)9FoT{+R(gqWbOq">
                                                          <field name="VAR" id="3+QuPjTrBo,!hDErGT(:">Var_WirkleistungSmartMeterVerbrauch-ZUKAUF</field>
                                                          <value name="VALUE">
                                                            <block type="get_value" id="[+Au~;zK6Wf:h=gV7FRK">
                                                              <field name="ATTR">val</field>
                                                              <field name="OID">modbus.0.holdingRegisters.0_Active_power+</field>
                                                            </block>
                                                          </value>
                                                          <next>
                                                            <block type="comment" id="hYY`}cf(5yxmf8ApKrA5">
                                                              <field name="COMMENT">Hausverbrauch_berechnen</field>
                                                              <next>
                                                                <block type="comment" id="{]-ZugJEAj`h}8aN.:Cc">
                                                                  <field name="COMMENT">Bedingung bei Verbrauch (Zukauf)</field>
                                                                  <next>
                                                                    <block type="controls_if" id="d?Ut}rB7U;nn8h~1DTs{">
                                                                      <value name="IF0">
                                                                        <block type="logic_compare" id="!]]V*$Cx=JORAcy.#S%@">
                                                                          <field name="OP">GT</field>
                                                                          <value name="A">
                                                                            <block type="variables_get" id="9:gpf!zoOVhuHg|Xj{~^">
                                                                              <field name="VAR" id="3+QuPjTrBo,!hDErGT(:">Var_WirkleistungSmartMeterVerbrauch-ZUKAUF</field>
                                                                            </block>
                                                                          </value>
                                                                          <value name="B">
                                                                            <block type="math_number" id="zu@Q;yF5a!`g#@/m*2@[">
                                                                              <field name="NUM">0</field>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </value>
                                                                      <statement name="DO0">
                                                                        <block type="control" id="5cqKzvHOm.t0dVcgGIC{">
                                                                          <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                          <field name="OID">0_userdata.0.Photovoltaik.PV-Hausverbrauch</field>
                                                                          <field name="WITH_DELAY">FALSE</field>
                                                                          <value name="VALUE">
                                                                            <block type="math_arithmetic" id="B-`bM)2M!I+^nb-_zk;E">
                                                                              <field name="OP">ADD</field>
                                                                              <value name="A">
                                                                                <shadow type="math_number" id="W`T6v0$]V:C5j)w%%$=x">
                                                                                  <field name="NUM">1</field>
                                                                                </shadow>
                                                                                <block type="variables_get" id="lqz?y;XIQ9nnryeEWn{(">
                                                                                  <field name="VAR" id="!WZBe;{`hZ_A:/_%1~.K">Var_PV_addiere_Watt_Master_und_Watt_Slave</field>
                                                                                </block>
                                                                              </value>
                                                                              <value name="B">
                                                                                <shadow type="math_number" id="]H3?6[!S^?8OU}Tq#1q4">
                                                                                  <field name="NUM">1</field>
                                                                                </shadow>
                                                                                <block type="variables_get" id="f^I}2mTr|sEz,~C:NIay">
                                                                                  <field name="VAR" id="3+QuPjTrBo,!hDErGT(:">Var_WirkleistungSmartMeterVerbrauch-ZUKAUF</field>
                                                                                </block>
                                                                              </value>
                                                                            </block>
                                                                          </value>
                                                                        </block>
                                                                      </statement>
                                                                      <next>
                                                                        <block type="comment" id="NQRiW:4qvPO_/_g]zrN4">
                                                                          <field name="COMMENT">Bedingung bei Einspeisung (Verkauf)</field>
                                                                          <next>
                                                                            <block type="controls_if" id="3hl65%3DD-$lD.,_o#+]">
                                                                              <value name="IF0">
                                                                                <block type="logic_compare" id="=VS6OH2+t@;K4oHlf#k7">
                                                                                  <field name="OP">GT</field>
                                                                                  <value name="A">
                                                                                    <block type="variables_get" id="g{`]%J9$RVs?:6sY:`kF">
                                                                                      <field name="VAR" id="ddq^0tp(GPEs4g+1BS5w">Var_WirkleistungSmartMeterEinspeisung-VERKAUF</field>
                                                                                    </block>
                                                                                  </value>
                                                                                  <value name="B">
                                                                                    <block type="math_number" id="SQ84NCu@ftLv)om1[W}|">
                                                                                      <field name="NUM">0</field>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </value>
                                                                              <statement name="DO0">
                                                                                <block type="control" id="KgKhBC/re=xPvd6-a4zO">
                                                                                  <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                  <field name="OID">0_userdata.0.Photovoltaik.PV-Hausverbrauch</field>
                                                                                  <field name="WITH_DELAY">FALSE</field>
                                                                                  <value name="VALUE">
                                                                                    <block type="math_arithmetic" id="7xRPKP]pfG68Mjc^z_td">
                                                                                      <field name="OP">MINUS</field>
                                                                                      <value name="A">
                                                                                        <shadow type="math_number">
                                                                                          <field name="NUM">1</field>
                                                                                        </shadow>
                                                                                        <block type="variables_get" id="$`H~WP,@ptOJR3dgpJ$#">
                                                                                          <field name="VAR" id="!WZBe;{`hZ_A:/_%1~.K">Var_PV_addiere_Watt_Master_und_Watt_Slave</field>
                                                                                        </block>
                                                                                      </value>
                                                                                      <value name="B">
                                                                                        <shadow type="math_number" id="@8uR6C(!}Cdxgd[X5:BQ">
                                                                                          <field name="NUM">1</field>
                                                                                        </shadow>
                                                                                        <block type="variables_get" id="9oc]w^EclbxJWjyjmr-i">
                                                                                          <field name="VAR" id="ddq^0tp(GPEs4g+1BS5w">Var_WirkleistungSmartMeterEinspeisung-VERKAUF</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </value>
                                                                                </block>
                                                                              </statement>
                                                                              <next>
                                                                                <block type="comment" id="B-BgIgiV3fL6:my};bcN">
                                                                                  <field name="COMMENT">Wert von Smartmeter zu S7 schicken</field>
                                                                                  <next>
                                                                                    <block type="control" id=":Q@wY8XR6#uF=@.y3UG9">
                                                                                      <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                                                      <field name="OID">s7.0.DBs.DB30.PV_Smartmeter_Wirkleistung_verkaufen</field>
                                                                                      <field name="WITH_DELAY">FALSE</field>
                                                                                      <value name="VALUE">
                                                                                        <block type="variables_get" id="gOkcNj..V_X{WMO!QLM!">
                                                                                          <field name="VAR" id="ddq^0tp(GPEs4g+1BS5w">Var_WirkleistungSmartMeterEinspeisung-VERKAUF</field>
                                                                                        </block>
                                                                                      </value>
                                                                                    </block>
                                                                                  </next>
                                                                                </block>
                                                                              </next>
                                                                            </block>
                                                                          </next>
                                                                        </block>
                                                                      </next>
                                                                    </block>
                                                                  </next>
                                                                </block>
                                                              </next>
                                                            </block>
                                                          </next>
                                                        </block>
                                                      </next>
                                                    </block>
                                                  </next>
                                                </block>
                                              </next>
                                            </block>
                                          </next>
                                        </block>
                                      </statement>
                                    </block>
                                  </xml>
                                  
                                  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

                                  606
                                  Online

                                  32.0k
                                  Users

                                  80.4k
                                  Topics

                                  1.3m
                                  Posts

                                  3
                                  37
                                  1323
                                  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