Hey guys, noob here, I am trying to show all my lights but seems like it won’t work, what have I done something wrong?
I have a root group called gLight
that contains 2 sub-groups(gLiving
and gKitchen
, each group has lights)
items:
Group:Switch:OR(ON,OFF) gLight "all lights" <light>
Group:Switch:OR(ON,OFF) gLiving "living area" <light> (gLight)
Group:Switch:OR(ON,OFF) gKitchen "kitchen area" <light> (gLight)
Switch liv01 "V1_liv01" <light> (gLiving)
Switch liv02 "V2_liv02" <light> (gLiving)
Switch liv03 "V3_liv03" <light> (gLiving)
Switch kit01 "V1_kit01" <light> (gKitchen)
Switch kit02 "V2_kit02" <light> (gKitchen)
Then in habpanel,
<div class="section">
<div class="sectionIconContainer"><div class="sectionIcon"><svg viewBox="0 0 48 48"><use xlink:href="/static/matrix-theme/matrixicons.svg#light_bulb"></use></svg></div></div>
<div class="title"><div class="name"><font color="#267A50">Light Counts</font></div>
<div class="summary">
ON: <font color="#267A50"><b>{{(itemsInGroup('gLight') | filter:{state:'ON'}).length}}</b></font>
/ OFF: <b>{{(itemsInGroup('gLight') | filter:{state:'OFF'}).length}}</b>
/ ALL: <b>{{(itemsInGroup('gLight')).length}}</b>
</div>
</div>
The result returns to total light counts is only 2
, but I do have 5 visual lights, what cause this problem? Does the gLight
group only counts 2 because there are only two groups
in this group?(but can’t count the items in sub-group?)…
btw, do this code can counts item in groups and sub-groups?
{{(itemsInGroup('gLight')).length}}
Could someone please help a noob guy? Thank you so much!