Counting active Lights with HUE-Groups?

I created groups for every of my HUE lamps to combine all settings.
In the end I want to count all active lamps in each room and all together.

And here ist the problem for the HUE-groups each setting is counted, specially the colortemperature,
if I switch a HUE-lamp off the colortemperature stays the same and makes the lamp still being count.

Is there a nice way to avoid that and still keep the group?

Group:Switch:OR(ON, OFF)  gLampen   	"Beleuchtung [(%d)]"         	<light>       	(ALL)

Group:Switch:OR(ON, OFF)  gLampenSZ   	"Lampen SZ [(%d)]" 	        	<light>       	(gLampen, gSchlafzimmer)
Group:Switch:OR(ON, OFF)  gLampenBad   	"Lampen Bad [(%d)]"         	<light> 		(gLampen, gBad)
Group:Switch:OR(ON, OFF)  gLampenAZ   	"Lampen AZ [(%d)]"         		<light> 		(gLampen, gArbeitszimmer)
Group:Switch:OR(ON, OFF)  gLampenWZ   	"Lampen WZ [(%d)]"         		<light> 		(gLampen, gWohnzimmer)
Group:Switch:OR(ON, OFF)  gLampenK  	"Lampen Küche [(%d)]"         	<light> 		(gLampen, gKueche)
Group:Switch:OR(ON, OFF)  gLampenFlur  	"Lampen Flur [(%d)]"         	<light> 		(gLampen, gFlur)

// Schlafzimmer
Switch	DeckenlampeSZ		"Deckenlampe SZ"		<light> ( gLampenSZ )							[ "Lighting" ]		{ channel="homematic:HM-LC-Sw2-FM:x:KEQ1073512:1#STATE" }
Switch	Ankleidelampe		"Ankleidelampe SZ"		<light> ( gLampenSZ )							[ "Lighting" ]		{ channel="homematic:HM-LC-Sw1-FM:x:KEQ1075291:1#STATE" }

Group:Switch:OR(ON, OFF) gHue						<colorwheel>	
Group:Color gHueColor  	"Hue Lampen Farbe"			<colorwheel> 									
Group:Switch gHueToggle	"Hue Lampen"				<light> 		
Group gHueAlarm			"Hue Alarm"					<alarm>									
Group gHueColorLoopWZ	"Hue Color Loop WZ"			<colorwheel>	

// Bulb3  Schlafzimmer
Group:Switch gHue3												(gHue, gLampenSZ)
Switch	Hue3_Toggle		"Farblampe 3 SZ"	<colorwheel>		(gHue3,gHueToggle) 							{ channel="hue:0210:x:1:brightness" }
Dimmer  Hue3_Dimmer		"Dimmer 3 [%d%%]"	<light> 			(gHue3)										{ channel="hue:0210:x:1:brightness" }
Color 	Hue3_Color		"Farbe 3"			<colorwheel> 		(gHue3,gHueColor)							{ channel="hue:0210:x:1:color" }
Dimmer 	Hue3_ColorTemp	"Farbtemperatur 3"	<colorwheel>		(gHue3)										{ channel="hue:0210:x:1:color_temperature" }
String 	Hue3_Alarm		"Alarm 3"			<alarm> 			(gHue3,gHueAlarm)  							{ channel="hue:0210:00178823bc22:1:alert" }
Switch 	Hue3_ColorLoop	"ColorLoop 3"		<colorwheel> 		(gHue3)  									{ channel="hue:0210:x:1:effect" }

You will need to do this in rules I think.

You will either need to have a rule that changes the colortemperature in a light when it is turned off or a rule to calculate the sum based on the full state of your bulbs.

Thank you! So there is no elegant solution, then I might think over the structure