[SOLVED] Value in a group from its item

Hello everyone! i’m new in here but i follow this community from many months, and i got many many help from your topics to improve my knowledge of openhab.
BTW, at the moment i’m stuck in a problem and i haven’t found a clear solution to let me continue on improve my home OH.

i’ve created a frame in .sitemaps showing group thermostats, and inside the group other values including temperature. what i would like to do, is show the temperature value in the group, but the value has to be taken from the item inside the group.

Frame label="Temperature" {
            Group item=TermostatoSala icon=temperature label="Termostato sala [%.1f °C]"
     }

in .items i’ve got this group TermostatoSala that includes:

Group TermostatoSala "Termostato sala"

Number ActualTemp_1 "Temperatura Sala [%.1f °C]" <temperature> (Temperatura,TermostatoSala) {bticino="if=webserver;who=4;what=0;where=1"}
Number ControlTemp_1 "Controllo Temperatura [%.1f °C]" <temperature> (Temperatura,TermostatoSala) {bticino="if=webserver;who=4;what=12;where=1"}
Number OffsetTemp_1 "Temperatura Offset [MAP(bticino_offset.map):%s]" <qualityofservice> (Temperatura,TermostatoSala) {bticino="if=webserver;who=4;what=13;where=1"}
Number SetTemp_1 "Imposta Temperatura [%.1f °C]" <temperature_hot> (Temperatura,TermostatoSala) {bticino="if=webserver;who=4;what=14;where=1"}
Number HCtrlMode_1 "Modalita Operativa [MAP(bticino.map):%s]" <settings> (Temperatura,TermostatoSala) {bticino="if=webserver;who=4;what=100;where=1"}
Number HOpMode_1 "Stato operativo [MAP(bticino.map):%s]" <zoom> (Temperatura,TermostatoSala) {bticino="if=webserver;who=4;what=101;where=1"}
Contact HValve_1 "Attuatore [MAP(bticino.map):%s]" <pressure> (Temperatura,TermostatoSala) {bticino="if=webserver;who=4;what=20;where=1"}

i just would like to have the temperature shown from “ActualTemp_1” also shown in “TermostatoSala” group in sitemaps.

how can i do this?

thanks to anyone that will help me.

Group:Number TermostatoSala
rule xxx
when
    Item TermostatoSala changed
then
    TermostatoSala.postUpdate(ActualTemp_1.state)
end

Maybe:

rule xxx
when
    Item ActualTemp_1 changed
then
    TermostatoSala.postUpdate(ActualTemp_1.state)
end

thanks a lot! this evening i will try to update the conf at home.

@hr3 and @vzorglub, one danger of using this approach using a Rule is that I’m pretty sure the postUpdate will also update all the members of ThermostatoSala. I’m not positive about that though. If you know differently it would be good to know.

Assuming I’m right, you won’t be able to use the Group element on your sitemap but you can get the exact same behavior using a Text with a sub Frame

Text item=ActualTemp_1 {
    Frame label = "Temperature" {
        Text item=ActualTemp_1
        Text item=ControlTemp_1
        ...
    }
}
1 Like

I have tested that, but it doesn’t.

1 Like

Yes I saw that and I sort of remembered that it works for sendCommand but not postUpdate for some reason.
Glad it’s sorted

It does make some sense. A postUpdate in concept does not usually go beyond updating the Item. So when you call postUpdate, the Binding or Channels linked to that Item are typically not triggered. So it is consistent with this concept that postUpdate to a Group would not filter down to the Items.

It would be equally consistent though for the postUpdate to actually filter down to the members as the other event action sendCommand does filter down to the members.

So the intuitivly expected behavior is ambiguous in this case. I’m glad we have the actual behavior nailed down. I’ll be sure to remember it.

Hello! I’ve tried the post update method but doesn’t show the value from the item…with the sitemap method work perfectly!
Next step i will open a topic to insert ipcam in habpanel…

Thanks for your help friends!