TCW241_R4.17
–
October 2022
Page 37
8.2.2.
HTTP Get
HTTP Get can be used to monitor TCW241 via XML or JSON files. The format is as follows:
http://device.ip.address/status.xml
http://device.ip.address/status.json
See sections
8.2.4 XML file structure
and
8.2.5 JSON file structure
for details of files.
HTTP Get can be sent at any time to TCW241 if it is on the same network or it has appropriate
routing.
If there isn’t direct access to the device, HTTP Get can be sent immediately after HTTP Post
receiving from the same device.
8.2.2.1.
Commands
All command used with HTTP Post can be used also with HTTP Get. The right format is:
http://device.ip.address/status.xml?yyy=xxx
Where:
yyy is the command;
xxx is the parameter.
Example:
http://device.ip.address/status.xml?ron=1, will turn Relay 1 ON.
8.2.2.2.
HTTP GET authentication
If HTTP API authentication is enabled, basic access authentication is required to access the
status.xml file. The format of the command is shown in the table below:
XML/HTTP API authentication Format
enabled
http://device.ip.address/status.xml?a=uuuu:pppp
disabled
http://device.ip.address/status.xml
Example:
http://device.ip.address/status.xml?a=admin:admin&pper=120 will set post period on 120 sec
in case the username=admin and pass=admin
8.2.3.
List of HTTP API commands
Command
Description
ron=
n
Turn relay
n
ON
(
n
is 1,2,4 or 8)
ron=1 - will turn ON relay 1
ron=2 - will turn ON relay 2
ron=4 - will turn ON relay 3
ron=8 - will turn ON relay 4
ron=1&ron=2&ron=4&ron=8
Turn four relays ON
rof=
n
Turn relay
n
OFF
(
n
is 1,2,4 or 8 )
rof=1 - will turn OFF relay 1
rof=2 - will turn OFF relay 2
rof=4 - will turn OFF relay 3
rof=8 - will turn OFF relay 4
rof=1&rof=2&rof=4&rof=8
Turn four relays OFF
rtg=
n
Toggle relay
n
state
(
n
is 1,2,4 or 8)
rtg=1 - will toggle relay 1 state
rtg=2 - will toggle relay 2 state
rtg=4 - will toggle relay 3 state
Содержание TCW241
Страница 1: ...smtp...
Страница 16: ...TCW241_R4 17 October 2022 Page 16...
Страница 55: ...TCW241_R4 17 October 2022 Page 55 Appendix A Fig 1 Fig 2...