@liv-in-sky
Anbei beide Skripte:
Skript "Gaszähler":
<xml xmlns="https://developers.google.com/blockly/xml">
<block type="create" id="O0.%:4f-:Pqkysp}DPdK" x="63" y="-37">
<field name="NAME">GaszaehlerStand</field>
<value name="VALUE">
<block type="math_number" id="DhL1vz/Iy1;/}/)[k9FO">
<field name="NUM">0</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="$(AthiGYY3W!+XI%po/t">
<field name="TEXT">{"type": "number", "unit": "m³"}</field>
</block>
</value>
<next>
<block type="create" id="kt:st]g_7HQ~1,AVg(+C">
<field name="NAME">GaszaehlerStandkWh</field>
<value name="VALUE">
<block type="math_number" id="#Pt*uq1EN[v.o|eC$}9c">
<field name="NUM">0</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="bWM6wLsF^Y~MSK#E$4}0">
<field name="TEXT">{"type": "number", "unit": "kWh"}</field>
</block>
</value>
<next>
<block type="create" id="c~W+Vn@gO~$w,H9,3xML">
<field name="NAME">GaszaehlerStandkWhAktuell</field>
<value name="VALUE">
<block type="math_number" id="6~||2y3P4g=*Gap6xyu(">
<field name="NUM">0</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="uv{-J@N8j|XPi-fZ;Lc]">
<field name="TEXT">{"type": "number", "unit": "kWh"}</field>
</block>
</value>
<next>
<block type="on" id="[Aae;WUw?/GQLLaSi|YP">
<field name="OID">rpi2.0.gpio.23.state</field>
<field name="CONDITION">true</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="update" id="{Fr+[nvsyzsRW=R)4u{|" inline="false">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.GaszaehlerStand</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="J$]R.`;08=+yt0]}Ii|*" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="(8#e7nEvA)961d@}=f1e">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="CUh_iTk5%z6jmF=-I~}Y">
<field name="ATTR">val</field>
<field name="OID">javascript.0.GaszaehlerStand</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="UpA:b_2XlkBjbm_gL8bq">
<field name="NUM">0.01</field>
</shadow>
</value>
</block>
</value>
</block>
</statement>
<next>
<block type="on" id="|6!Nh%NKoNreoIx{kE(B">
<field name="OID">javascript.0.GaszaehlerStand</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="comment" id="gz7=_OL%2?bU~j;XKk%R">
<field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
<next>
<block type="update" id="8$E,+yL|3cVhOf:%4~@W" inline="false">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.GaszaehlerStandkWh</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_rndfixed" id=":a7CEg1}#$XfI]rAO}2/">
<field name="n">1</field>
<value name="x">
<shadow type="math_number" id="Cm#rg^1=.kzHerEE(q1G">
<field name="NUM">3.1234</field>
</shadow>
<block type="math_arithmetic" id="P~7p{TAN8J!hbi}wF=,s" inline="false">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="_zw?QIdjf[qQd_(c(X(V">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="h/K]6epkq4eEmczq#XW4" inline="false">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="cr[7/qN25UTSH_]kjR/S">
<field name="NUM">1</field>
</shadow>
<block type="on_source" id="-Vo;;;BDSiGRGu.Y~q0L">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="UNm.pI?(Vmrk*-{~Q!hs">
<field name="NUM">0.9595</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="K=xmEI^vFAvsM0@aV]/G">
<field name="NUM">10.247</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
<next>
<block type="on" id="p6?`i9$CD@7{adfD}:X=">
<field name="OID">javascript.0.GaszaehlerStand</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="comment" id="-w)F88(KT~jIIR#NO3-I">
<field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
<next>
<block type="update" id="}u?BJ{W0jL$`@jpcqGO:" inline="false">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.GaszaehlerStandkWhAktuell</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id=")h+LcW=80vV}aRvLgIST" inline="false">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="O!]xlfx~u*yAG@W/L8Yp" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="Y;HNKZ~b$}0Yv3Sd{qyN">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id=")O/%xa,c|yK}UxP*=I%N">
<field name="ATTR">val</field>
<field name="OID">javascript.0.GaszaehlerStandkWh</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="6hdg/Eh$E6Ze]y|UN-Zm">
<field name="NUM">1048.48</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="t]!r:c[xdiI8}:y~GHwu">
<field name="NUM">44148</field>
</shadow>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</xml>
<xml xmlns="https://developers.google.com/blockly/xml">
<block type="create" id="O0.%:4f-:Pqkysp}DPdK" x="63" y="-37">
<field name="NAME">GaszaehlerStand</field>
<value name="VALUE">
<block type="math_number" id="DhL1vz/Iy1;/}/)[k9FO">
<field name="NUM">0</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="$(AthiGYY3W!+XI%po/t">
<field name="TEXT">{"type": "number", "unit": "m³"}</field>
</block>
</value>
<next>
<block type="create" id="kt:st]g_7HQ~1,AVg(+C">
<field name="NAME">GaszaehlerStandkWh</field>
<value name="VALUE">
<block type="math_number" id="#Pt*uq1EN[v.o|eC$}9c">
<field name="NUM">0</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="bWM6wLsF^Y~MSK#E$4}0">
<field name="TEXT">{"type": "number", "unit": "kWh"}</field>
</block>
</value>
<next>
<block type="create" id="c~W+Vn@gO~$w,H9,3xML">
<field name="NAME">GaszaehlerStandkWhAktuell</field>
<value name="VALUE">
<block type="math_number" id="6~||2y3P4g=*Gap6xyu(">
<field name="NUM">0</field>
</block>
</value>
<value name="COMMON">
<block type="text" id="uv{-J@N8j|XPi-fZ;Lc]">
<field name="TEXT">{"type": "number", "unit": "kWh"}</field>
</block>
</value>
<next>
<block type="on" id="[Aae;WUw?/GQLLaSi|YP">
<field name="OID">rpi2.0.gpio.23.state</field>
<field name="CONDITION">true</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="update" id="{Fr+[nvsyzsRW=R)4u{|" inline="false">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.GaszaehlerStand</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="J$]R.`;08=+yt0]}Ii|*" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="(8#e7nEvA)961d@}=f1e">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="CUh_iTk5%z6jmF=-I~}Y">
<field name="ATTR">val</field>
<field name="OID">javascript.0.GaszaehlerStand</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="UpA:b_2XlkBjbm_gL8bq">
<field name="NUM">0.01</field>
</shadow>
</value>
</block>
</value>
</block>
</statement>
<next>
<block type="on" id="|6!Nh%NKoNreoIx{kE(B">
<field name="OID">javascript.0.GaszaehlerStand</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="comment" id="gz7=_OL%2?bU~j;XKk%R">
<field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
<next>
<block type="update" id="8$E,+yL|3cVhOf:%4~@W" inline="false">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.GaszaehlerStandkWh</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_rndfixed" id=":a7CEg1}#$XfI]rAO}2/">
<field name="n">1</field>
<value name="x">
<shadow type="math_number" id="Cm#rg^1=.kzHerEE(q1G">
<field name="NUM">3.1234</field>
</shadow>
<block type="math_arithmetic" id="P~7p{TAN8J!hbi}wF=,s" inline="false">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="_zw?QIdjf[qQd_(c(X(V">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="h/K]6epkq4eEmczq#XW4" inline="false">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="cr[7/qN25UTSH_]kjR/S">
<field name="NUM">1</field>
</shadow>
<block type="on_source" id="-Vo;;;BDSiGRGu.Y~q0L">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="UNm.pI?(Vmrk*-{~Q!hs">
<field name="NUM">0.9595</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="K=xmEI^vFAvsM0@aV]/G">
<field name="NUM">10.247</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
<next>
<block type="on" id="p6?`i9$CD@7{adfD}:X=">
<field name="OID">javascript.0.GaszaehlerStand</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="comment" id="-w)F88(KT~jIIR#NO3-I">
<field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
<next>
<block type="update" id="}u?BJ{W0jL$`@jpcqGO:" inline="false">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.GaszaehlerStandkWhAktuell</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id=")h+LcW=80vV}aRvLgIST" inline="false">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="O!]xlfx~u*yAG@W/L8Yp" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="Y;HNKZ~b$}0Yv3Sd{qyN">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id=")O/%xa,c|yK}UxP*=I%N">
<field name="ATTR">val</field>
<field name="OID">javascript.0.GaszaehlerStandkWh</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="6hdg/Eh$E6Ze]y|UN-Zm">
<field name="NUM">1048.48</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="t]!r:c[xdiI8}:y~GHwu">
<field name="NUM">44148</field>
</shadow>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</xml>
Skript2 "Gaszähler_2 mit entprellzeit 1000ms":
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="1StR`seQeUQb`H_z!#DP">impulse</variable>
<variable type="timeout" id="timeout">timeout</variable>
</variables>
<block type="variables_set" id="CYMfwYP4Y[~Z;gpBdX@D" x="62" y="362">
<field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
<value name="VALUE">
<block type="math_round" id="sr`@`$#f3?`,+iEloksL">
<field name="OP">ROUND</field>
<value name="NUM">
<shadow type="math_number" id="9]vTD}|XWIv:xGe]0r9~">
<field name="NUM">3.1</field>
</shadow>
<block type="math_arithmetic" id="%CD,R)X,M6RF!Y+Wld/z">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="rsxHWJNVxs]{I].bJ.j!">
<field name="NUM">100</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="[iT+)d{;#?aF(}S4a$mm">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="CUh_iTk5%z6jmF=-I~}Y">
<field name="ATTR">val</field>
<field name="OID">javascript.0.GaszaehlerStand</field>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="on" id="[Aae;WUw?/GQLLaSi|YP">
<field name="OID">rpi2.0.gpio.23.state</field>
<field name="CONDITION">gt</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="controls_if" id=".8+?7#XtnwL8wSR$)I7I">
<value name="IF0">
<block type="logic_negate" id="zXX?d|iliQ_h*SR.+(RD">
<value name="BOOL">
<block type="timeouts_gettimeout" id="c#x{Jf@)jg!OgtA84Uv^">
<field name="NAME">timeout</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="timeouts_settimeout" id="Z!VN*vvC?muiLV8x-3=,">
<field name="NAME">timeout</field>
<field name="DELAY">1000</field>
<field name="UNIT">ms</field>
<statement name="STATEMENT">
<block type="timeouts_cleartimeout" id="?;w6?OB{?Xc?z=Wt@cLQ">
<field name="NAME">timeout</field>
</block>
</statement>
<next>
<block type="math_change" id="`/[H3+Ij3nE00b.+0)i~">
<field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
<value name="DELTA">
<shadow type="math_number" id="oRDL[;AKGlhn0,~F-#15">
<field name="NUM">1</field>
</shadow>
</value>
<next>
<block type="update" id="{Fr+[nvsyzsRW=R)4u{|">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.GaszaehlerStand</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="30_K7,K8pZwo/**.A9)M">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number" id="/4LUx#BMga1iIphZYSY#">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="*o~eO#%{e#tFNV{HqlnS">
<field name="VAR" id="1StR`seQeUQb`H_z!#DP">impulse</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="412o~m?jItv#F.Y-ynTU">
<field name="NUM">100</field>
</shadow>
</value>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
<next>
<block type="on" id="|6!Nh%NKoNreoIx{kE(B">
<field name="OID">javascript.0.GaszaehlerStand</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="comment" id="gz7=_OL%2?bU~j;XKk%R">
<field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
<next>
<block type="update" id="8$E,+yL|3cVhOf:%4~@W">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.GaszaehlerStandkWh</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_rndfixed" id=":a7CEg1}#$XfI]rAO}2/">
<field name="n">1</field>
<value name="x">
<shadow type="math_number" id="Cm#rg^1=.kzHerEE(q1G">
<field name="NUM">3.1234</field>
</shadow>
<block type="math_arithmetic" id="P~7p{TAN8J!hbi}wF=,s" inline="false">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="_zw?QIdjf[qQd_(c(X(V">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="h/K]6epkq4eEmczq#XW4" inline="false">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="cr[7/qN25UTSH_]kjR/S">
<field name="NUM">1</field>
</shadow>
<block type="on_source" id="-Vo;;;BDSiGRGu.Y~q0L">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="UNm.pI?(Vmrk*-{~Q!hs">
<field name="NUM">0.9595</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="K=xmEI^vFAvsM0@aV]/G">
<field name="NUM">10.247</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
<next>
<block type="on" id="p6?`i9$CD@7{adfD}:X=">
<field name="OID">javascript.0.GaszaehlerStand</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="comment" id="-w)F88(KT~jIIR#NO3-I">
<field name="COMMENT">m³ * Zustandszahl * Brennwert</field>
<next>
<block type="update" id="}u?BJ{W0jL$`@jpcqGO:">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">javascript.0.GaszaehlerStandkWhAktuell</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id=")h+LcW=80vV}aRvLgIST" inline="false">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="O!]xlfx~u*yAG@W/L8Yp" inline="false">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="Y;HNKZ~b$}0Yv3Sd{qyN">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id=")O/%xa,c|yK}UxP*=I%N">
<field name="ATTR">val</field>
<field name="OID">javascript.0.GaszaehlerStandkWh</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="6hdg/Eh$E6Ze]y|UN-Zm">
<field name="NUM">1048.48</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="t]!r:c[xdiI8}:y~GHwu">
<field name="NUM">44148</field>
</shadow>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</xml>
Vielen Dank für eure Hilfe. Ist echt komisch dass beide Skripte Wochen einwandfrei laufen und dann von dem einen Tag auf den anderen sich anscheinend gegenseitig "zwicken"...
Ist es möglich beide Skripte in einem zusammenzufassen? Würde das das Thema auf einfache Art lösen?
Vielen Dank für alles
GLGR
Kris