Input and output diagnostics NEW!
Returns, in a single call, the state of all GPIOs, relays and SecBoxes of the device, together with the relevant configuration of each one. To read a single GPIO, see Read GPIO Status.
Available only on version V7.
POST /io_state.fcgi
Parameters
- This call has no parameters.
Response
- gpios (array of JSON objects): One item per device GPIO. Each item contains:
- index (int): GPIO number.
- role (string): GPIO role:
"tamper"(tamper sensor),"gpio_ext"(configurable input),"relay","speaker"or"generic". - ext_id (int): Configurable input number (the
Ningpio_extN). Present only when role is"gpio_ext". - mode (int): Operating mode of the configurable input, with the same values as
gpio_extN_modein Custom signals iDFace Max. Present only when role is"gpio_ext". - activation_mode (int): Activation mode of the configurable input:
1(pulse) or2(edge). Present only when role is"gpio_ext". - debounce_ms (int): Debounce time of the configurable input, in milliseconds. Present only when role is
"gpio_ext". - enabled (bool): Whether the GPIO is enabled.
- available (bool): Whether the GPIO state could be read. It is
falsefor disabled GPIOs. The fields below are present only when available istrue. - in (bool): Whether the GPIO is configured as an input (
true) or an output (false). - value (int): Current GPIO value.
- idle (int): GPIO value when idle.
- active (bool): Whether the GPIO is active, that is, whether value differs from idle.
- notify (bool): Whether the access software is notified of changes on this GPIO.
- notified (int): How many times the GPIO notified the access software of a change.
- relays (array of JSON objects): One item per device relay. Each item contains:
- id (int): Relay number, starting at 1.
- gpio (int): GPIO that drives the relay.
- enabled (bool): Whether the relay is enabled.
- timeout_ms (int): Relay activation time, in milliseconds.
- auto_close (bool): Whether automatic closing is enabled.
- output_mode (int): Relay output mode, with the same values as
relay_out_modein Custom signals iDFace Max. - available (bool): Whether the relay state could be read.
- active (bool): Whether the relay is activated. Present only when available is
true.
- sec_boxes (array of JSON objects): One item per connected SecBox. Each item contains:
- id (int): SecBox identifier (UID).
- serial (string): SecBox serial number.
- version (string): SecBox firmware version.
- enabled (bool): Whether the SecBox is enabled.
- relay (bool): SecBox relay state.
- rex (bool): Level read on the SecBox exit button (REX) input.
- rex_active (bool): Whether the exit button is pressed.
- door_sensor (bool): Level read on the SecBox door sensor input.
- door_sensor_enabled (bool): Whether the door sensor is enabled.
- door_sensor_idle (int): Door sensor level when idle.
- door_sensor_active (bool): Whether the door sensor is active, that is, whether the level read differs from door_sensor_idle.
- open (bool): Whether the SecBox door is open.
Request example
$.ajax({
url: "/io_state.fcgi?session=" + session,
type: 'POST',
contentType: 'application/json'
});
Response example
{
"gpios": [
{
"index": 0,
"role": "tamper",
"enabled": true,
"available": true,
"in": true,
"value": 1,
"idle": 1,
"active": false,
"notify": true,
"notified": 0
},
{
"index": 1,
"role": "gpio_ext",
"ext_id": 1,
"mode": 7,
"activation_mode": 1,
"debounce_ms": 50,
"enabled": true,
"available": true,
"in": true,
"value": 0,
"idle": 0,
"active": false,
"notify": true,
"notified": 3
}
],
"relays": [
{
"id": 1,
"gpio": 4,
"enabled": true,
"timeout_ms": 3000,
"auto_close": true,
"output_mode": 0,
"available": true,
"active": false
}
],
"sec_boxes": [
{
"id": 65793,
"serial": "0001010101",
"version": "2.4.0",
"enabled": true,
"relay": false,
"rex": true,
"rex_active": false,
"door_sensor": false,
"door_sensor_enabled": true,
"door_sensor_idle": 0,
"door_sensor_active": false,
"open": false
}
]
}