Jump to content

SENSBLUE ATLAS/Datasheet: Difference between revisions

No edit summary
Line 8,439: Line 8,439:
* Any SMS that does not match a known fixed or parameterized command is still reported over MQTT (<code>SMS_RECEIVED</code>) but no action is taken.
* Any SMS that does not match a known fixed or parameterized command is still reported over MQTT (<code>SMS_RECEIVED</code>) but no action is taken.
* An SMS whose recognised lines are not all the '''same action''' (e.g. a relay command mixed with <code>reboot</code>, or with a digital output command) is treated the same way: reported via <code>SMS_RECEIVED</code>, but no command runs and no auto-reply is sent (see [[#c) Multiple commands per SMS|''<u>Multiple commands per SMS</u>'']]).
* An SMS whose recognised lines are not all the '''same action''' (e.g. a relay command mixed with <code>reboot</code>, or with a digital output command) is treated the same way: reported via <code>SMS_RECEIVED</code>, but no command runs and no auto-reply is sent (see [[#c) Multiple commands per SMS|''<u>Multiple commands per SMS</u>'']]).
* Unlike the fixed commands, a parameterized command's auto-reply is only sent when the action '''succeeds'''. If it fails, no SMS reply is sent, but the failure is still published over MQTT (see [[e) Command result (parameterized commands)|Command result (parameterized commands)]]).
* Unlike the fixed commands, a parameterized command's auto-reply is only sent when the action '''succeeds'''. If it fails, no SMS reply is sent, but the failure is still published over MQTT (see [[e) Command result (parameterized commands)|''<u>Command result (parameterized commands)</u>'']]).


'''Security note:''' there is currently no sender allow-list or authentication on inbound SMS commands. Any SMS with the exact matching text/pattern will trigger the corresponding action, regardless of sender. Restrict knowledge of the SIM number and treat it as a sensitive credential.
'''Security note:''' there is currently no sender allow-list or authentication on inbound SMS commands. Any SMS with the exact matching text/pattern will trigger the corresponding action, regardless of sender. Restrict knowledge of the SIM number and treat it as a sensitive credential.
Line 8,454: Line 8,454:
* Each non-blank line is matched independently against the known command patterns (fixed and parameterized alike). Lines that don't match anything are silently skipped and don't count toward the action check — only the recognised lines' actions are compared.
* Each non-blank line is matched independently against the known command patterns (fixed and parameterized alike). Lines that don't match anything are silently skipped and don't count toward the action check — only the recognised lines' actions are compared.
* If every recognised line shares the same action, commands run '''sequentially, in the order their lines appear''' in the SMS. If the same output/relay appears more than once (e.g. <code>RL1:Close</code> then <code>RL1:Open</code>), the last one wins.
* If every recognised line shares the same action, commands run '''sequentially, in the order their lines appear''' in the SMS. If the same output/relay appears more than once (e.g. <code>RL1:Close</code> then <code>RL1:Open</code>), the last one wins.
* Each line is tracked as its own <code>SMS_COMMAND_STARTED</code> / command-result MQTT event (see MQTT Interface), with <code>smsPayload</code> set to that line's text rather than the full SMS body.
* Each line is tracked as its own <code>SMS_COMMAND_STARTED</code> / command-result MQTT event (see [[25.15.4 MQTT Interface|''<u>MQTT Interface</u>'']]), with <code>smsPayload</code> set to that line's text rather than the full SMS body.
* The auto-replies for all lines that succeeded are combined into a '''single''' SMS reply, one line per successful command, in the same order the commands were received (e.g. <code>RL1St:Close\nRL2St:Close</code>). Lines whose action failed contribute no reply line, mirroring the single-command behaviour.
* The auto-replies for all lines that succeeded are combined into a '''single''' SMS reply, one line per successful command, in the same order the commands were received (e.g. <code>RL1St:Close\nRL2St:Close</code>). Lines whose action failed contribute no reply line, mirroring the single-command behaviour.