Hello,
I have a gateway tag change script that is looking at the change of an alarm tag, I want to make it execute only when the alarm is true and not when the alarm is false. Here is my script but for some reason it is still executing when the alarms goes true and when the alarms goes back to false.
[color=#0040BF]Alarm = system.tag.getTagValue(“system1/project1/HTST_1/ALARMS/MILK_TOO_HOT”)
curHour = system.tag.getTagValue(“curTime”)
Temp = system.tag.getTagValue(“system1/project1/HTST_1/Analog/TT130177_SCL”)
body="Pasturized Milk Temp @ " + str(Temp)+ “°F for over 10 min”
if curHour > 9 :
recipients = [“xxxxx@txt.att.net”,“xxx@txt.att.net”]
else :
recipients = [“xxxx@txt.att.net”]
if Alarm :
system.net.sendEmail(smtp=“smtp.xxx”, from="alarms@xxxx.com", subject=“Pasturized Milk Temp High”, body=body,html=0, to=recipients,username="alarms@xxx.com",password=“xxxx”)[/color]
What amd I doing wrong?