Notify of device with Low Battery based on "Battery Monitor" plugin

I have a device, Battery Monitor, that has a field “LowDeviceList”. It keeps a list of device IDs that have low batteries. For instance, 120,165,182.

I want a VeraAlert, or a scene with luup code, that does something like this:

get LowDeviceList value
parse the string
for each ID, get the name
email me via VeraAlerts the device names for each ID so I can change the batteries.

Anyone know how to do this? If it was VBA, I could do it in a heartbeat. Thanks for your help.

I finally got my code working. It works well, but I need some help with VeraAlerts SMTP-Mail.

[code]local vBatMonID = 431
local vLowDevIDs = luup.variable_get(“urn:upnp-org:serviceId:BatteryMonitor1”,“LowDeviceList”, vBatMonID)
local vDevNames = “Devices with Low Battery:\n-----------------------------”
function ParseDevIDs (s)
s = s … ‘,’ – ending comma
local t = {} – table to collect fields
local fieldstart = 1
repeat
local nexti = string.find(s, ‘,’, fieldstart)
local vDevID = string.sub(s, fieldstart, nexti-1)
vDevID = tonumber(vDevID)
local vDevName = luup.devices[vDevID].description
vDevNames = vDevNames…“\n”…vDevName

  fieldstart = nexti + 1

until fieldstart > string.len(s)
return t
end

ParseDevIDs(vLowDevIDs)
print(vDevNames)
luup.call_action(“urn:upnp-org:serviceId:IOSPush1”, “SendProwlNotification”, {Event=“Battery Monitor”, Description=vDevNames, Priority=2, URL=“”}, 378)
luup.call_action(“urn:richardgreen:serviceId:VeraAlert1”, “SendAlert”, {Subject= “Vera Alert: Devices with Low Battery”, Message = vDevNames, Recipients = “SMTP-Mail”}, 51)[/code]

I cannot get the subject of the email to change. It still says “Vera Notification”. Is there a way to change it? I thought “Subject =” was the solution.