.. _SystemIntegration_HandlingInputs: ###### Inputs ###### Get all device inputs ********************* Returns all available inputs and their (logical) state. See :ref:`SupportedDevices ` to learn more about what inputs are available. **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: id of the device. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/inputs **Example request**: .. sourcecode:: http GET /hal/devices/smartonemodule1/inputs HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 [ { "value": 0, "name": "in_continuous_close" }, { "value": 0, "name": "in_continuous_open" }, { "value": 0, "name": "in_pulse_open" }, { "value": 0, "name": "in_pulse_close" }, { "value": 0, "name": "in_security_1" }, { "value": 0, "name": "in_security_2" } ] :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json array inputs: array with inputs and their logical values (0 or 1) Get one or more inputs ********************** Returns all desired inputs and their (logical) state. **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: id of the device. * **inputName1 / inputName2**: See :ref:`SupportedDevices ` to learn more about what inputs are available. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/inputs?inputName={inputName1}&inputName={inputName2} **Example request**: .. sourcecode:: http GET /hal/devices/smartonemodule1/inputs?inputName=in_continuous_close&inputName=in_continuous_open HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 [ { "value": 0, "name": "in_continuous_close" }, { "value": 0, "name": "in_continuous_open" } ] :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json array inputs: array with inputs and their logical values (0 or 1) Events ****** Input Events ============== The websocket server will send input state change updates to a registered websocket client. The websocket - method name will be "**receiveInputs**". See :ref:`SupportedDevices ` to learn more about what inputs are available. **Example of an event after an input state change**: :: "messageType": 1, "data": { "methodName": "receiveInputs", "arguments": [ { "inputs": [ { "deviceId": "smartonemodule1", //do not use this property, will be removed soon! "name": "in_security_1", "value": 0 }], "deviceId": "smartonemodule1", "version": "1.0" } ]}