It is definitely possible to do, but I still don't understand why it needs to be done.
you do not answer my question!
because the alarm does not remain set
Sorry, I cannot provide you a full solution because it's pretty complicated.
I have now found the following solution:
Attribute: alarm
Expression: batteryLevel < 55 && lastBatteryLevel >= 55 ? "lowBattery" : null
Type: string
And add following in the config:
<entry key='processing.computedAttributes.lastAttributes'>true</entry>
have you a solution?