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>