NEWS
[gelöst] Wertabhängige Liste farbig darstellen VIS
-
Hi,
ich möchte angehängte Listen farbig je nach Wert in Spalte 1 darstellen.
Die Listen wurden in Blockly erstellt und in einen Objekt geschrieben.
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id=",mx!%Eg9U%EQ-*/!f:h=">id</variable> <variable id="HpdWh(8#6`y(;1o65(RD">Liste</variable> <variable id="c?!ph=/}PRS57|~^LOdn">Wert</variable> <variable id="El#;Y`k{~G2ZV#s{3TEp">VoltNeu</variable> <variable id="D6-l2.ScVIj?7_C)h9P8">MinimalVolt</variable> <variable id="%$*_0}]UD-C!A1L{gA98">VoltNeu1</variable> <variable id="om$.:2ja9Kp3=?Um]bXp">MinimalVolt1</variable> <variable id="{!/}R$!{C@+aT`6x[?mb">GeräteListe</variable> <variable id="xz.OG6I93;(yN).mQP6a">ListFuellgradBatterien</variable> <variable id="7yQ*dx[92W-@e4|rg$Xv">GeraeteListeUnreach</variable> <variable id="8}UdpSintW5J00S/Ba{T">i</variable> <variable id="y!hJoeDrX@j_Kk_o;=Qc">ListeUnreach</variable> <variable id="!jo]JEeS5*:lPm*ShNJd">GeraeteListeLowBat</variable> <variable id="5D*eD1Rc@H,e[EOyK.Be">ListeLowBat</variable> </variables> <block type="comment" id="t-JjN]pxnX@Y~:?A2~hy" x="-37" y="-762"> <field name="COMMENT">Holt Inhalt aus Objekte</field> </block> <block type="procedures_defcustomreturn" id="~Z}^~nwLMpveP?`,$I3@" x="-37" y="-712"> <mutation statements="false"> <arg name="id" varid=",mx!%Eg9U%EQ-*/!f:h="></arg> </mutation> <field name="NAME">ObjectFromID</field> <field name="SCRIPT">cmV0dXJuIGdldE9iamVjdChpZCk7</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="comment" id="$55zz]a?FLa[wR~P6_zu" x="-37" y="-537"> <field name="COMMENT">Sortiert Liste</field> </block> <block type="procedures_defcustomreturn" id="aDO65KO.OV|XTc2I$ch`" x="-37" y="-487"> <mutation statements="false"> <arg name="Liste" varid="HpdWh(8#6`y(;1o65(RD"></arg> <arg name="Wert" varid="c?!ph=/}PRS57|~^LOdn"></arg> </mutation> <field name="NAME">Sortieren</field> <field name="SCRIPT">dmFyIFdlcnQgPSBXZXJ0IC0gMTsgDQpMaXN0ZS5zb3J0KGZ1bmN0aW9uKGEsIGIpew0KICAgIHJldHVybiBhW1dlcnRdIC0gYltXZXJ0XTsNCn0pOw0KcmV0dXJuIExpc3RlOw==</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="comment" id="x*sNq=+F|]n90V:)D4R!" x="-49" y="-441"> <field name="COMMENT">Überprüfung der Batterien: Ziel, Warnung&#10;bei geringem Füllgrad, Uhrzeit 5 Uhr</field> <next> <block type="variables_set" id="K:.DA08FLK.Q3NSD}os7"> <field name="VAR" id="El#;Y`k{~G2ZV#s{3TEp">VoltNeu</field> <value name="VALUE"> <block type="math_number" id="h2C@bcV~!A?GqNU!yr!S"> <field name="NUM">3.1</field> </block> </value> <next> <block type="variables_set" id="IdlD7=SxexPZAsdaG^CG"> <field name="VAR" id="D6-l2.ScVIj?7_C)h9P8">MinimalVolt</field> <value name="VALUE"> <block type="math_number" id="[]n`b*mq#`pV3s{x)_+_"> <field name="NUM">2.2</field> </block> </value> <next> <block type="variables_set" id="@%Nlb?[#a{Ts+ldcKZ4r"> <field name="VAR" id="%$*_0}]UD-C!A1L{gA98">VoltNeu1</field> <value name="VALUE"> <block type="math_number" id="SN.hIJ1FQ/,O[U1RYODF"> <field name="NUM">1.5</field> </block> </value> <next> <block type="variables_set" id="|QQUGJ$J5O9ldkmQNpsd"> <field name="VAR" id="om$.:2ja9Kp3=?Um]bXp">MinimalVolt1</field> <value name="VALUE"> <block type="math_number" id="byuJ%3_G/j:%(h^-gL.l"> <field name="NUM">1.1</field> </block> </value> <next> <block type="schedule" id="k/2q:G*-=IMca]j!?B~}"> <field name="SCHEDULE">0 5 * * *</field> <statement name="STATEMENT"> <block type="variables_set" id="IeEDw;!x88Vm`^{NG_2F"> <field name="VAR" id="{!/}R$!{C@+aT`6x[?mb">GeräteListe</field> <value name="VALUE"> <block type="lists_create_with" id="2{KSzE;rbKh%r{$_/BxY"> <mutation items="0"></mutation> </block> </value> <next> <block type="variables_set" id="CWN?*4nsymFq_?ZXz!)l"> <field name="VAR" id="{!/}R$!{C@+aT`6x[?mb">GeräteListe</field> <value name="VALUE"> <block type="selector" id="}VRVwgh}tVIKZ7fAq4WV"> <field name="TEXT">channel[state.id=alias.*.VOLT_BAT]</field> </block> </value> <next> <block type="variables_set" id="ii[lv:c!_=_kE`=_[@n:"> <field name="VAR" id="xz.OG6I93;(yN).mQP6a">ListFuellgradBatterien</field> <value name="VALUE"> <block type="lists_create_with" id="_1BA_GmKCay$t#TU|#6V"> <mutation items="0"></mutation> </block> </value> <next> <block type="controls_forEach" id="`~~#Z1R_`3@XAR_=AyJ="> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> <value name="LIST"> <block type="variables_get" id="J$(3a^^8/`pFuRM@ZS:e"> <field name="VAR" id="{!/}R$!{C@+aT`6x[?mb">GeräteListe</field> </block> </value> <statement name="DO"> <block type="lists_setIndex" id="0dMmm9o5x!Qoj1OI$B%X" inline="false"> <mutation at="false"></mutation> <field name="MODE">INSERT</field> <field name="WHERE">LAST</field> <value name="LIST"> <block type="variables_get" id="2I|$3tjU{o%%XGFX?%Rg"> <field name="VAR" id="xz.OG6I93;(yN).mQP6a">ListFuellgradBatterien</field> </block> </value> <value name="TO"> <block type="lists_create_with" id="pfvCK0*MvH;Cw1icqlea"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text_format_value" id="vyU6BdnPMB+;i}!,s0,/" inline="false"> <field name="FORMAT">system</field> <value name="VALUE"> <shadow type="math_number" id="9V!qx)i.bz%L9^w[ZnMN"> <field name="NUM">1.23</field> </shadow> <block type="logic_ternary" id="#G3)Js,q+uWB=4|s{6e$"> <value name="IF"> <block type="logic_compare" id="HZVC%e#]k#k!3Ug@z-S,"> <field name="OP">LTE</field> <value name="A"> <block type="get_value_var" id="3(wGek6;10NiCcH`8BR9"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="c%A_Lb_y5z#h9SId^+bf"> <field name="oid">ID auswählen</field> </shadow> <block type="variables_get" id="R,ANUNMh^,7o^)rvW.Na"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> <value name="B"> <block type="math_number" id="9b+}(AA|]ca_:we$1^nj"> <field name="NUM">1.5</field> </block> </value> </block> </value> <value name="THEN"> <block type="math_arithmetic" id="h[(TAo)n?;Kf,h|b(T/K" inline="false"> <field name="OP">MULTIPLY</field> <value name="A"> <shadow type="math_number" id="GE4(JfG5Gr]o@sfQIQ~g"> <field name="NUM">1</field> </shadow> <block type="math_number" id="qDrMNljwSdI,lnzk3wl7"> <field name="NUM">100</field> </block> </value> <value name="B"> <shadow type="math_number" id="9y%9.BNQwmj|ogHG1a_;"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="h~)]JWbDs#u/27Xy[B!8" inline="false"> <field name="OP">DIVIDE</field> <value name="A"> <shadow type="math_number" id="LRjzSA7UKYcu6fED:0#Z"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id=":4,RGqXUl]+w#1**}B5d" inline="false"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="%zEf%GgF]Bll}CQ;PV=."> <field name="NUM">1</field> </shadow> <block type="get_value_var" id="Sz]4oQ?v,1H=Z,Wjjdv0"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="c%A_Lb_y5z#h9SId^+bf"> <field name="oid">ID auswählen</field> </shadow> <block type="variables_get" id="!ZyB7!Uol;MeLX.J+_wL"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="|8b03zloO_|ehN5n$C?Z"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="T75e0W2kUO]75frg]!h9"> <field name="VAR" id="om$.:2ja9Kp3=?Um]bXp">MinimalVolt1</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="JQ_^D:pufDeM3;zRKFm_"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="EY`rH5)HR*feAKeq@qr_"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="CtsCyXUO:)Gei:2+iF2Z"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="*{#Jc2.K0v6Wt{_fiHX+"> <field name="VAR" id="%$*_0}]UD-C!A1L{gA98">VoltNeu1</field> </block> </value> <value name="B"> <shadow type="math_number" id="n*5fOLFX`~]{|m1^AG_;"> <field name="NUM">2.4</field> </shadow> <block type="variables_get" id="%iICny)%HW}v]Ydjw,g8"> <field name="VAR" id="om$.:2ja9Kp3=?Um]bXp">MinimalVolt1</field> </block> </value> </block> </value> </block> </value> </block> </value> <value name="ELSE"> <block type="math_arithmetic" id="BDvZ4L#xGjui8UPwI)-2" inline="false"> <field name="OP">MULTIPLY</field> <value name="A"> <shadow type="math_number" id="GE4(JfG5Gr]o@sfQIQ~g"> <field name="NUM">1</field> </shadow> <block type="math_number" id="I;Cscr!w`|!!oM{L_*[m"> <field name="NUM">100</field> </block> </value> <value name="B"> <shadow type="math_number" id="9y%9.BNQwmj|ogHG1a_;"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="fOl;F:48M4D0t{`6y4=R" inline="false"> <field name="OP">DIVIDE</field> <value name="A"> <shadow type="math_number" id="LRjzSA7UKYcu6fED:0#Z"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="NUXpkrD-,mf)$_(cN@{p" inline="false"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="%zEf%GgF]Bll}CQ;PV=."> <field name="NUM">1</field> </shadow> <block type="get_value_var" id="sOX+x0794NvqLvq#W2N1"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="c%A_Lb_y5z#h9SId^+bf"> <field name="oid">ID auswählen</field> </shadow> <block type="variables_get" id="_-4@b)r]0jItTKz=Yz??"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="|8b03zloO_|ehN5n$C?Z"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="$AvYATTTQnbJDe_!QH6R"> <field name="VAR" id="D6-l2.ScVIj?7_C)h9P8">MinimalVolt</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="JQ_^D:pufDeM3;zRKFm_"> <field name="NUM">1</field> </shadow> <block type="math_arithmetic" id="c$1O}j?|#dcVsaSsexGM"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="CtsCyXUO:)Gei:2+iF2Z"> <field name="NUM">1</field> </shadow> <block type="variables_get" id="TQ`vBQ,;xMQv.ZY+^.Y1"> <field name="VAR" id="El#;Y`k{~G2ZV#s{3TEp">VoltNeu</field> </block> </value> <value name="B"> <shadow type="math_number" id="n*5fOLFX`~]{|m1^AG_;"> <field name="NUM">2.4</field> </shadow> <block type="variables_get" id="N]c@RuuvE2vW8kL!j^},"> <field name="VAR" id="D6-l2.ScVIj?7_C)h9P8">MinimalVolt</field> </block> </value> </block> </value> </block> </value> </block> </value> </block> </value> <value name="DECIMALS"> <shadow type="math_number" id="2gy2D/m:(SU01G`=3bDz"> <field name="NUM">0</field> </shadow> <block type="math_number" id="PhG}m3TuCJbk%gNDcFR)"> <field name="NUM">0</field> </block> </value> </block> </value> <value name="ADD1"> <block type="text_join" id="lV}EBmxeaw9S~QzcPI4E"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="Lx2~m$-:z[S-a|vD,@jB"> <field name="TEXT">% </field> </block> </value> <value name="ADD1"> <block type="text_getSubstring" id="Sjn${wJ2Lqlz^Fn+9-V7" inline="false"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_END</field> <value name="STRING"> <block type="get_attr" id="!zzDR#-8NYg]E6:V|mcn" inline="false"> <value name="PATH"> <shadow type="text" id="HtoDu%.wkQ2IhvT:Ax)k"> <field name="TEXT">common.name</field> </shadow> </value> <value name="OBJECT"> <shadow type="get_object" id="28RoolZNvhig8NLThGRK"> <field name="OID">Object ID</field> </shadow> <block type="procedures_callcustomreturn" id="S.|CySgsQ)wQ1q[g##^="> <mutation name="ObjectFromID"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="A)8ubA3=^-FUGWr@yTr@"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> </block> </value> <value name="AT1"> <block type="math_number" id="b/zIS+rkhBBsZ3dAm6zA"> <field name="NUM">6</field> </block> </value> <value name="AT2"> <block type="math_number" id=".cPY@*{3pjF4_y1,TlEA"> <field name="NUM">9</field> </block> </value> </block> </value> </block> </value> </block> </value> </block> </statement> <next> <block type="debug" id="iNiQBD-G;ia3dzMf=^P[" disabled-reasons="MANUALLY_DISABLED"> <field name="Severity">info</field> <value name="TEXT"> <shadow type="text" id="9oFirLnu!UNBGt[#m)|g"> <field name="TEXT">test</field> </shadow> <block type="procedures_callcustomreturn" id="ecm{n#sbVtSp3O#RM~mz"> <mutation name="Sortieren"> <arg name="Liste"></arg> <arg name="Wert"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id=")YDtr4dsOJyOs,hRSgv$"> <field name="VAR" id="xz.OG6I93;(yN).mQP6a">ListFuellgradBatterien</field> </block> </value> <value name="ARG1"> <block type="math_number" id="/]w_o1M?@eGf-}l)85;5"> <field name="NUM">1</field> </block> </value> </block> </value> <next> <block type="comment" id="ZV2%P_}7?7K7|v.NLA~_"> <field name="COMMENT">Das json Programm s. oben, erzeugt Block &#10;"Sortieren mit:"&#10;&#10;Wert = Spalte</field> <next> <block type="update" id="Zr@!VB818JixCYo`uFFJ"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Diverses.Batteriefuellgrad</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="9k)SdQ%IDNKTINR:DPQY"> <field name="TEXT">...</field> </block> </value> <next> <block type="update" id="B9TWY7|?cH)/zh865f8W"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Diverses.Batteriefuellgrad</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="aJUNAiy=AY{Vd*BT}h6h"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="procedures_callcustomreturn" id=")z.mv#..#~,oJKpr/Uke"> <mutation name="Sortieren"> <arg name="Liste"></arg> <arg name="Wert"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="V/4mt6^^TmUEQrVKehxS"> <field name="VAR" id="xz.OG6I93;(yN).mQP6a">ListFuellgradBatterien</field> </block> </value> <value name="ARG1"> <block type="math_number" id="b!6FiN}H_zQZ,?38;pOn"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="Kr80;om{x[=J]5Pd1PFx"> <field name="COMMENT">Liste fuer Unreach</field> <next> <block type="schedule" id="d4M),c7DZ{cG?IF+NWKz"> <field name="SCHEDULE">*/2 * * * *</field> <statement name="STATEMENT"> <block type="variables_set" id="8t$%]ZAsdTci8wELDNj*"> <field name="VAR" id="7yQ*dx[92W-@e4|rg$Xv">GeraeteListeUnreach</field> <value name="VALUE"> <block type="lists_create_with" id="pzhjK{3mSu498w)htfBA"> <mutation items="0"></mutation> </block> </value> <next> <block type="variables_set" id="_{mdrtH+X7k!SrDx`0FO"> <field name="VAR" id="7yQ*dx[92W-@e4|rg$Xv">GeraeteListeUnreach</field> <value name="VALUE"> <block type="selector" id="$sy#cWj(Xxlof|q]4li["> <field name="TEXT">channel[state.id=alias.*.UNREACH]</field> </block> </value> <next> <block type="variables_set" id="0g5Ba5fRJA^*Wk3PQ$OF"> <field name="VAR" id="y!hJoeDrX@j_Kk_o;=Qc">ListeUnreach</field> <value name="VALUE"> <block type="lists_create_with" id="g8#2]Wk/gh=4leAd9]`N"> <mutation items="0"></mutation> </block> </value> <next> <block type="controls_forEach" id="rZkBDBrA5q=yw]/i68Fl"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> <value name="LIST"> <block type="variables_get" id="iPETl.!`9InCLCdp?2:~"> <field name="VAR" id="7yQ*dx[92W-@e4|rg$Xv">GeraeteListeUnreach</field> </block> </value> <statement name="DO"> <block type="lists_setIndex" id="dC#!T/f%8CojJ!=o%ijO" inline="false"> <mutation at="false"></mutation> <field name="MODE">INSERT</field> <field name="WHERE">LAST</field> <value name="LIST"> <block type="variables_get" id="PFY$$++-|bUmq@%4VetU"> <field name="VAR" id="y!hJoeDrX@j_Kk_o;=Qc">ListeUnreach</field> </block> </value> <value name="TO"> <block type="lists_create_with" id="h]MWY?sHaD;eKTz:y^I@"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text_join" id="J|iZmDjoS(X5pj_Cn@{C"> <mutation items="1"></mutation> <value name="ADD0"> <block type="logic_ternary" id="WAEL7POlfblT})!9?yIi"> <value name="IF"> <block type="logic_compare" id="ICpR8$K$38Q]T)!p5Wd%"> <field name="OP">EQ</field> <value name="A"> <block type="get_value_var" id="|$cvhwI2NB8q9)Skl.}c"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="exMlWlTik~xt/f]{Jo8b"> <field name="oid">ID auswählen</field> </shadow> <block type="variables_get" id=".$Wm?I7;Q|su0:Ho%z}("> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> <value name="B"> <block type="logic_boolean" id=":?oo8^Ke%.D(uvyFDn@e"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="THEN"> <block type="text" id=".E#fE+O0e1A|%R]zJ?}8"> <field name="TEXT">1</field> </block> </value> <value name="ELSE"> <block type="text" id="$),}d^Oii9}J#tsbp%D$"> <field name="TEXT">0</field> </block> </value> </block> </value> </block> </value> <value name="ADD1"> <block type="text_join" id="x`6yMhTU#]N0tO+T)#q,"> <mutation items="2"></mutation> <value name="ADD0"> <block type="logic_ternary" id="q;Z,AvSQnIPUyL3)P3h4"> <value name="IF"> <block type="logic_compare" id="HfVG-s+EeiQSS7Ia4v8+"> <field name="OP">EQ</field> <value name="A"> <block type="get_value_var" id="=jc]i:vqHfEB%ve]0PJs"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="exMlWlTik~xt/f]{Jo8b"> <field name="oid">ID auswählen</field> </shadow> <block type="variables_get" id="mvQ3Cf3bmL,*D~8mvLxY"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> <value name="B"> <block type="logic_boolean" id="l):wlI28,Zt,By^rOdP@"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="THEN"> <block type="text" id=")f}!(rMhly;Ct%[e:![%"> <field name="TEXT"> (true) </field> </block> </value> <value name="ELSE"> <block type="text" id="c3?[fwUsMHFeZiabZ}QY"> <field name="TEXT"> (false) </field> </block> </value> </block> </value> <value name="ADD1"> <block type="text_getSubstring" id="mTjoo]m-hp5GBLuc^3q," inline="false"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_END</field> <value name="STRING"> <block type="get_attr" id="8vlE*GJfYyGV:LC*i`|-" inline="false"> <value name="PATH"> <shadow type="text" id="gu`(?urCF+u]~K^u0hzI"> <field name="TEXT">common.name</field> </shadow> </value> <value name="OBJECT"> <shadow type="get_object" id="28RoolZNvhig8NLThGRK"> <field name="OID">Object ID</field> </shadow> <block type="procedures_callcustomreturn" id="VnCOvGGr9INXpEpb-XZD"> <mutation name="ObjectFromID"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="`T1l19rPWqluS$]0KW(U"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> </block> </value> <value name="AT1"> <block type="math_number" id="^C:S5ds1ePasb;/).$f?"> <field name="NUM">6</field> </block> </value> <value name="AT2"> <block type="math_number" id="RpR-@ug4|BNnI.5.EJLQ"> <field name="NUM">9</field> </block> </value> </block> </value> </block> </value> </block> </value> </block> </statement> <next> <block type="debug" id="^`94|YkipKgveLLtXu?L" disabled-reasons="MANUALLY_DISABLED"> <field name="Severity">info</field> <value name="TEXT"> <shadow type="text" id="9oFirLnu!UNBGt[#m)|g"> <field name="TEXT">test</field> </shadow> <block type="procedures_callcustomreturn" id="8`eJZzZ]*V8O#j7AA{^("> <mutation name="Sortieren2"> <arg name="Liste"></arg> <arg name="Wert"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="swMWoeZ3bYr)vV(x6Y~}"> <field name="VAR" id="y!hJoeDrX@j_Kk_o;=Qc">ListeUnreach</field> </block> </value> <value name="ARG1"> <block type="math_number" id="_dxpcuum*MzS@Vq?q6Vb"> <field name="NUM">1</field> </block> </value> </block> </value> <next> <block type="comment" id="2,e]|z|;Gf{C.I.:IvGn"> <field name="COMMENT">Das json Programm s. oben, erzeugt Block &#10;"Sortieren mit:"&#10;&#10;Wert = Spalte</field> <next> <block type="update" id="@kArLcJI:wezp]:VjBO$"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Diverses.UnreachPruefung</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="7:k*%l7t_qc@Psm]1LwS"> <field name="TEXT">.....</field> </block> </value> <next> <block type="update" id="mL;uelwBnjm?US5T.YYl"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Diverses.UnreachPruefung</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="rT$#Xl!1$fpaqCLy-8pI"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="procedures_callcustomreturn" id="FV|83j;(ec24[-;aHJ!u"> <mutation name="Sortieren2"> <arg name="Liste"></arg> <arg name="Wert"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="TAHj-a@6K@{*gV{1DV/x"> <field name="VAR" id="y!hJoeDrX@j_Kk_o;=Qc">ListeUnreach</field> </block> </value> <value name="ARG1"> <block type="math_number" id="ndMXct~/8;Z^va~3Dm.;"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="a=yZ_S!eR[,hwM?3OHcH"> <field name="COMMENT">Liste LowBat</field> <next> <block type="schedule" id="xaOoV%dN7.J*;%0`.WE*"> <field name="SCHEDULE">*/2 * * * *</field> <statement name="STATEMENT"> <block type="variables_set" id="3ZxZA]VqMC7td2SV8,eU"> <field name="VAR" id="!jo]JEeS5*:lPm*ShNJd">GeraeteListeLowBat</field> <value name="VALUE"> <block type="lists_create_with" id=";n=J}a;$:_V:!wXj,aDa"> <mutation items="0"></mutation> </block> </value> <next> <block type="variables_set" id="ZB`|^(w4MZ_O0bRguLRg"> <field name="VAR" id="!jo]JEeS5*:lPm*ShNJd">GeraeteListeLowBat</field> <value name="VALUE"> <block type="selector" id="#:_QM2f)NtF4E/U+A=AQ"> <field name="TEXT">channel[state.id=alias.*.LOWBAT]</field> </block> </value> <next> <block type="variables_set" id="D#dr9:l.P:V!xAgqRvl{"> <field name="VAR" id="5D*eD1Rc@H,e[EOyK.Be">ListeLowBat</field> <value name="VALUE"> <block type="lists_create_with" id="@LE0D|[yaPUz2yfL5P[_"> <mutation items="0"></mutation> </block> </value> <next> <block type="controls_forEach" id="oli}#?_|iKaK3B95Qx=)"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> <value name="LIST"> <block type="variables_get" id="_QW)3M2CFf!:5#1axDfM"> <field name="VAR" id="!jo]JEeS5*:lPm*ShNJd">GeraeteListeLowBat</field> </block> </value> <statement name="DO"> <block type="lists_setIndex" id="`@qzJ[BNXcP-SVvSf{QZ" inline="false"> <mutation at="false"></mutation> <field name="MODE">INSERT</field> <field name="WHERE">LAST</field> <value name="LIST"> <block type="variables_get" id="k|x/lL0_ZfIszH=/^RZ|"> <field name="VAR" id="5D*eD1Rc@H,e[EOyK.Be">ListeLowBat</field> </block> </value> <value name="TO"> <block type="lists_create_with" id="1cE2*c{bx8P:,Zr(.+?%"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text_join" id="?V1p^cR/i%b/=x8B+(*_"> <mutation items="1"></mutation> <value name="ADD0"> <block type="logic_ternary" id="zGw_2$Lw~_uAyOHwb3r1"> <value name="IF"> <block type="logic_compare" id="Q+348rzv{u:hf_:jI2o["> <field name="OP">EQ</field> <value name="A"> <block type="get_value_var" id="yg#O{_#Fy$K|ZR%XvGny"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="exMlWlTik~xt/f]{Jo8b"> <field name="oid">ID auswählen</field> </shadow> <block type="variables_get" id="*Pv$gf$K)yqy/+!k!^|."> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> <value name="B"> <block type="logic_boolean" id="WW7_0H};s5|3sKgKiND@"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="THEN"> <block type="text" id="f+sByxlcO3QuZyzkTy/b"> <field name="TEXT">1</field> </block> </value> <value name="ELSE"> <block type="text" id="O|daz.1EL38xN#!RG:Er"> <field name="TEXT">0</field> </block> </value> </block> </value> </block> </value> <value name="ADD1"> <block type="text_join" id="%-QB!kI@*=_usO@FWjDk"> <mutation items="2"></mutation> <value name="ADD0"> <block type="logic_ternary" id="(BAe~h5Cql*#xk418Ck0"> <value name="IF"> <block type="logic_compare" id="=gmb-6XyphE4J8a]SF`|"> <field name="OP">EQ</field> <value name="A"> <block type="get_value_var" id="8gBd_mBsqzvhHrj==M+2"> <field name="ATTR">val</field> <value name="OID"> <shadow type="field_oid" id="exMlWlTik~xt/f]{Jo8b"> <field name="oid">ID auswählen</field> </shadow> <block type="variables_get" id="M{Y%I:C]VQFgD~j?z+%h"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> <value name="B"> <block type="logic_boolean" id="8,ZBo(za@X=ti3@R[V)G"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <value name="THEN"> <block type="text" id="sFf-RZ]l%ZNJG@o7uC9B"> <field name="TEXT"> (true) </field> </block> </value> <value name="ELSE"> <block type="text" id="e]jH`aQA#@TM+Gfr0(x-"> <field name="TEXT"> (false) </field> </block> </value> </block> </value> <value name="ADD1"> <block type="text_getSubstring" id="*gDqaRQ(r7-Y#k44X2S*" inline="false"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_END</field> <value name="STRING"> <block type="get_attr" id="H[OnJsG0+jsc#rrRgLYE" inline="false"> <value name="PATH"> <shadow type="text" id="D)^Q/gPL?lE?=?}hd$NG"> <field name="TEXT">common.name</field> </shadow> </value> <value name="OBJECT"> <shadow type="get_object" id="28RoolZNvhig8NLThGRK"> <field name="OID">Object ID</field> </shadow> <block type="procedures_callcustomreturn" id="MZcU+R:FoDX.[r!+=F]c"> <mutation name="ObjectFromID"> <arg name="id"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="YM~XOY^8=[lPb-6{T{r`"> <field name="VAR" id="8}UdpSintW5J00S/Ba{T">i</field> </block> </value> </block> </value> </block> </value> <value name="AT1"> <block type="math_number" id="n{A.92lm]-+Ca?h)}v3$"> <field name="NUM">6</field> </block> </value> <value name="AT2"> <block type="math_number" id="cJ}TC}$zixW770L:yGb?"> <field name="NUM">8</field> </block> </value> </block> </value> </block> </value> </block> </value> </block> </statement> <next> <block type="debug" id="66DYVj}*KrUDq)|~3^]m" disabled-reasons="MANUALLY_DISABLED"> <field name="Severity">info</field> <value name="TEXT"> <shadow type="text" id="9oFirLnu!UNBGt[#m)|g"> <field name="TEXT">test</field> </shadow> <block type="procedures_callcustomreturn" id="i*CoG=KS#@]9j]J^D5i*"> <mutation name="Sortieren3"> <arg name="Liste"></arg> <arg name="Wert"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="2Pp)_X#T;O^V$3GKn)Tg"> <field name="VAR" id="5D*eD1Rc@H,e[EOyK.Be">ListeLowBat</field> </block> </value> <value name="ARG1"> <block type="math_number" id="BA+pharHXHZG,Lpa-hHG"> <field name="NUM">1</field> </block> </value> </block> </value> <next> <block type="comment" id="qErHzL,{Zwma)JqnF:WR"> <field name="COMMENT">Das json Programm s. oben, erzeugt Block &#10;"Sortieren mit:"&#10;&#10;Wert = Spalte</field> <next> <block type="update" id="#=M`M)*;k2XwQ/5=,^:t"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Diverses.LowBatPruefung</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text" id="*%PqeX~})m/X::`f)12a"> <field name="TEXT">....</field> </block> </value> <next> <block type="update" id="!G%Ry[%c6zN.-+UXdn6j"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Diverses.LowBatPruefung</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="convert_object2json" id="{dRg6kMUXo!ENSRoLKX%"> <field name="PRETTIFY">FALSE</field> <value name="VALUE"> <block type="procedures_callcustomreturn" id="*Co*^msA*{:0[)|#T2Q_"> <mutation name="Sortieren3"> <arg name="Liste"></arg> <arg name="Wert"></arg> </mutation> <value name="ARG0"> <block type="variables_get" id="6?GabYqP4nA}%@#?x.Ix"> <field name="VAR" id="5D*eD1Rc@H,e[EOyK.Be">ListeLowBat</field> </block> </value> <value name="ARG1"> <block type="math_number" id="Vuk%uQ5f4RoIUc?C36Fd"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> <block type="procedures_defcustomreturn" id="^RZXPk?zdoibsm9q0|L:" x="363" y="1138"> <mutation statements="false"> <arg name="Liste" varid="HpdWh(8#6`y(;1o65(RD"></arg> <arg name="Wert" varid="c?!ph=/}PRS57|~^LOdn"></arg> </mutation> <field name="NAME">Sortieren2</field> <field name="SCRIPT">dmFyIFdlcnQgPSBXZXJ0IC0gMTsgDQpMaXN0ZS5zb3J0KGZ1bmN0aW9uKGEsIGIpew0KICAgIHJldHVybiAgYltXZXJ0XS1hW1dlcnRdOw0KfSk7DQpyZXR1cm4gTGlzdGU7</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defcustomreturn" id="BDi{JyKWDKo3;K5?#Z$6" x="663" y="2588"> <mutation statements="false"> <arg name="Liste" varid="HpdWh(8#6`y(;1o65(RD"></arg> <arg name="Wert" varid="c?!ph=/}PRS57|~^LOdn"></arg> </mutation> <field name="NAME">Sortieren3</field> <field name="SCRIPT">dmFyIFdlcnQgPSBXZXJ0IC0gMTsgDQpMaXN0ZS5zb3J0KGZ1bmN0aW9uKGEsIGIpew0KICAgIHJldHVybiBiW1dlcnRdIC0gYVtXZXJ0XTsNCn0pOw0KcmV0dXJuIExpc3RlOw==</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> </xml>Bei den Widget handelt es sich um das "materialdesign table" Widgets. Für das Ziel muss es nicht dieses Ziel sein, falls es bessere gibt.
VG
Axel -
-
Hi,
funktioniert es eventuell über HTML und CSS in einem HTML-Basic widget, muss jedoch ergänzen, dass ich bisher diese Sprachen nicht wirklich verstehe, benötige dann Code Schnipsel über die ich mich an das Ziel herantasten kann.VG AFi
hast du evtl mal den inhalt eines der datenpunkte wo das json reingeschrieben wird?
dem blockly nach müsste das bspw 0_userdata.0.Diverses.Batteriefuellgrad sein.Dann könnte ich dir mittels dem json-template widget aus dem gleichnamigen adapter die Tabelle nachbilden. Für welche Werte/Wertbereiche willst du welche Farben?
ein export des zugehörigen widgets wäre ebenfalls nicht schlecht, damit farben layout entsprechend passen
-
Hi Oliver,
anbei json Tabelle:
[ [ "11", "% KG SW Zim HZKT" ], [ "22", "% OG Hobby Zim HZKT" ], [ "25", "% EG WZ Tuergr Kontakt" ], [ "25", "% Haust Türkont" ], [ "25", "% Leo Dachf Kont gr Raum" ], [ "25", "% OG Hobby Zim Dachfensterk" ], [ "33", "% ELW Schlafz Fensterk" ], [ "33", "% EG WC HZKT" ], [ "33", "% Haustür Gang HZKT" ], [ "33", "% Leo Dachf HZKT" ], [ "44", "% OG Buero HZKT" ], [ "50", "% Leo Dachfe Kont kl Raum" ], [ "50", "% OG WC Dachfenster Kont" ], [ "56", "% OG Bad HZKT" ], [ "56", "% OG Bad WTH" ], [ "56", "% EG Kueche HZKT" ], [ "56", "% EG Kueche Fensterk" ], [ "56", "% EG WZ HZKT Front" ], [ "56", "% ELW Bad Fensterk" ], [ "56", "% KG Bad HZKT" ], [ "56", "% Leo Fensterk" ], [ "56", "% OG Gast Fenster Kontakt" ], [ "56", "% OG Gast HZKT" ], [ "56", "% OG WC HZKT" ], [ "67", "% EG WC Fensterk" ], [ "67", "% EG WZ Fenterk Fliegeng" ], [ "67", "% ELW Bad HZKT" ], [ "67", "% ELW Bad WTH" ], [ "67", "% ELW Nebenz Fensterk" ], [ "67", "% KE Sauna WTH" ], [ "67", "% OG Hobby Zim Fensterk" ], [ "67", "% OG Hobby Zim WTH" ], [ "67", "% OG Buero WTH" ], [ "67", "% OG Buero Fensterk" ], [ "75", "% OG Bad Dachfe Kont" ], [ "75", "% KG Sauna Fensterk" ], [ "78", "% ELW Schlafz WTH" ], [ "78", "% Temp Feuchte Nordseite Haus" ], [ "78", "% Wintegarten Temp Feuchte" ], [ "78", "% EG Kueche WTH" ], [ "78", "% EG WZ Fensterk Front" ], [ "78", "% EG WZ Fenterk Garten" ], [ "78", "% EG WZ Fensterk Gartent" ], [ "78", "% EG WZ Fensterk Nachbar" ], [ "78", "% KG Gang WTH" ], [ "78", "% KG Sauna HZKT" ], [ "78", "% Leo WTH" ], [ "89", "% ELW Schlafz HZKT" ], [ "89", "% EG WZ Bewegme" ], [ "89", "% EG WZ HZKT Nachbar" ], [ "89", "% EG WZ WTH" ], [ "89", "% ELW Nebenz HZKT" ], [ "89", "% OG Gast WTH" ], [ "100", "% EG WZ HZKT Garten" ], [ "100", "% Leo HZKT Fenster" ] ]Folgende möglich Einteilung:
< 20% rot
20 bis 30 % orange
30 bis 50 % hellorange50% grün
Anbei Export Widget
[{"tpl":"tplVis-materialdesign-Table","data":{"oid":"0_userdata.0.Diverses.Batteriefuellgrad","g_fixed":false,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"countCols":"1","tableLayout":"standard","showHeader":true,"roundBorder":"true","headerTextSize":"#mdwTheme:vis-materialdesign.0.fontSizes.table.header","headerFontFamily":"#mdwTheme:vis-materialdesign.0.fonts.table.header","colorBackground":"#mdwTheme:vis-materialdesign.0.colors.table.background","colorHeaderRowBackground":"#337fe1","colorHeaderRowText":"#000000","colorRowBackground":"#mdwTheme:vis-materialdesign.0.colors.table.row_background","colorRowBackgroundHover":"#mdwTheme:vis-materialdesign.0.colors.table.row_hover","colorRowText":"#mdwTheme:vis-materialdesign.0.colors.table.row_text","borderColor":"#mdwTheme:vis-materialdesign.0.colors.table.border","dividers":"#mdwTheme:vis-materialdesign.0.colors.table.dividers","showColumn0":"true","colType0":"text","textAlign0":"right","colTextSize0":"#mdwTheme:vis-materialdesign.0.fontSizes.table.row","fontFamily0":"#mdwTheme:vis-materialdesign.0.fonts.table.row","showColumn1":"true","colType1":"text","textAlign1":"left","colTextSize1":"#mdwTheme:vis-materialdesign.0.fontSizes.table.row","fontFamily1":"#mdwTheme:vis-materialdesign.0.fonts.table.row","lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"showColumn2":"true","colType2":"text","textAlign2":"center","colTextSize2":"#mdwTheme:vis-materialdesign.0.fontSizes.table.row","fontFamily2":"#mdwTheme:vis-materialdesign.0.fonts.table.row","showColumn3":"true","colType3":"text","textAlign3":"center","colTextSize3":"#mdwTheme:vis-materialdesign.0.fontSizes.table.row","fontFamily3":"#mdwTheme:vis-materialdesign.0.fonts.table.row","fixedHeader":true,"label0":"Füllgrad","label1":"Bezeichnung","columnWidth0":"89","headerRowHeight":"8","colNoWrap0":false,"padding_left0":"0","padding_right1":"-6","visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","rowHeight":"0","padding_right0":"2","colTextColor1":"","imageSize0":"0","columnWidth1":"520","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"imageSize1":"0"},"style":{"left":"30px","top":"54px","width":"357px","height":"612px","z-index":2},"widgetSet":"materialdesign"}]Hoffe das passt so.
Wir fangen mal mit der linken Tabelle an, ev. bring ich dann die beiden
anderen Tabellen selbst hin, da geht es ja nur noch um true und false, bzw. 0 und 1.VG Axel
-
Hi Oliver,
anbei json Tabelle:
[ [ "11", "% KG SW Zim HZKT" ], [ "22", "% OG Hobby Zim HZKT" ], [ "25", "% EG WZ Tuergr Kontakt" ], [ "25", "% Haust Türkont" ], [ "25", "% Leo Dachf Kont gr Raum" ], [ "25", "% OG Hobby Zim Dachfensterk" ], [ "33", "% ELW Schlafz Fensterk" ], [ "33", "% EG WC HZKT" ], [ "33", "% Haustür Gang HZKT" ], [ "33", "% Leo Dachf HZKT" ], [ "44", "% OG Buero HZKT" ], [ "50", "% Leo Dachfe Kont kl Raum" ], [ "50", "% OG WC Dachfenster Kont" ], [ "56", "% OG Bad HZKT" ], [ "56", "% OG Bad WTH" ], [ "56", "% EG Kueche HZKT" ], [ "56", "% EG Kueche Fensterk" ], [ "56", "% EG WZ HZKT Front" ], [ "56", "% ELW Bad Fensterk" ], [ "56", "% KG Bad HZKT" ], [ "56", "% Leo Fensterk" ], [ "56", "% OG Gast Fenster Kontakt" ], [ "56", "% OG Gast HZKT" ], [ "56", "% OG WC HZKT" ], [ "67", "% EG WC Fensterk" ], [ "67", "% EG WZ Fenterk Fliegeng" ], [ "67", "% ELW Bad HZKT" ], [ "67", "% ELW Bad WTH" ], [ "67", "% ELW Nebenz Fensterk" ], [ "67", "% KE Sauna WTH" ], [ "67", "% OG Hobby Zim Fensterk" ], [ "67", "% OG Hobby Zim WTH" ], [ "67", "% OG Buero WTH" ], [ "67", "% OG Buero Fensterk" ], [ "75", "% OG Bad Dachfe Kont" ], [ "75", "% KG Sauna Fensterk" ], [ "78", "% ELW Schlafz WTH" ], [ "78", "% Temp Feuchte Nordseite Haus" ], [ "78", "% Wintegarten Temp Feuchte" ], [ "78", "% EG Kueche WTH" ], [ "78", "% EG WZ Fensterk Front" ], [ "78", "% EG WZ Fenterk Garten" ], [ "78", "% EG WZ Fensterk Gartent" ], [ "78", "% EG WZ Fensterk Nachbar" ], [ "78", "% KG Gang WTH" ], [ "78", "% KG Sauna HZKT" ], [ "78", "% Leo WTH" ], [ "89", "% ELW Schlafz HZKT" ], [ "89", "% EG WZ Bewegme" ], [ "89", "% EG WZ HZKT Nachbar" ], [ "89", "% EG WZ WTH" ], [ "89", "% ELW Nebenz HZKT" ], [ "89", "% OG Gast WTH" ], [ "100", "% EG WZ HZKT Garten" ], [ "100", "% Leo HZKT Fenster" ] ]Folgende möglich Einteilung:
< 20% rot
20 bis 30 % orange
30 bis 50 % hellorange50% grün
Anbei Export Widget
[{"tpl":"tplVis-materialdesign-Table","data":{"oid":"0_userdata.0.Diverses.Batteriefuellgrad","g_fixed":false,"g_visibility":false,"g_css_font_text":false,"g_css_background":false,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"countCols":"1","tableLayout":"standard","showHeader":true,"roundBorder":"true","headerTextSize":"#mdwTheme:vis-materialdesign.0.fontSizes.table.header","headerFontFamily":"#mdwTheme:vis-materialdesign.0.fonts.table.header","colorBackground":"#mdwTheme:vis-materialdesign.0.colors.table.background","colorHeaderRowBackground":"#337fe1","colorHeaderRowText":"#000000","colorRowBackground":"#mdwTheme:vis-materialdesign.0.colors.table.row_background","colorRowBackgroundHover":"#mdwTheme:vis-materialdesign.0.colors.table.row_hover","colorRowText":"#mdwTheme:vis-materialdesign.0.colors.table.row_text","borderColor":"#mdwTheme:vis-materialdesign.0.colors.table.border","dividers":"#mdwTheme:vis-materialdesign.0.colors.table.dividers","showColumn0":"true","colType0":"text","textAlign0":"right","colTextSize0":"#mdwTheme:vis-materialdesign.0.fontSizes.table.row","fontFamily0":"#mdwTheme:vis-materialdesign.0.fonts.table.row","showColumn1":"true","colType1":"text","textAlign1":"left","colTextSize1":"#mdwTheme:vis-materialdesign.0.fontSizes.table.row","fontFamily1":"#mdwTheme:vis-materialdesign.0.fonts.table.row","lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"showColumn2":"true","colType2":"text","textAlign2":"center","colTextSize2":"#mdwTheme:vis-materialdesign.0.fontSizes.table.row","fontFamily2":"#mdwTheme:vis-materialdesign.0.fonts.table.row","showColumn3":"true","colType3":"text","textAlign3":"center","colTextSize3":"#mdwTheme:vis-materialdesign.0.fontSizes.table.row","fontFamily3":"#mdwTheme:vis-materialdesign.0.fonts.table.row","fixedHeader":true,"label0":"Füllgrad","label1":"Bezeichnung","columnWidth0":"89","headerRowHeight":"8","colNoWrap0":false,"padding_left0":"0","padding_right1":"-6","visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","rowHeight":"0","padding_right0":"2","colTextColor1":"","imageSize0":"0","columnWidth1":"520","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"imageSize1":"0"},"style":{"left":"30px","top":"54px","width":"357px","height":"612px","z-index":2},"widgetSet":"materialdesign"}]Hoffe das passt so.
Wir fangen mal mit der linken Tabelle an, ev. bring ich dann die beiden
anderen Tabellen selbst hin, da geht es ja nur noch um true und false, bzw. 0 und 1.VG Axel
Hier mal ein erster Wurf, da kann man noch nachjustieren
Als erstes den Adapter json-template installieren.
In vis müsste dann das widget JSON Template4 auftauchendannach das folgende widget importieren und den Datenpunkt anpassen

[{"tpl":"tplJSONTemplate4","data":{"g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":true,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","json_dpCount":"1","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"json_template":"<% \nconst colorRules = [\n { max: 20, color: \"#ff0000\" }, // < 20% -> rot\n { min: 20, max: 30, color: \"#ff9900\" }, // 20-30% -> orange\n { min: 30, max: 50, color: \"#ffcc80\" }, // 30-50% -> hellorange\n // optional: \"default\"-Regel für alles darüber\n { min: 50, color: \"#00aa00\" } // Beispiel: >= 50% -> grün\n];\nfunction colorForPercent(value, rules) {\n const v = Number(value);\n\n for (const rule of rules) {\n const minOk = rule.min === undefined || v >= rule.min;\n const maxOk = rule.max === undefined || v < rule.max;\n\n if (minOk && maxOk) return rule.color;\n }\n\n return null; // oder eine Default-Farbe wie \"#000\"\n}\n%>\n\n<style>\n#<%- widgetID %> {\n .table-wrapper{\n height: 100%; /* nutzt die 237px von #w00001 */\n overflow-y: auto; /* vertikal scrollen */\n overflow-x: auto; /* optional horizontal */\n }\n table {\n color:#44739e;\n box-sizing:border-box;\n border-collapse: collapse;\n white-space: normal;\n height:100%\n }\n thead {\n\n }\n thead th {\n height: 8px;\n font-size:110%;\n position: sticky;\n top: 0;\n z-index: 2;\n color:#000000;\n background-color:#337fe1;\n }\n td,th {\n padding-left:2px;\n padding-right:8px;\n }\n .col1 {\n text-align:right;\n }\n}\n</style>\n<div class=\"table-wrapper\">\n <table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th style=\"text-align: right;\">\n\t\t\t Füllgrad\n\t\t\t</th>\n\t\t\t<th style=\"text-align: left;\">\n Bezeichnung\n\t\t\t</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n <%\n data=data.sort((a, b) => a[0] - b[0]);\n for (var i = 0; i < data.length ; i++ ) {\n let el=data[i] \n %>\n\t\t<tr>\n\t\t\t<td class=\"col1\" style=\"background-color:<%- colorForPercent(el[0], colorRules) %>\">\n <%- el[0] %>\n </td>\n\t\t\t<td class=\"col2\">\n <%- el[1] %>\n </td>\n\t\t</tr>\n <% } %>\n\t</tbody>\n</table>\n</div>\n","class":"","json_oid":"0_userdata.0.table"},"style":{"left":"47px","top":"16px","width":"337px","height":"337px","background-color":"","color":"","font-style":"","background":"#ffffff"},"widgetSet":"vis-jsontemplate"}] -
Hier mal ein erster Wurf, da kann man noch nachjustieren
Als erstes den Adapter json-template installieren.
In vis müsste dann das widget JSON Template4 auftauchendannach das folgende widget importieren und den Datenpunkt anpassen

[{"tpl":"tplJSONTemplate4","data":{"g_fixed":true,"g_visibility":false,"g_css_font_text":true,"g_css_background":true,"g_css_shadow_padding":false,"g_css_border":false,"g_gestures":false,"g_signals":false,"g_last_change":false,"visibility-cond":"==","visibility-val":1,"visibility-groups-action":"hide","json_dpCount":"1","signals-cond-0":"==","signals-val-0":true,"signals-icon-0":"/vis/signals/lowbattery.png","signals-icon-size-0":0,"signals-blink-0":false,"signals-horz-0":0,"signals-vert-0":0,"signals-hide-edit-0":false,"signals-cond-1":"==","signals-val-1":true,"signals-icon-1":"/vis/signals/lowbattery.png","signals-icon-size-1":0,"signals-blink-1":false,"signals-horz-1":0,"signals-vert-1":0,"signals-hide-edit-1":false,"signals-cond-2":"==","signals-val-2":true,"signals-icon-2":"/vis/signals/lowbattery.png","signals-icon-size-2":0,"signals-blink-2":false,"signals-horz-2":0,"signals-vert-2":0,"signals-hide-edit-2":false,"lc-type":"last-change","lc-is-interval":true,"lc-is-moment":false,"lc-format":"","lc-position-vert":"top","lc-position-horz":"right","lc-offset-vert":0,"lc-offset-horz":0,"lc-font-size":"12px","lc-font-family":"","lc-font-style":"","lc-bkg-color":"","lc-color":"","lc-border-width":"0","lc-border-style":"","lc-border-color":"","lc-border-radius":10,"lc-zindex":0,"json_template":"<% \nconst colorRules = [\n { max: 20, color: \"#ff0000\" }, // < 20% -> rot\n { min: 20, max: 30, color: \"#ff9900\" }, // 20-30% -> orange\n { min: 30, max: 50, color: \"#ffcc80\" }, // 30-50% -> hellorange\n // optional: \"default\"-Regel für alles darüber\n { min: 50, color: \"#00aa00\" } // Beispiel: >= 50% -> grün\n];\nfunction colorForPercent(value, rules) {\n const v = Number(value);\n\n for (const rule of rules) {\n const minOk = rule.min === undefined || v >= rule.min;\n const maxOk = rule.max === undefined || v < rule.max;\n\n if (minOk && maxOk) return rule.color;\n }\n\n return null; // oder eine Default-Farbe wie \"#000\"\n}\n%>\n\n<style>\n#<%- widgetID %> {\n .table-wrapper{\n height: 100%; /* nutzt die 237px von #w00001 */\n overflow-y: auto; /* vertikal scrollen */\n overflow-x: auto; /* optional horizontal */\n }\n table {\n color:#44739e;\n box-sizing:border-box;\n border-collapse: collapse;\n white-space: normal;\n height:100%\n }\n thead {\n\n }\n thead th {\n height: 8px;\n font-size:110%;\n position: sticky;\n top: 0;\n z-index: 2;\n color:#000000;\n background-color:#337fe1;\n }\n td,th {\n padding-left:2px;\n padding-right:8px;\n }\n .col1 {\n text-align:right;\n }\n}\n</style>\n<div class=\"table-wrapper\">\n <table>\n\t<thead>\n\t\t<tr>\n\t\t\t<th style=\"text-align: right;\">\n\t\t\t Füllgrad\n\t\t\t</th>\n\t\t\t<th style=\"text-align: left;\">\n Bezeichnung\n\t\t\t</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n <%\n data=data.sort((a, b) => a[0] - b[0]);\n for (var i = 0; i < data.length ; i++ ) {\n let el=data[i] \n %>\n\t\t<tr>\n\t\t\t<td class=\"col1\" style=\"background-color:<%- colorForPercent(el[0], colorRules) %>\">\n <%- el[0] %>\n </td>\n\t\t\t<td class=\"col2\">\n <%- el[1] %>\n </td>\n\t\t</tr>\n <% } %>\n\t</tbody>\n</table>\n</div>\n","class":"","json_oid":"0_userdata.0.table"},"style":{"left":"47px","top":"16px","width":"337px","height":"337px","background-color":"","color":"","font-style":"","background":"#ffffff"},"widgetSet":"vis-jsontemplate"}]@OliverIO Hi, erst mal herzlichen Dank für den ersten Entwurf. Was ist das für eine Sprache?
Leider sind noch Fehler vorhanden, im VIS Editor sieht es noch gut aus, jedoch VIS runtime bringt Fehler.


Zur Ergänzung wären folgende Wünsche / Anmerkungen offen:
- du sortierst die Liste nochmals, wenn ich dies richtig sehe, sollte nicht nötig sein, da in Blockly vorsortiert
- mir wäre doch lieber, wenn die Texte farbig sind und natürlich beide Spalten.
VG Axel
-
@OliverIO Hi, erst mal herzlichen Dank für den ersten Entwurf. Was ist das für eine Sprache?
Leider sind noch Fehler vorhanden, im VIS Editor sieht es noch gut aus, jedoch VIS runtime bringt Fehler.


Zur Ergänzung wären folgende Wünsche / Anmerkungen offen:
- du sortierst die Liste nochmals, wenn ich dies richtig sehe, sollte nicht nötig sein, da in Blockly vorsortiert
- mir wäre doch lieber, wenn die Texte farbig sind und natürlich beide Spalten.
VG Axel
so hier die korrigierte Version.
Da hat leider der binding mechanismus von vis zugeschlagen.
der mag komprimierte JSON-Notation nicht so bzw. interpretiert das als binding.
Die Sortierung habe ich auskommentiert
Die Farbgebung habe ich nun auf Spalte 1 und Spalte 2 angewendet
Anstatt den Hintergrund habe ich nun die Schrift eingefärbt. Die eine Farbe müsste man wahrscheinlich noch anpassen, die ist vor Weißem Hintergrund schlecht lesbar.
Sprache
Die verwendete technologie ist ein Template-System, welches die Mischung von HTML/CSS/JS möglich macht. Bei der Anzeige werden die bereitgestellten Daten als Variablen bereitgestellt und können dann als Javascript in das HTML eingefügt werden.
Mehr Details dazu in der Adapter Beschreibung
https://github.com/oweitman/ioBroker.vis-jsontemplate
Damit kann man dann, entsprechendes Wissen zu HTML/JS/CSS vorausgesetzt. eigene Widgets relativ einfach umsetzen, ohne gleich einen ganzen Adapter zu erstellen.