Relays

GET /ATX/hardware/relays/(string: index)

Returns the state of the linq2 relays at the respective index

Example request:

GET /ATX/hardware/relays/relay0 HTTP/1.0
Host: 192.168.168.168
Accept: application/json, text/javascript

Example response:

HTTP/1.0 200 OK
Content-Type: application/json

{
   "relay1": {
       "id": "Relay ID",
       "status": 0,
       "pulse": -15
   }
}
Response JSON Object:
 
  • id (string) – The name of the relay resource. If an relay event is triggered and the alert per this relay is not masked, an alert will be recorded and the alerts ‘what’ property will contain this ID field
  • status (number) – The current state of the relay. (1 - active, 0 - in-active).
  • pulse (number) – number of seconds to pulse the power supply, should a pulse command be executed. (<0 pulse off, >0 pulse on)
POST /ATX/hardware/relay/(string: index)/status

Change the state of the Relay

Example request:

POST /ATX/hardware/relay/relay0/status HTTP/1.0
Host: 192.168.168.168
Accept: application/json, text/javascript
Content-Type: application/json

{
   "status":0
}
Request JSON Object:
 
  • status (string) – If the supplied property is a number, the relay will either turn on (status=1), or turn off (status=0)
  • status – If the supplied property is a string, the relay will either Pulse (status=’p’) or toggle (status=’t’), Where a “pulse” command will either pulse on for x seconds, or pulse off for x seconds, and where seconds is determined by the “pulse” property of the same relay object.

Example response:

HTTP/1.0 200 OK
Content-Type: application/json

{
   "error":200
}