.. _SystemIntegration_HandlingBarrier: ####### Barrier ####### .. _SystemIntegration_Barrier_GetBarrierState: Get the BarrierState ******************** This returns the :ref:`BarrierState `. **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: id of the barrier. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/barrier **Example request**: .. sourcecode:: http GET /hal/devices/smartonemodule1/barrier 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 4 :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 int barrierStatus: see :ref:`Barrier status ` Pulse actions ************* .. _SystemIntegration_Barrier_PulseOpen: PulseOpen ========= This will open and close the barrier. It will close after it is safe to close (if configured to close automatically). **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: id of the barrier. .. http:post:: https://{hostIp}:7081/hal/devices/{deviceId}/barrier/pulseopen **Example request**: .. sourcecode:: http POST /hal/devices/smartonemodule1/barrier/pulseopen HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... Content-Type: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :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 .. _SystemIntegration_Barrier_PulseClose: PulseClose ========== This call will close the barrier, after it is opened by :ref:`PulseOpen `. This call is analogue to :ref:`PulseOpen `. .. http:post:: https://{hostID}:7081/hal/devices/{deviceId}/barrier/pulseclose Force to continuous position **************************** .. _SystemIntegration_Barrier_ContinueOpen: Continue Open ============= A barrier can be locked in the "open" position: - When continue open is set, the :ref:`PulseOpen ` and :ref:`PulseClose ` methods, will not have any affect and the barrier will stay open. - To release the barrier from the open position, reset the continu open status. .. _SystemIntegration_Barrier_GetContinueOpen: Get Continue Open ----------------- **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: id of the barrier. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/barrier/continueopen **Example request**: .. sourcecode:: http GET /hal/devices/smartonemodule1/barrier/continueopen 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 false :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 boolean value: **true** is set, **false** is reset. .. _SystemIntegration_Barrier_SetContinueOpen: Set Continue Open ----------------- When the **Continu Open** is set: - The barrier will open and remain open. - The :ref:`PulseOpen ` and :ref:`PulseClose ` will have no effect. **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: id of the barrier. .. http:put:: https://{hostIp}:7081/hal/devices/{deviceId}/barrier/continueopen **Example request**: .. sourcecode:: http PUT /hal/devices/smartonemodule1/barrier/continueopen HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... Content-Type: application/json true :jsonparam bool value: **true** or **false** can be used. Not **{true}** and not **{false}**. Don't use curly brackets in the body of the call. **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :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 .. _SystemIntegration_Barrier_ContinueClosed: Continue Closed =============== When **Continue Closed** is set: - The barrier will close. - The :ref:`PulseOpen ` and :ref:`PulseClose ` will have no effect. When **Continue Closed** is reset, the :ref:`PulseOpen ` and :ref:`PulseClose ` commands will function as expected. .. _SystemIntegration_Barrier_GetContinueClosed: Get Continue Closed ------------------- This call is analog with :ref:`Get Continue Open `. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/barrier/continueclosed .. _SystemIntegration_Barrier_SetContinueClosed: Set Continue Closed ------------------- This call is analogue with :ref:`Set Continue Open `. .. http:put:: https://{hostID}:7081/hal/devices/{deviceId}/barrier/continueclosed Enumeration values ****************** .. _SystemIntegration_Barrier_BarrierStates: Enumeration Barrier States ========================== This indicates the position or motion of a barrier. - Unknown = 0 - Open = 1 - Opening = 2 - Closing = 3 - Closed = 4 - Error = 5 Events ****** Barrier Events ============== The websocker server will send :ref:`BarrierState ` updates to a registered websocket client. The websocket - method name will be "**receiveBarrierState**". **Example of an event after a BarrierState change**: :: "messageType":1, "data": { "methodName":"receiveBarrierState", "arguments":[ { "barrierState": 2, "deviceId": "smartonemodule1", "version": "1.0" } ] }