148
52.
-- got value, send response
53.
if
value ~
=
nilthen
54.
jvalue
=
json.pencode
(
value
)
55.
if
obj.name
then
56.
name
=
string.format
(
'%s (%s)'
, obj.name, obj.address
)
57.
end
58.
cmd
=
string.format
(
'Value of %s is %s'
, name, jvalue
)
59.
modem:sendsms
(
sender, cmd
)
60.
end
61.
end
62.
end
63.
end
64.
end
65.
-- incoming sms handler
66.
handler
=
function
(
sms
)
67.
alert
(
'incoming sms from %s (%s)'
, sms.sender, sms.data
)
68.
-- sms from known number, call parser
69.
iftable
.contains
(
numbers, sms.sender
)
then
70.
parser
(
sms.data, sms.sender
)
71.
end
72.
end
73.
-- set sms handler
74.
modem:setsmshandler
(
handler
)
75.
-- send pin if set
76.
if
pincode
then
77.
modem:send
(
'AT+CPIN='
.. pincode
)
78.
end
79.
-- set to pdu mode
80.
modem:send
(
'AT+CMGF=0'
)
81.
-- enable sms notifications
82.
modem:send
(
'AT+CNMI=1,1,0,0,0'
)
83.
alert
(
'SMS handler started'
)
84.
end
85.
modem:run
()
9.3.
Send SMS messages to specific SIM numbers after group-read or
group-write is triggered
Task:Assume we have an Event-based script which triggers a program once group-read or group-
write is triggered for address 1/1/1. We want to send SMS to numbers 23335555 and 23335556
with 1/1/1 actual status.
1.
require
(
'socket'
)
2.
3.
client
=
socket.udp
()
4.
Содержание LogicMachine3 Re:actor
Страница 10: ...10 Terminal connection schemes KNX TP...
Страница 12: ...12 24V power supply...
Страница 13: ...13 Analog inputs e g reed contact...
Страница 14: ...14 Analog inputs 0 10V...
Страница 15: ...15 Digital output...
Страница 16: ...16 Resistive sensor input...
Страница 17: ...17 Analog output...
Страница 26: ...26 Make sure that bus status is Online press button in ETS...
Страница 35: ...35 o Then minimize side bar by pressing on left arrow icon to make the map more visible...
Страница 83: ...83 66 if err then 67 alert FTP upload failed s err 68 end...
Страница 107: ...107...
Страница 108: ...108 1 14 Help Documentation for scripting syntaxes is displayed in Help tab...
Страница 122: ...122 4 16 Running processes System running processes can be seen in Status Running processes window...
Страница 126: ...126 Datapoints can be shown also in a way of table which can be later exported as CSV file...
Страница 141: ...141...