Put them all in the same Group, I’ll call it Xiaomi_Temps.
rule "Xiaomi Temp Status Changed"
when
Member of Xiaomi_Temp changed // assuming you named the Rule appropriately and you care about changes not updates
then
postUpdate(triggeringItem.name+"_komplett", String::format("%1$.1f °C / %2$.0f % ( %3$td.%3$tm., %3tH:%3$tM)", Xiaomi_Temp_1.state as Number, Xiaomi_Humidity_1.state as Number, new Date() )
end
I’m not certain whether the format will work with Number or not so you might still need to call toFloat.
See Design Pattern: Associated Items for further explanation of the overall approach. The big thing is make sure your Items are all names so you can construct the name of on from the name of it’s assocaited Items. Then it is just some simple String manipulation to build the name of the associated Item and send it commands or post updates or pull it out of a Group or the Item registry.