-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmovimiento.json
186 lines (186 loc) · 5.45 KB
/
movimiento.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
{
"ruleChain": {
"additionalInfo": {
"description": ""
},
"name": "Movimiento",
"type": "CORE",
"firstRuleNodeId": null,
"root": false,
"debugMode": false,
"configuration": null
},
"metadata": {
"firstNodeIndex": 1,
"nodes": [
{
"additionalInfo": {
"description": "",
"layoutX": 612,
"layoutY": 57
},
"type": "org.thingsboard.rule.engine.metadata.TbGetTelemetryNode",
"name": "agrego server_ip",
"debugMode": true,
"configuration": {
"latestTsKeyNames": [
"server_ip"
],
"aggregation": "NONE",
"fetchMode": "FIRST",
"orderBy": "ASC",
"limit": 1000,
"useMetadataIntervalPatterns": false,
"startInterval": 2,
"startIntervalTimeUnit": "MINUTES",
"endInterval": 1,
"endIntervalTimeUnit": "MINUTES",
"startIntervalPattern": "",
"endIntervalPattern": ""
}
},
{
"additionalInfo": {
"description": "",
"layoutX": 168,
"layoutY": 263
},
"type": "org.thingsboard.rule.engine.filter.TbCheckMessageNode",
"name": "chequeo telemetria movimiento",
"debugMode": false,
"configuration": {
"messageNames": [
"movimiento"
],
"metadataNames": [],
"checkAllKeys": true
}
},
{
"additionalInfo": {
"description": "",
"layoutX": 358,
"layoutY": 198
},
"type": "org.thingsboard.rule.engine.filter.TbJsFilterNode",
"name": "Under Threshold",
"debugMode": true,
"configuration": {
"jsScript": "return msg.movimiento == 1;"
}
},
{
"additionalInfo": {
"description": "",
"layoutX": 882,
"layoutY": 56
},
"type": "org.thingsboard.rule.engine.action.TbCreateAlarmNode",
"name": "Create alarm",
"debugMode": true,
"configuration": {
"alarmDetailsBuildJs": "var details = {};\r\ndetails.movimiento = msg.movimiento;\r\ndetails.server_ip = msg.server_ip;\r\nif (metadata.prevAlarmDetails) {\r\n var prevDetails = JSON.parse(metadata.prevAlarmDetails);\r\n details.count = prevDetails.count + 1;\r\n} else {\r\n details.count = 1;\r\n}\r\n\r\nreturn details;",
"useMessageAlarmData": false,
"alarmType": "Critical Temperatura",
"severity": "CRITICAL",
"propagate": true,
"relationTypes": [],
"dynamicSeverity": false
}
},
{
"additionalInfo": {
"description": "Movimiento",
"layoutX": 1150,
"layoutY": 58
},
"type": "org.thingsboard.rule.engine.mail.TbMsgToEmailNode",
"name": "Crear mail",
"debugMode": true,
"configuration": {
"fromTemplate": "homefriend@gmail.com",
"toTemplate": "luispsn1497@gmail.com",
"ccTemplate": null,
"bccTemplate": null,
"subjectTemplate": "HomeFriend Alerta Movimiento!",
"mailBodyType": "false",
"isHtmlTemplate": null,
"bodyTemplate": "La cámara del HomeFriend ha detectado movimiento.\nHaga click aquí para ver la cámara URL Local http://${server_ip}/mjpeg/1\n${server_ip}\nDevice ${deviceName} tiene una temperatura de $[movimiento]\n"
}
},
{
"additionalInfo": {
"description": "",
"layoutX": 1412,
"layoutY": 68
},
"type": "org.thingsboard.rule.engine.mail.TbSendEmailNode",
"name": "Mandar Mail",
"debugMode": false,
"configuration": {
"useSystemSmtpSettings": false,
"smtpProtocol": "smtps",
"smtpHost": "smtp.gmail.com",
"smtpPort": 465,
"timeout": 10000,
"enableTls": false,
"tlsVersion": "TLSv1.2",
"enableProxy": false,
"proxyHost": null,
"proxyPort": null,
"proxyUser": null,
"proxyPassword": null,
"username": "homefriend2021@gmail.com",
"password": "rdvqzfqbohwebdxn"
}
},
{
"additionalInfo": {
"description": "",
"layoutX": 912,
"layoutY": 402
},
"type": "org.thingsboard.rule.engine.action.TbClearAlarmNode",
"name": "Clear Alarm",
"debugMode": false,
"configuration": {
"alarmType": "General Alarm",
"alarmDetailsBuildJs": "var details = {};\nif (metadata.prevAlarmDetails) {\n details = JSON.parse(metadata.prevAlarmDetails);\n //remove prevAlarmDetails from metadata\n delete metadata.prevAlarmDetails;\n //now metadata is the same as it comes IN this rule node\n}\n\n\nreturn details;"
}
}
],
"connections": [
{
"fromIndex": 0,
"toIndex": 3,
"type": "Success"
},
{
"fromIndex": 1,
"toIndex": 2,
"type": "True"
},
{
"fromIndex": 2,
"toIndex": 6,
"type": "False"
},
{
"fromIndex": 2,
"toIndex": 0,
"type": "True"
},
{
"fromIndex": 3,
"toIndex": 4,
"type": "Updated"
},
{
"fromIndex": 4,
"toIndex": 5,
"type": "Success"
}
],
"ruleChainConnections": null
}
}