So far it's working well like this:
power < 12.2 && (!ignition || !motion)
? (
alarm
? (alarm.contains("lowBattery") ? alarm : alarm + ",lowBattery")
: "lowBattery"
)
: (alarm ? alarm : null)
I think this post is going to help me solve some of my own issues with alarms I'm having right now.
If you want to support multiple alarms, you have to update your TRUE case as well, of course. You need to concatenate new alarm to existing values.