Hello à tous, je me suis posé un peu sur le sujet en traduisant et m’inspirant du forum iobroker en allemand (Pas de lien possible j’ai du recréer un compte j’ai perdu mes accès github…, je suis Wiwi le dev original de tydom2mqtt
)
Du coup toute l’automatisation se passe sur iobroker, ça permet de garder une gestion de l’énergie même si HA est down, ce que je trouve pas mal…
Un fichier de l’automatisation en cours ici, à importer sous bloky (dans l’instance javascript sous iobroker), il vous faut aussi créer une variable « PowerAvailable » dans les objets) :
Le premier if est pour charger la nuit pendant 2h ou jusqu’à 95% et ensuite c’est proche de l’option CT dans l’app Zendure, n’oubliez pas de retirer tout « plan » de gestion dans l’app.
<xml xmlns="https://developers.google.com/blockly/xml">
<block type="on_ext" id="n._n/=eOXkf;Z1~fZ?bX" x="80" y="-192">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="BFe.YK%XHc?YYHP6tf4O">
<field name="oid">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="comment" id="-Lkh|F82sn.`Kii9s`[,">
<field name="COMMENT">Calcul surplus</field>
<next>
<block type="update" id=".$@*H8c,!Y^K9MzHG;8F">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="p@Z^bs^Sa)GyFK!UvGur">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id=":RDkpD4Nm~wv_L9e-lmS">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="|6m-!pKH=)Bn646@gI.=">
<field name="NUM">0</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="qbL=vtU@J*M$d{!].s?2">
<field name="ATTR">val</field>
<field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="hWYJv*IU#APgk(DaJu1j">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id=":P_7R|aB}i|:[Ahzw}hl" disabled="true">
<mutation elseif="2"></mutation>
<value name="IF0">
<block type="logic_multi_or" id="0^%063NM8C|]+|Y^,{{!">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
<value name="OR0">
<block type="logic_compare" id=",^TRf$E_k[xsEb.)YTCS">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id=",+s(g8G?}{3)=L0j6+*w">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
</block>
</value>
<value name="B">
<block type="math_number" id=":57a.G0]hYfFcHh]w$GK">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<value name="OR1">
<block type="logic_compare" id="akiZjd{}e*YX$g?teIDN">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="02^_7SC*sD]rktW6,?9S">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.packState</field>
</block>
</value>
<value name="B">
<block type="text" id="f;+VH`//l=JE5Wp#~6XW">
<field name="TEXT">Idle</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="comment" id="~mzW+OY%ClEAq3{Q#GTT">
<field name="COMMENT">AC Idle mode</field>
<next>
<block type="update" id="hSi6dW6[m9V5s4Ta2|@8">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="Tz`H|l5.ol,A.6)8x.Ix">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="(RXch=MTLv_gDE,.aIV/">
<field name="NUM">0</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="TGF?-~xB418},:X~4rmk">
<field name="ATTR">val</field>
<field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="logic_compare" id="ELe`lCY3d%EA3i:goOvq">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="8FbyiazgnwqKjS:4Q27K">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
</block>
</value>
<value name="B">
<block type="math_number" id=")Vy^-]3=m2Xw1/#rjI34">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="comment" id="%kkT]|EoIrQPH3`gO;B2">
<field name="COMMENT">AC Input mode (Charge)</field>
<next>
<block type="update" id="4w)%$.)Tgm.u5fJN~4Zn">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="q}o0P$0unF:*dXnoHPUz">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="(%P=|?I5bKRJ.Z_y6Gl]">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="3fVOX6ooAJ]QCDoXKb$R">
<field name="NUM">0</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="@J~Xyn*j0ScVu=7.s2~J">
<field name="ATTR">val</field>
<field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="n?kBf=Hnx-En:reu149|">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
<value name="IF2">
<block type="logic_compare" id="2x/F:GRm(^Mc.ZM=~aeE">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="t;+v1xqt;fd0@bXQ=i:U">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
</block>
</value>
<value name="B">
<block type="math_number" id="q6X.(T-e%4QV0?y_ClvS">
<field name="NUM">2</field>
</block>
</value>
</block>
</value>
<statement name="DO2">
<block type="comment" id="Zx6fCj_MGvY)HljlUdXz">
<field name="COMMENT">AC Output mode (discharge)</field>
<next>
<block type="update" id="WT;3%6*a-q^;_^68z9v$">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="2a}r{KOp9BxrXM|K+x/q">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="i@4n~/rNK]]:1^7/*`9T">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="]3+F;ke1!oP;}J8v}6Ht">
<field name="NUM">0</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="w:)dxez2D;mW+S@XfJec">
<field name="ATTR">val</field>
<field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="Yb(fNd3Ls[HBq/EWsD#p">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.gridInputPower</field>
</block>
</value>
</block>
</value>
</block>
</next>
</block>
</statement>
<next>
<block type="controls_if" id="jB|cjHX2.!9Bvkr@Sy=H">
<mutation else="1"></mutation>
<comment pinned="false" h="80" w="160">Charge at night</comment>
<value name="IF0">
<block type="logic_multi_and" id="Fa@t{dcmVNo,gNQ8Z,1U">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="3"></mutation>
<value name="AND0">
<block type="logic_compare" id="C=IAvN]t`Gs:U..{JtD|">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id=":flu_TDd5HVu[(xn{FB:">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.electricLevel</field>
</block>
</value>
<value name="B">
<block type="get_value" id="INy%tL@wKNh!t/JRFkLk">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.minSoc</field>
</block>
</value>
</block>
</value>
<value name="AND1">
<block type="time_compare" id="EEbh$8bzw_}6:ww$x?0.">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
<field name="OPTION">>=</field>
<field name="START_TIME">03:30</field>
</block>
</value>
<value name="AND2">
<block type="time_compare" id="7FpsQon15/nqqXW#hyP)">
<mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false"></mutation>
<field name="OPTION"><=</field>
<field name="START_TIME">05:45</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="L{R*%*V8A?=Ilu6e+/jX">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setOutputLimit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="zJ.Y7i3T(2[Qp=?i3g)7">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="control" id="D;M`iVP/}bjPM.eVe`$*">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="%8(uXlovQ-f#_!Nlw=Ye">
<field name="NUM">1200</field>
</block>
</value>
<next>
<block type="comment" id="zwvH%x{n.+%a/0%0@;gg">
<field name="COMMENT">Switch Mode AC to 1 (Charge the battery, import from house to battery)</field>
<next>
<block type="controls_if" id="YT:~Jm7KXM/26^w8-hZF">
<value name="IF0">
<block type="logic_compare" id="?8Q}ssP|=mooq2fkM#]I">
<field name="OP">NEQ</field>
<value name="A">
<block type="get_value" id="l^x}F}Ic#KIfDTtIX@+P">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
</block>
</value>
<value name="B">
<block type="math_number" id="DWC(N)Gq`D!XMitwY8]F">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="pYrR3-%rFD;H?eYp.^Y*">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id=")`[srlklDasHn#8dRq~L">
<field name="NUM">1</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<statement name="ELSE">
<block type="controls_if" id="ceVh]OqX#F59jQX=_A82">
<mutation elseif="1"></mutation>
<value name="IF0">
<block type="logic_multi_and" id="%!0.^@e~9C*^t=2?`~SD">
<mutation xmlns="http://www.w3.org/1999/xhtml" items="2"></mutation>
<value name="AND0">
<block type="logic_compare" id="3J57ER~UTsa1]IB008kw">
<field name="OP">EQ</field>
<value name="A">
<block type="logic_compare" id="7=-OLc-i%RlH!#?%7|6Z">
<field name="OP">GT</field>
<value name="A">
<block type="get_value" id="E[8j+u,*c|%_M@T-U;}@">
<field name="ATTR">val</field>
<field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</block>
</value>
<value name="B">
<block type="math_number" id="LB?HhKYNYRsU4n.r#%?:">
<field name="NUM">10</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="a}kd)V:|%JI0*UOje:dN">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<value name="AND1">
<block type="logic_compare" id="{^l6PG=~A^Pk1?RN!Pj=">
<field name="OP">EQ</field>
<value name="A">
<block type="logic_compare" id="hi]@P[WR.1XDYrEa2L1H">
<field name="OP">GT</field>
<value name="A">
<block type="get_value" id="5OG^!C?7Qm2u!~0d7@9h">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.electricLevel</field>
</block>
</value>
<value name="B">
<block type="get_value" id="xni+zl}^6pJx;QRt;tJ$">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.minSoc</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="/w|?*R!VzYZ_vK;ws0t^">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="comment" id="K5DDxom?`tOS%L_%zZ:(">
<field name="COMMENT">The house is importing power from the grid</field>
<next>
<block type="comment" id="*OmZxLQ02d/-/$Stjw*b">
<field name="COMMENT">Start discharging the battery when PV is lower</field>
<next>
<block type="comment" id="#sGXaA}7FOlrqJ_f`nXC">
<field name="COMMENT">Start discharging the battery the surplus is -20W.</field>
<next>
<block type="comment" id="BTTPMWm/de,d7~Ti|/I:">
<field name="COMMENT">Calculation of the power surplus</field>
<next>
<block type="update" id="fce@-pMl:1kZ%lAb1IM5">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id=",=I/6z]|3NAu8ylXEr|)">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id=";D#iA~8Yj630O($CMi?N">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id=";f|).sI:pOi1s(r$G`8b">
<field name="NUM">0</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="XmrX=:RmGSQt*7n%!~|o">
<field name="ATTR">val</field>
<field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="hm2nF$NvSUz9w[Ph*f/d">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
</block>
</value>
</block>
</value>
<next>
<block type="control" id="=o2{GPV4w=:]aci4|vY?">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setOutputLimit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="convert_tonumber" id="Rj3Uaj4{~c;!x!eGEeXD">
<value name="VALUE">
<block type="math_constrain" id="7~D[JsL|_N~VeFwt`pE`">
<value name="VALUE">
<shadow type="math_number" id="(9UIPj)LKTV=|#F^uD,q">
<field name="NUM">50</field>
</shadow>
<block type="math_arithmetic" id="TvZBnp(B!y!/Hr[yexE9">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="l(:X{x7E+4zu10Q|5@!j">
<field name="NUM">1</field>
</shadow>
<block type="math_round" id="_)86b/RxGH%v7o10%~/M">
<field name="OP">ROUNDUP</field>
<value name="NUM">
<shadow type="math_number" id="gyY9z7s?_CrnAoD0q10E">
<field name="NUM">3.1</field>
</shadow>
<block type="get_value" id="SQT#4`Dl*V==lu[7Mku8">
<field name="ATTR">val</field>
<field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="ejRA-VP8RdO[Iz7W6[$B">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="!9ne=tscadHC,quP|dlU">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.packInputPower</field>
</block>
</value>
</block>
</value>
<value name="LOW">
<shadow type="math_number" id="k$b@7b)3I?3u8R,%^no(">
<field name="NUM">0</field>
</shadow>
</value>
<value name="HIGH">
<shadow type="math_number" id="x8}*eX!Nsg$Dq)p(Q9S_">
<field name="NUM">1200</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="control" id="O*;k.`?nQqdF;AGd[Yjl">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="0$zTn8u`[.f`wpK+*xUS">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="comment" id="-~_5VyBb;ylrRC)CVgRk">
<field name="COMMENT">Switch Mode AC to 2 (Discharge the battery to house)</field>
<next>
<block type="controls_if" id="Qz5c%hJbta[0TsYo42G)">
<value name="IF0">
<block type="logic_compare" id="Iyp`,~@V86|af4mY^[k6">
<field name="OP">NEQ</field>
<value name="A">
<block type="get_value" id="Le+Q8Dtj[2q|fSs;jaVB">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
</block>
</value>
<value name="B">
<block type="math_number" id="c4c`K=AB02Qy7;CIS;C2">
<field name="NUM">2</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="[xw_(|,6{QxRl3l}OU|e">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="For~)Qm/@`puW%Y=Lwfo">
<field name="NUM">2</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<value name="IF1">
<block type="logic_compare" id="Y$yYtw;D=([~?KRGZ[s(">
<field name="OP">EQ</field>
<value name="A">
<block type="logic_compare" id="2;sQaVnUey[9GSjt*Bv]">
<field name="OP">LT</field>
<value name="A">
<block type="get_value" id=",nDugIZd,#;bA7?-_vS~">
<field name="ATTR">val</field>
<field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</block>
</value>
<value name="B">
<block type="math_number" id=".H-dr:8Nhv|Ei|VV4b8.">
<field name="NUM">-40</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="BJVl}ai*P{@r:(=X1z,-">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="comment" id="G9P2tg|9szmpM|qUeCL{">
<field name="COMMENT">The house is producting too much</field>
<next>
<block type="comment" id="/@qBjbc!3z8~W#5,%$[_">
<field name="COMMENT">Calculation of the power surplus</field>
<next>
<block type="update" id="F|]m4r4](W#[I.ng@TV.">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_arithmetic" id="r[=XTMA%cnbIn^Pee0fl">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="=+EzH#q|HDP)r|mgQ;@e">
<field name="NUM">1</field>
</shadow>
<block type="math_arithmetic" id="}zN=Zw6/H0n=h[qE7/4A">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="$SPNl@SIOfLS#XuJim?X">
<field name="NUM">0</field>
</shadow>
</value>
<value name="B">
<shadow type="math_number" id="|n97^C`9Q^U-#7dXwk^l">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="A~X6.C[D;6{m0OUoaQNn">
<field name="ATTR">val</field>
<field name="OID">alias.0.shelly.0.SHEM-3#C8C9A316D6FC#1.Emeter1.Power</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="LoBc9oA}{xbY)akBMXqT">
<field name="NUM">1</field>
</shadow>
<block type="get_value" id="VI*:6et}%oHfeYDXTXC3">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.gridInputPower</field>
</block>
</value>
</block>
</value>
<next>
<block type="comment" id="?C:dB}qv6J|If!(XDnSL">
<field name="COMMENT">Change input limit to the Power we can consume - 40w to have some buffer</field>
<next>
<block type="control" id="8ES?0+H.?*6WB)Db,A95" disabled="true">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="convert_tonumber" id="a#?Rc,ig.mU;stV[6|y+">
<value name="VALUE">
<block type="math_arithmetic" id="7f2rA,rq(G(~e~r-2~^Z">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="ecZ@g`|]9L~62{9uVOi`">
<field name="NUM">1</field>
</shadow>
<block type="math_round" id="5wqtClm)6p{$Z494]D^1">
<field name="OP">ROUND</field>
<value name="NUM">
<shadow type="math_number" id="gyY9z7s?_CrnAoD0q10E">
<field name="NUM">3.1</field>
</shadow>
<block type="get_value" id="@[g^nLwrxmwdO31{d5@x">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="TrR3-E94Fn#4%z?Z,8V4">
<field name="NUM">50</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="control" id="lG=w=%Mt=EE)AWSwDDfI">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setInputLimit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="convert_tonumber" id="/edP|/%tG$6rB?UV9~#(">
<value name="VALUE">
<block type="math_constrain" id="N@(}(9=%fUuo:LKcxxP+">
<value name="VALUE">
<shadow type="math_number" id="(9UIPj)LKTV=|#F^uD,q">
<field name="NUM">50</field>
</shadow>
<block type="math_arithmetic" id="6HZ~l.GRi9WQ.:9C}MuF">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="l(:X{x7E+4zu10Q|5@!j">
<field name="NUM">1</field>
</shadow>
<block type="math_round" id="iTwn_EU)!aIEeVKGFg?C">
<field name="OP">ROUNDDOWN</field>
<value name="NUM">
<shadow type="math_number" id="gyY9z7s?_CrnAoD0q10E">
<field name="NUM">3.1</field>
</shadow>
<block type="get_value" id=",M}iF=|4Scd+SYiq)aWg">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
</block>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="ejRA-VP8RdO[Iz7W6[$B">
<field name="NUM">40</field>
</shadow>
</value>
</block>
</value>
<value name="LOW">
<shadow type="math_number" id=";i#uI}{rB+`e3tFfmxD9">
<field name="NUM">0</field>
</shadow>
</value>
<value name="HIGH">
<shadow type="math_number" id=".F,g6Vp9M@m5!*lW[w,t">
<field name="NUM">1240</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="control" id="34Fj3#mI1//FSf%/AZQ[">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.setOutputLimit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="da,ap^iQ:!:vioc[Iavx">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="comment" id="s=CQ}cD.(eCDDHEYMwJ=">
<field name="COMMENT">Switch Mode AC to 1 (Charge the battery, import from house to battery)</field>
<next>
<block type="controls_if" id="zWBpv/M^Z*Hl~{|0SIgB">
<value name="IF0">
<block type="logic_compare" id="Sp-N#3rJE0=_+ju?F}MQ">
<field name="OP">NEQ</field>
<value name="A">
<block type="get_value" id="9_3;D0BxXX1C:7q/A-vl">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
</block>
</value>
<value name="B">
<block type="math_number" id="`4-mf4jVB+^zhcwu$L=F">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="eY$rZNZ)?/teNH{=I/SD">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_number" id="KNdgbs3@6zr`7-z^3[Wa">
<field name="NUM">1</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
<block type="logic_compare" id="o#RD;!-E_QzT*GA5`VsB" x="274" y="202">
<field name="OP">NEQ</field>
<value name="A">
<block type="get_value" id="N!0b2d0tYmPOf)Ns)L3T">
<field name="ATTR">val</field>
<field name="OID">zendure-solarflow.0.gDa3tb.ad4rGQV8.control.acMode</field>
</block>
</value>
<value name="B">
<block type="math_number" id="hSj*yRQ?aB_Oh@aS}n5n">
<field name="NUM">1</field>
</block>
</value>
</block>
<block type="math_number" id="GES,ju|GwFK@si2!WNFW" x="616" y="429">
<field name="NUM">50</field>
</block>
<block type="logic_compare" id="ed49_,`_-D#j|oMjn~F*" x="862" y="463">
<field name="OP">EQ</field>
<value name="A">
<block type="logic_compare" id="Y?w)Lq|I4sM~c~Rv)8,E">
<field name="OP">LT</field>
<value name="A">
<block type="get_value" id="Muelu(c~OXl$XM~ej8AL">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
</block>
</value>
<value name="B">
<block type="math_number" id="peDLLzc7@$@xupw,4?sK">
<field name="NUM">-40</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="tw]lrF5_HzIg1y_p]rS*">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
<block type="logic_compare" id="G_4D1.-E}b39`tK,`p@h" x="713" y="763">
<field name="OP">EQ</field>
<value name="A">
<block type="logic_compare" id=")4oG(hBh|woVdp?U$Z/J">
<field name="OP">GTE</field>
<value name="A">
<block type="get_value" id="b#SXNQu8zasH2]DmJ/+O">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.ZendureControl.PowerAvailable</field>
</block>
</value>
<value name="B">
<block type="math_number" id="xy[}^j;9IX?1xZaDWLP2">
<field name="NUM">25</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="^Xvl!s^SoM`S_|8(_eNe">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</xml>