Problem updating group item after OH3 upgrade

Hi,

I’ve this item:

Group:Number    gMiTempLounge                        "Mi Temp/Hum Lounge [%.1f °C]"                                                  <temperature>
Number          GP0_Mi_Temp_Lounge_Wifi_Strength     "Mi Temp/Hum WiFi Signal Strength [%d %%]"                              <network>       (gMiTempLounge)                                                         { channel="mqtt:topic:rabbitmq:mi-temp-lounge:rssi" }
Number          GP0_Mi_Temp_Lounge_Distance          "Mi Temp/Hum WiFi Distance [%.2f]"                                              <network>       (gMiTempLounge)                                                         { channel="mqtt:topic:rabbitmq:mi-temp-lounge:distance" }
Number          GP0_Mi_Temp_Lounge_Temp              "Mi Temperatura Lounge [%.2f °C]"                                               <temperature>   (gTemp,gMiTempLounge)                                           { channel="mqtt:topic:rabbitmq:mi-temp-lounge:temperature" }

And in OH2 this rule:

rule "update mi lounge temp"
when
    Member of gMiTempLounge received update
    or
    System started
then
    logInfo("group-updates", "gMiTempLounge before: " + gMiTempLounge.state + " temp: " + GP0_Mi_Temp_Lounge_Temp.state)
    gMiTempLounge.postUpdate(GP0_Mi_Temp_Lounge_Temp.state)
    logInfo("group-updates", "gMiTempLounge after: " + gMiTempLounge.state + " temp: " + GP0_Mi_Temp_Lounge_Temp.state)
end

Log:

2021-01-25 22:39:54.677 [INFO ] [nhab.core.model.script.group-updates] - gMiTempLounge before: UNDEF temp: 16.8
2021-01-25 22:39:54.678 [INFO ] [nhab.core.model.script.group-updates] - gMiTempLounge after: UNDEF temp: 16.8
2021-01-25 22:39:54.679 [INFO ] [nhab.core.model.script.group-updates] - gMiTempLounge before: 16.8 temp: 16.8
2021-01-25 22:39:54.679 [INFO ] [nhab.core.model.script.group-updates] - gMiTempLounge after: 16.8 temp: 16.8

Works, but in OH3 sometimes, I have UNDEF in update. Something changed in OH3?

Thx,

I think this might actually be cause by the postUpdate being asynchronous and hence the after log command is almost instantaneous.

You’re not supposed to be able to postUpdate to a Group. I’m surprised it ever did anything. Group states (if any) are supposed to be calculated from an aggregation of some kind of the members states.
Maybe it reverts to UNDEF every time a member updates.

But yes, even if it works, like any postUpdate or command it is asynchronous, your rule does not stop and wait for it to take place.