I have several items for current temperature, humidity and target temperature.
I have the group gThermostat that includes all of the above.
In all UIs, the thermostat group shows with its label and a NULL. I guess that’s the state of the item, which is undef because I didn’t define an item type nor a function. I’d like to define the item-type of group gThermostat as String, and set its state as a sum-up of the children. The children are numbers. The function needs to get the value of each child and format them as a string, like “22C - T 25C - 45%”
In the documentation I see there is only a limited number of functions available. Can we create our own?
Alternatively, I tried creating a rule to update the group state whenever a child is updated. And that kind of works, but the state is reset to undef right away by, I think, the default EQUALITY function. Can I ‘disable’ this function for my group?
rule “gThermostat updater”
when
Member of gThermostat changed
then
gThermostat.postUpdate("")
end
One of the standard MainUI widget actions is to open a specified group popup.
For any page you should be able to use the gui editor to create a label card with whatever item you want as the label and then configure the card to show you the group popup of some different group item.
I ended up creating my own list widget, which allowed me to customize the RHS text in the list and even add list-items from different groups. It wasn’t easy though. I wish there were more examples in the documentation. The custom widget system looks really powerful.