Hi,
Ich habe es mir einfach gemacht und ein Blockly geschrieben, das den Icon Pfad in einen eigenen Datenpunkt schreibt. In der vis referenziere ich als Bildpfad auf den DP.
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="-5qE{53gUXm~XDoCvrx4">SoC</variable>
<variable id="y;5+d8!WE-yi(I534HSb">EAutoKapa</variable>
<variable id="V=[CbG9$B2^z*A$.tROA">SoC100</variable>
<variable id="u,9.sks(Ks9Y9sJnRH{K">ReichweiteEAuto</variable>
</variables>
<block type="comment" id="}qR0o?gc,*}R%HVXV.=x" x="-762" y="-487">
<field name="COMMENT">Setzen des richtigen Icons für das Batterielevel</field>
<next>
<block type="comment" id="/$aM6UxFi|}qDJZA*`/Q">
<field name="COMMENT">Sowie Restreichweite berechnen</field>
<next>
<block type="schedule" id="mp^O#T~*ho++g$_mP..I">
<field name="SCHEDULE">* * * * *</field>
<statement name="STATEMENT">
<block type="variables_set" id="zX!]]~l%4iRSAc,8e]0d">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
<value name="VALUE">
<block type="get_value" id="G75uGiKYgGJV$7_9kWXg">
<field name="ATTR">val</field>
<field name="OID">mqtt.0.openWB.lp.1.%Soc</field>
</block>
</value>
<next>
<block type="variables_set" id="}0dd:6n-XMsq:O=,_-DP">
<field name="VAR" id="y;5+d8!WE-yi(I534HSb">EAutoKapa</field>
<value name="VALUE">
<block type="get_value" id=".BG?-S8H/AA%+Z:x}A0y">
<field name="ATTR">val</field>
<field name="OID">0_userdata.0.EigeneDatenpunkte.openWB.EAutoBatterieKapazitaet</field>
</block>
</value>
<next>
<block type="variables_set" id="F4Nz4Cgliag+LWr,S?)M">
<field name="VAR" id="V=[CbG9$B2^z*A$.tROA">SoC100</field>
<value name="VALUE">
<block type="math_arithmetic" id="V).1*yaTQ,8p@]c{1X;%">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number" id="X4YcJG^S@j?XRh238_($">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="al/$emS[R3nc.x(Ge#MH">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="nYT*Q0J?4_.H(o6(|M:;">
<field name="NUM">100</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="variables_set" id="Tsy9JA(k6%#8Bh}LlN9^">
<field name="VAR" id="u,9.sks(Ks9Y9sJnRH{K">ReichweiteEAuto</field>
<value name="VALUE">
<block type="math_arithmetic" id="G5asy9ct3aE,]#O`RlB:">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="WnB0B*zuzGhv22$e=^#W">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="-w[K/yG%TIE=6zY!x#SO">
<field name="VAR" id="V=[CbG9$B2^z*A$.tROA">SoC100</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="#v*9o+b0/,nY9gaK[{7E">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="RA`ObDz.^HC*z@|8bsZn">
<field name="VAR" id="y;5+d8!WE-yi(I534HSb">EAutoKapa</field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id=",@4+%1i`waWli@hVRc1I">
<field name="VAR" id="u,9.sks(Ks9Y9sJnRH{K">ReichweiteEAuto</field>
<value name="VALUE">
<block type="math_arithmetic" id="sMGPd$V]RC8QfZRpq`8B">
<field name="OP">MULTIPLY</field>
<value name="A">
<shadow type="math_number" id="meclpTGxn`++sTXL/E}K">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="NS,4gfv4[[Hd-k)Vre)=">
<field name="VAR" id="u,9.sks(Ks9Y9sJnRH{K">ReichweiteEAuto</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="JR5}/|[q#h#vR=:Ov0vw">
<field name="NUM">100</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="variables_set" id="q^7n-IHfK6Rs-UCWMzG?">
<field name="VAR" id="u,9.sks(Ks9Y9sJnRH{K">ReichweiteEAuto</field>
<value name="VALUE">
<block type="math_arithmetic" id="OdBU?vK`W2F+L(cgNb~c">
<field name="OP">DIVIDE</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="ql1TbS/H#E569!@eF13Z">
<field name="VAR" id="u,9.sks(Ks9Y9sJnRH{K">ReichweiteEAuto</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="I3@g$Q$,^Ig?Zs_[PQVd">
<field name="NUM">22</field>
</shadow>
</value>
</block>
</value>
<next>
<block type="update" id="2js+sd$f_=`x/$#Q0*(H">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.EigeneDatenpunkte.openWB.BerechneteReichweiteKM</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="math_rndfixed" id="=9u_:MFzh:zyD,AN_w1$">
<field name="n">1</field>
<value name="x">
<shadow type="math_number" id="facB80Oah;|MPLT~1)JS">
<field name="NUM">3.1234</field>
</shadow>
<block type="variables_get" id="T:mT/8iR]=VnocUd:u(y">
<field name="VAR" id="u,9.sks(Ks9Y9sJnRH{K">ReichweiteEAuto</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id="jO7t(]#_dZSez2fXJxJV">
<mutation elseif="6"></mutation>
<value name="IF0">
<block type="logic_operation" id="M:X),rxv%_$dmZ=[2V~R">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="nJU+b:WDBO(R*9`xioJy">
<field name="OP">GTE</field>
<value name="A">
<block type="variables_get" id="=9lI;M$+TA~A~=2/P!8g">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="d8SD.p=7_any@rsR$+*c">
<field name="NUM">0</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="6W7j`9^iX]4AB,d5[$L7">
<field name="OP">LTE</field>
<value name="A">
<block type="variables_get" id="U?X:z|~jNt3J*_GJxqXq">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="/q4Dq/TQh{`2jdF!Pq_F">
<field name="NUM">5</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="wQ(!G]]KpWA4l?ThF57Q">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.EigeneDatenpunkte.openWB.BatteryLevelIcon</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="X^sl_u?KGZ.Q!tVn[W{T">
<field name="TEXT">/icons-addictive-flavour-png/battery/battery_empty.png</field>
</block>
</value>
</block>
</statement>
<value name="IF1">
<block type="logic_operation" id="Iwaaw#R,na9`^HURWt$f">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id=",%JYPcB]/hgE,RfqmI{y">
<field name="OP">GT</field>
<value name="A">
<block type="variables_get" id="E{/9F_ky66DrK#,E!rt:">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id=".^MG`*DXcOs!c2GR7FsD">
<field name="NUM">5</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="2zyqLF0q5GYMmmH++aoW">
<field name="OP">LT</field>
<value name="A">
<block type="variables_get" id="[dBvQo[Gtaf{Knd}.DK~">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="=NQ=Lmb@(K{!pb}2)X{}">
<field name="NUM">10</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="update" id="k]`-B~z.Lzy|obj6~Nk|">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.EigeneDatenpunkte.openWB.BatteryLevelIcon</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="DW!5^3)A#jI#OGUH3vY9">
<field name="TEXT">/icons-addictive-flavour-png/battery/battery_10percent.png</field>
</block>
</value>
</block>
</statement>
<value name="IF2">
<block type="logic_operation" id="J|^qVVO=_}.qYn~Xg6]o">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="61_##GFRO{U9ju|4w$w:">
<field name="OP">GTE</field>
<value name="A">
<block type="variables_get" id="6B#Gxv:/^ley@37)-[EL">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id=")uO742hDGF2(gN^:|TFO">
<field name="NUM">10</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="G|YoK?ao{#4%JC7w}e#F">
<field name="OP">LTE</field>
<value name="A">
<block type="variables_get" id="mD)j8Z;fxj$bqV(KkHYt">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="pu_fK;DF[|l!Y_^Z%,18">
<field name="NUM">20</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO2">
<block type="update" id="dY^xeibnz/VEZ-#y`3Tp">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.EigeneDatenpunkte.openWB.BatteryLevelIcon</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="3ksn2#l*YAgEl;}C+)7Y">
<field name="TEXT">/icons-addictive-flavour-png/battery/battery_20percent.png</field>
</block>
</value>
</block>
</statement>
<value name="IF3">
<block type="logic_operation" id="0d};2Q(1;Zlua14vLvpO">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="5hP=p6}9F-2*X/+7;*l1">
<field name="OP">GT</field>
<value name="A">
<block type="variables_get" id="pPCxrD=mSAwQQ#UD[II?">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="KJ5tcE[,3[AIfT01!)~,">
<field name="NUM">20</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="*:s6.r^D=yAG]|E1RaI.">
<field name="OP">LTE</field>
<value name="A">
<block type="variables_get" id="v9E%)sl/%cKyo~n}[}+1">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="z45Zi2}+SSiLmSW~{egR">
<field name="NUM">40</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO3">
<block type="update" id="WZ|1TnEu:wMwWsuQIGIW">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.EigeneDatenpunkte.openWB.BatteryLevelIcon</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id=".)yYUC{,MKsY~mV3vBAf">
<field name="TEXT">/icons-addictive-flavour-png/battery/battery_40percent.png</field>
</block>
</value>
</block>
</statement>
<value name="IF4">
<block type="logic_operation" id="MDQ3Aig:]8lzIPV@8dq^">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="+8;_4Q^:.3b.y8C@1cK6">
<field name="OP">GT</field>
<value name="A">
<block type="variables_get" id="x]h@,tV@!h9}:OTO{`7I">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="ZQC=wGl.sMr#2Abr_mD,">
<field name="NUM">40</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="}u$BLEiAa!b$l-`Oo_vl">
<field name="OP">LTE</field>
<value name="A">
<block type="variables_get" id="^3lk~]PSy2^*`cv,1c|)">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="69,Z811[Ha`w%h$m)b#r">
<field name="NUM">60</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO4">
<block type="update" id="w+xfr)zLH%Grm(_z-9@;">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.EigeneDatenpunkte.openWB.BatteryLevelIcon</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="f.oSdj+MR/*hZaSP=?7?">
<field name="TEXT">/icons-addictive-flavour-png/battery/battery_60percent.png</field>
</block>
</value>
</block>
</statement>
<value name="IF5">
<block type="logic_operation" id="/Pu]Z{Mv/fuN{,F^GMfM">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="SBktxv%9Mn:`)18%JBEm">
<field name="OP">GT</field>
<value name="A">
<block type="variables_get" id="Y=i^kQjy2jhm/EM}`6%,">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="JI/aN)W`RG)o)OuD:IPQ">
<field name="NUM">60</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id=")a}DAAkpO!o$_oUhInCg">
<field name="OP">LTE</field>
<value name="A">
<block type="variables_get" id="k2%4O7%gCKOSbJ#KJ~(d">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="12UYI3NE)|fmjyK2FJw9">
<field name="NUM">80</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO5">
<block type="update" id="J;uJsyT+`U^pjA{*3bp^">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.EigeneDatenpunkte.openWB.BatteryLevelIcon</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="L4I^.^M^+50,At+g5?W[">
<field name="TEXT">/icons-addictive-flavour-png/battery/battery_80percent.png</field>
</block>
</value>
</block>
</statement>
<value name="IF6">
<block type="logic_operation" id=",8i1muAA#GpCaKp*j{[Q">
<field name="OP">AND</field>
<value name="A">
<block type="logic_compare" id="8@9$G?V6!YQ%!HD)cL#5">
<field name="OP">GT</field>
<value name="A">
<block type="variables_get" id="D6{1:I-%PkV$n|]h8gfQ">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="YS?5+aTR7/_XtC@;jZ|L">
<field name="NUM">80</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="logic_compare" id="ZlzVcOMJ7xUFf?8;6Rf1">
<field name="OP">LTE</field>
<value name="A">
<block type="variables_get" id="-;O#h/FS$vXAL)DPi.hy">
<field name="VAR" id="-5qE{53gUXm~XDoCvrx4">SoC</field>
</block>
</value>
<value name="B">
<block type="math_number" id="ta%a5%8K~H2Q/82a^Qw2">
<field name="NUM">100</field>
</block>
</value>
</block>
</value>
</block>
</value>
<statement name="DO6">
<block type="update" id="T6lw%}fnhF-:sWZf9Nl*">
<mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
<field name="OID">0_userdata.0.EigeneDatenpunkte.openWB.BatteryLevelIcon</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="text" id="nfIS5|o1+En@;^cFg^FN">
<field name="TEXT">/icons-addictive-flavour-png/battery/battery_full.png</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</xml>
Ich finde es da über Blockly etwas übersichtlicher und einfacher anpassbar. Berechnung der Reichweite des E-Autos bitte raus löschen. Das Blockly erwartet eine Ladeanzeige als Zahl (in %).