This Group has no type, so it can’t take up any state.
If it had a type, this Group has still no state by default. (so it will never change)
You need to assin it a type and some kind of aggregatation function that allows for calculation of its state from member Item states.
Depending what you want to do with the rule, you may also be interested in Member of trigger
I needed to specify the group as being a number group. Then i was able to do the members, total up all the individual pack voltages and get my overall battery. Just like I needed!!! Thank you
rule "Power Wall Battery Total"
when
Item gPowerwall received update
then
var float totalbatteryvolts
gPowerwall.members.forEach[pack |
totalbatteryvolts = totalbatteryvolts + (pack.state as DecimalType).floatValue
]
postUpdate(pw1voltage,totalbatteryvolts.floatValue)
end
Group:Number gPowerwall
Number pw1voltage "Power Wall 1 Total Voltage [%s]"
Number pw1p1 "Power Wall 1 - Pack 1 [%s]" (gPowerwall) { channel = "mqtt:topic:broker1:Powerwall01:pack1voltage" }
Number pw1p2 "Power Wall 1 - Pack 2 [%s]" (gPowerwall) { channel = "mqtt:topic:broker1:Powerwall01:pack2voltage" }
Number pw1p3 "Power Wall 1 - Pack 3 [%s]" (gPowerwall) { channel = "mqtt:topic:broker1:Powerwall01:pack3voltage" }
Number pw1p4 "Power Wall 1 - Pack 4 [%s]" (gPowerwall) { channel = "mqtt:topic:broker1:Powerwall01:pack4voltage" }