[ENG] 9.8. [DKSF 54.2 IU] How to Control a Device Using SMS Commands
A device has a possibility to be controlled remotely using SMS commands.
Syntax of SMS Commands
A general format of a text of an SMS command is as follows:
where:
fff – is a command code, for example, Р1+ (see below).
community_w – is a password that corresponds to an SNMP community for write. It is indicated at the page «SETUP» of a device web interface. It is possible to use Latin letters, numbers, character «_» without quotes and spaces.
kkkkk – is a request identifier (a random number). It is repeated in a response to set a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response.
A text of a command is case-insensitive, it is possible to use uppercase and lowercase letters. Elements of a command are separated by spaces. It is not acceptable to use the next characters: ‘ (apostrophe), “ (quote), @. Including these characters can cause a firmware failure. An execution of a command is configured by a response notification (see below).
Command Codes
A command code is indicated as one word, without spaces.
Command Code | Description |
---|---|
Pn+ | Switch on a relay n, where n is a relay number |
Pn- | Switch off a relay n, where n is a relay number |
PnR | Reload a relay n, where n is a relay number A polarity (direction) of switching a relay when resetting must correspond to a specified one in the settings of the module «Watchdog» (reset mode). If a relay already has a reset status, a reset command will not have any effect, however, a response notification about a successful execution «NP DONE PnR» will be sent to a destination number. |
PnW | Switch a relay n into the management mode «Watchdog», where n - is a relay number |
PnS | Switch a relay n into the management mode «Schedule», where n - is a relay number |
PnX | Switch a relay n into the management mode «Schedule+Watchdog», where n - is a relay number (in the process of development) |
PnL | Switch a relay n into the management mode «Logic», where n - is a relay number |
Pn? | Request a status of a relay n, where n - is a relay number |
P? | Request a status of all relays in a brief form |
N? | Request a status of a pinger |
Tb? | Request readings of a temperature sensor b, where b - is a number of a temperature sensor |
Hx? | Request readings of a humidity sensor x, where x - is a number of a humidity sensor |
A? | Request a status of a battery |
Examples of SMS Commands
A command for switching on a relay 1 of a device:
A command for switching off a relay 2 of a device:
Response Notifications to SMS Commands
A confirmation for executing a command, such as switching a relay:
where:
fff – is a code of an outgoing command, executing which is confirmed by this notification. For example, Р1+
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response
An error while a device reads a command. Most probably, a text of an outgoing command is incorrect:
where:
Outgoing command – is a text of an outgoing command, which is quoted completely.
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response
An incorrect password (Community) in an outgoing command:
where:
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response (the second command)
Response Notifications to SMS Commands for Requesting a State/Status
A response to a request (NETPING Pn? community_w kkkkk) about a relay status:
where:
n – is a relay number
b – is a relay status, a possible status of a relay is coded by the next characters: «+» (switched on), «-» (switched off), «W+»/«W-» (watchdog), «S+»/«S-» (schedule), «X+»/«X+» (schedule+watchdog), «L+»/«L-» (logic).
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response
A response to a request (NETPING P? community_w kkkkk) about a status of all relays:
where:
b – is a status of a relay, possible status of a relay is coded by the next characters: «+» (switched on), «-» (switched off), «W+»/«W-» (watchdog), «S+»/«S-» (schedule), «X+»/«X+» (schedule+watchdog), «L+»/«L-» (logic).
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response
A response to a request (NETPING N? community_w kkkkk) about a status of a pinger, embedded into an SMS module:
where:
N=1 – an indicated address responds
N=0 – an indicated address is silent
kkkkk – a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response
A response to a request (NETPING Tb? community_w kkkkk) about readings of a temperature sensor. A sensor with a number b failed or is not connected:
where:
b – is a number of a temperature sensor
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response
A response to a request (NETPING Tb? community_w kkkkk) about readings of a temperature sensor. A sensor with a number b is in a status «below», «normal», «above normal» respectively:
where:
b – is a number of a temperature sensor
t – is a current temperature value, in °C
t1, t2 – are thresholds of a «normal range» of a temperature, in °C
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response
A response to a request (NETPING Hx? community_w kkkkk) about readings of a humidity sensor. A sensor with a number x failed or is not connected:
where:
x – is a number of a humidity sensor
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response
A response to a request (NETPING Hx? community_w kkkkk) about readings of a humidity sensor. A sensor with a number x is in a status «below normal», «normal», «above normal» respectively:
where:
h – is a current value of a relative humidity, in %
h1, h2 – are thresholds of a «normal range» of a relative humidity, in %
t – is a current temperature value, in °C
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response
A response to a request (NETPING A? community_w kkkkk) about a battery status:
where:
V – is a power supply source, and can have the values: «220V» (220V grid power), «BATTERY» (battery power)
С – is a battery status, and can have the values: «OK» (battery is full), «LOW» (battery is low)
kkkkk – is a request identifier (a random number). It is repeated in a response for setting a correspondence between a request and a response. It is an optional element of a command. If there is no identifier in a command, there is no identifier in a response