SENSBLUE ATLAS/Datasheet: Difference between revisions
Appearance
No edit summary |
|||
| Line 8,730: | Line 8,730: | ||
Published as soon as an incoming SMS matches a parameterized command — before the action executes and before the auto-reply is known. <code>answer</code> is always <code>null</code> here; the actual reply is only computed after execution (see below). | Published as soon as an incoming SMS matches a parameterized command — before the action executes and before the auto-reply is known. <code>answer</code> is always <code>null</code> here; the actual reply is only computed after execution (see below). | ||
If the SMS carries multiple commands (one per line, see [[#c) Multiple commands per SMS|Multiple commands per SMS]]), this event is published '''once per matched line''', and <code>smsPayload</code> is that line's text, not the full SMS body.<syntaxhighlight lang="json"> | If the SMS carries multiple commands (one per line, see [[#c) Multiple commands per SMS|''<u>Multiple commands per SMS</u>'']]), this event is published '''once per matched line''', and <code>smsPayload</code> is that line's text, not the full SMS body.<syntaxhighlight lang="json"> | ||
{ | { | ||
"id": "1782142697994", | "id": "1782142697994", | ||
| Line 8,750: | Line 8,750: | ||
Published once the command's action has finished. <code>task.action</code> is the internal command name (<code>set_digital_output</code>, <code>set_relay</code>, <code>set_ssh</code>, <code>set_mobile_data</code>, <code>set_vpn</code>). <code>taskResult.answer</code> is the SMS reply that was actually sent — <code>null</code>/absent if the action failed or is not implemented. | Published once the command's action has finished. <code>task.action</code> is the internal command name (<code>set_digital_output</code>, <code>set_relay</code>, <code>set_ssh</code>, <code>set_mobile_data</code>, <code>set_vpn</code>). <code>taskResult.answer</code> is the SMS reply that was actually sent — <code>null</code>/absent if the action failed or is not implemented. | ||
For a multi-line SMS, this event is published '''once per matched line''', each with its own <code>smsPayload</code> (that line's text) and <code>result</code>. However, <code>taskResult.answer</code> here is that line's own reply text (e.g. <code>"RL1St:Close"</code>); the SMS actually sent to the user is the '''combination''' of every successful line's answer (see Multiple commands per SMS). | For a multi-line SMS, this event is published '''once per matched line''', each with its own <code>smsPayload</code> (that line's text) and <code>result</code>. However, <code>taskResult.answer</code> here is that line's own reply text (e.g. <code>"RL1St:Close"</code>); the SMS actually sent to the user is the '''combination''' of every successful line's answer (see ''<u>Multiple commands per SMS</u>''). | ||
'''Example — <code>set_digital_output</code>:'''<syntaxhighlight lang="json"> | '''Example — <code>set_digital_output</code>:'''<syntaxhighlight lang="json"> | ||