Working with Homemaitc IP Heating Groups - Question about LowBat Switch

Hey,
im just starting to implement my Homematic IP Setting into Openhab. I have some Heating Groups which are defined in Homematic (CCU3) and also imported into Openhab.
The Groups also have a LowBat-Switch-Channel - and i would like to know how it works ?
When one Items which is inside my Group gets a LowBat Warning will theLowBat Switch from the Group turn on ?

Im using Rules to send me a Telegram Message when an Items is on LowBat - so this would be nice to know and i have to watch for only one Switch instead of 4-5....just dont know how to test this…i haven`t any low Batteries here at the moment…maybe someone can contribute ?

I have solved it this way:

homematic.items

Group:Switch:OR(ON, OFF) gBatteries "Battery status (all) [MAP(battery.map):%s]" <lowbattery>
...
Switch Sensor1_LowBattery "Sensor 1 Battery low" <lowbattery> (gBatteries) { channel="homematic:HmIP-STHO:ccu:<ID1>:0#LOW_BAT" }
Switch Sensor2_LowBattery "Sensor 2 Battery low" <lowbattery> (gBatteries) { channel="homematic:HmIP-STHO:ccu:<ID2>:0#LOW_BAT" }
...

battery.map

ON=LOW
OFF=FULL

myrules.rules

rule "Notification when a battery is low"
when 
    Member of gBatteries changed to ON
then
    var String msg = String::format("Sensor %s has a low battery", triggeringItem.name)
    logWarn("battery low", msg)
end
2 Likes

I want to use this exactly as suggested above but I can’t get the transformation to work. In other words: I don’t want the output to be:

Sensor Sensor1_LowBattery has a low battery
but
Sensor kitchen has a low battery

I’ve read the transformation chapter in the docs but as a beginner I still don’t know how to “combine” the line
var String msg = String::format("Sensor %s has a low battery", triggeringItem.name)
with something like
transform("MAP", "battery.map", %s)

I already added all of my battery driven devices to the battery.map file which looks like this:

Sensor1_LowBattery=office
Sensor2_LowBattery=kitchen
...

Could somebody help please?