Indirectly Referencing Thing Properties in Script
I am looking for a way to iterate through a number of similarly named properties in an service to count the number of current alarms. I am not a JavaScript expert and have tried the following script but it does not seem to work:
me.z_AlarmCount = 0
for (var i=301;i<396;i++)
var n = i.toString()
me.DebugString = "me.Alarm_CCP_Boiler_" + n;
{
if (("me.Alarm_CCP_Boiler_" + n) == 1)
{
me.z_AlarmCount = me.z_AlarmCount + 1;
}
}
Any assistance or advise would be appreciated.
Many Thanks
Jan Hemper
InVMA

