Changes for page 2 Script

Last modified by Devin Chen on 2025/12/10 10:32

From version 3.1
edited by Devin Chen
on 2025/09/05 11:51
Change comment: There is no comment for this version
To version 5.1
edited by Devin Chen
on 2025/09/09 11:17
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -29,8 +29,13 @@
29 29  
30 30  The following demo shows that when the alarm condition is reached: temp1 > 5 & temp2 >10 & temp3 < 20(lasts more than 5 seconds) , then send an "alarm trigger" sms.
31 31  
32 -When the alarm condition is released,then send an  "alarm release" sms. Script is as below:
32 +When the alarm condition is released,then send an  "alarm release" sms.
33 33  
34 +Registers setting
35 +\\[[image:1757387490907-390.png]]
36 +
37 +Script is as below:
38 +
34 34  {{code language="lua"}}
35 35  function sms.main()
36 36  ------send condition------
... ... @@ -50,11 +50,16 @@
50 50  ------send sms & output Y0------
51 51  if timer > 5 then
52 52   if tag == 0 then
53 - send_sms_ira("19859254700","alarm trigger")
58 + --send SMS to 2 recipients
59 + send_sms_ira("198****4700","alarm trigger")
60 + local id = send_sms_ira("187****3130","alarm trigger")
61 + --get the SMS state from ID
62 + local state = sms_get_state(id)
63 + addr_setword("@state",state)
54 54   addr_setbit("@Tag",1)
55 55   end
56 56  elseif tag == 1 then
57 -send_sms_ira("19859254700","alarm release")
67 +send_sms_ira("198****4700","alarm release")
58 58  addr_setbit("@Tag",0)
59 59  end
60 60  end
1757387490907-390.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.DevinChen
Size
... ... @@ -1,0 +1,1 @@
1 +47.9 KB
Content