This code won't work. The sensor list missing the for loop that's populating it, and the original one is missing the M3 unpack. It's a merge of an old and a new code but both incomplete.
Please reference https://devapps.diality.us/cru/LEAHI-DIALIN-LDT-3480-1 for working solution on this.