Changes for page 2 Script
Last modified by Devin Chen on 2025/12/10 10:32
From version 5.1
edited by Devin Chen
on 2025/09/09 11:17
on 2025/09/09 11:17
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 4 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. DevinChen1 +XWiki.Wecon - Content
-
... ... @@ -29,13 +29,8 @@ 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. 32 +When the alarm condition is released,then send an "alarm release" sms. Script is as below: 33 33 34 -Registers setting 35 -\\[[image:1757387490907-390.png]] 36 - 37 -Script is as below: 38 - 39 39 {{code language="lua"}} 40 40 function sms.main() 41 41 ------send condition------ ... ... @@ -55,16 +55,11 @@ 55 55 ------send sms & output Y0------ 56 56 if timer > 5 then 57 57 if tag == 0 then 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) 53 + send_sms_ira("19859254700","alarm trigger") 64 64 addr_setbit("@Tag",1) 65 65 end 66 66 elseif tag == 1 then 67 -send_sms_ira("198 ****4700","alarm release")57 +send_sms_ira("19859254700","alarm release") 68 68 addr_setbit("@Tag",0) 69 69 end 70 70 end ... ... @@ -570,58 +570,6 @@ 570 570 end 571 571 {{/code}} 572 572 573 -== **1.12 Get UTC timestamp and local timezone timestamp** == 574 - 575 -This demo shows how to obtain UTC standard time from the V-Box and get the local time based on the device's time zone. 576 - 577 -**Register configuration** 578 - 579 -[[image:1757043722849-910.png]] 580 - 581 -**Script configuration** 582 - 583 -(% style="text-align:center" %) 584 -[[image:1757043900216-610.png||height="412" width="439"]] 585 - 586 - 587 -**Script** 588 - 589 - 590 - 591 -{{code language="lua"}} 592 -function time.main() 593 - 594 - --Get Coordinated Universal Time 595 - local timestamp = os.time() 596 - local utcTimeTable = os.date("!*t", timestamp) 597 - local utcTimestamp = os.time(utcTimeTable) 598 - local formattedTime = os.date("%Y-%m-%d %H:%M:%S", utcTimestamp) 599 - 600 - print("UTC: " ..formattedTime) 601 - 602 - --Calculate the local time at the device's location 603 - local utc_7Timestamp = os.time(utcTimeTable) + 25200 -- Enter the corresponding number of seconds based on the time difference,used UTC+7 as an example.. 604 - local formattedTime1 = os.date("%Y-%m-%d %H:%M:%S", utc_7Timestamp) 605 - print("UTC+7: " .. formattedTime1) 606 - 607 - 608 - --Assign the decomposed timestamp to the specified register 609 - addr_setword("@UTC+7_Second",os.date("%S", utc_7Timestamp)) 610 - addr_setword("@UTC+7_Minute",os.date("%M", utc_7Timestamp)) 611 - addr_setword("@UTC+7_Hour",os.date("%H", utc_7Timestamp)) 612 - addr_setword("@UTC+7_Day",os.date("%d", utc_7Timestamp)) 613 - addr_setword("@UTC+7_Month",os.date("%m", utc_7Timestamp)) 614 - addr_setword("@UTC+7_Year",os.date("%Y", utc_7Timestamp)) 615 - print("--------------------------------------") 616 - 617 -end 618 -{{/code}} 619 - 620 -**Result** 621 - 622 -(% style="text-align:center" %) 623 -[[image:1757044137457-543.png||height="468" width="708"]] 624 - 625 625 = **2 Third part server** = 626 626 627 627 V-Box have two mode.One is for V-Net,User need to use WECON server to store data.We call this V-NET platform.
- 1757043722849-910.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.DevinChen - Size
-
... ... @@ -1,1 +1,0 @@ 1 -74.4 KB - Content
- 1757043900216-610.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.DevinChen - Size
-
... ... @@ -1,1 +1,0 @@ 1 -62.9 KB - Content
- 1757044137457-543.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.DevinChen - Size
-
... ... @@ -1,1 +1,0 @@ 1 -99.4 KB - Content
- 1757387490907-390.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.DevinChen - Size
-
... ... @@ -1,1 +1,0 @@ 1 -47.9 KB - Content