Dimmer item behaviour with Group items

(JustAProgrammer) #1

So I have the following setup:

Group:Dimmer:AVG gYBrightness  "Lampenhelligkeit  [%d]" (gBrightness)
Group:Dimmer:AVG gABrightness  "LEDs helligkeit  [%d]" (gBrightness)
Group:Dimmer:AVG gBrightness "helligkeit  [%d]" ["Switchable"] {autoupdate="false"}

and a python script running like this:

    elif "SHAKE_AIR" in str(event2):
        if (int(float(str(items["gBrightness"]))) > 20):
            i = int(float(str(items["gBrightness"]))) - 20
            logXC.info(str(i))
            events.sendCommand("gBrightness",str(i))

but the Dimmeritems don’t take values around 20-100. They change trough other item values like this:

2019-05-12 14:06:43.400 [GroupItemStateChangedEvent] - gYBrightness changed from 77.77777800 to 88.88888900 through Yeelightc_3

2019-05-12 14:06:43.405 [GroupItemStateChangedEvent] - gBrightness changed from 59.25925900 to 62.96296300 through gYBrightness

2019-05-12 14:06:43.410 [GroupItemStateChangedEvent] - gYBrightness changed from 88.88888900 to 100.00000000 through Yeelightc_9

How can I stop this behaviour? I want to have all items brightness in those groups set to for example “30”. Didn’t find anything related in the docs, a simple url to the informations I need is enough.
Thanks alot!

0 Likes

(Rossko57) #2

Group states are (optionally) calculated from member states. In your case, AVG of members. Group states are not affected by sending commands to the Group.

When you send a command to a Group, it gets passed along to all the Group members. That’s all.

Okay, so when you have real devices as group members, it will go
Command -> Group -> Command -> each member.Item -> Command -> device

At some time, devices will update status -> Item state -> triggers Group recalculate

If there are several devices, you will get many group recalculates, with all sorts of intermediate values as Item states change.

Some dimmer type devices may give several state changes as the fade from one setting to another. Each triggering a Group update.

What behaviour is it you wanted to change?

1 Like

(JustAProgrammer) #3

Oh god, I’ve completly forgot about the aggregate functions.
Thanks alot rossko, I’ve just cut out the average parameter and everythings working fine now, thanks!

0 Likes