guerrerotook / securitas-direct-new-api

This repository contains the new securitas direct API that can be integrated in Home Assistant
Apache License 2.0
73 stars 30 forks source link

añadir cerradura electrónica #234

Open hlas opened 1 month ago

hlas commented 1 month ago

Hola

¿Sería posible añadir la apertura y cierre de la nueva cerradura eléctronica de SD? He capturado las llamadas a la API:

{ "operationName": "xSGetSmartlockConfig", "variables": { "numinst": "XXXXXXX", "panel": "SDVECUW", "devices": [ { "deviceType": "DR", "deviceId": "01", "keytype": "0" } ] }, "query": "query xSGetSmartlockConfig($numinst: String!, $panel: String!, $devices: [SmartlockDevicesInfo]!) {\n xSGetSmartlockConfig(numinst: $numinst, panel: $panel, devices: $devices) {\n res\n referenceId\n zoneId\n serialNumber\n location\n family\n type\n label\n features {\n holdBackLatchTime\n calibrationType\n autolock {\n active\n timeout\n }\n }\n }\n}" }

Respuesta: { "data": { "xSGetSmartlockConfig": [ { "res": "OK", "referenceId": null, "zoneId": "DR01", "serialNumber": "XXXXXXX", "location": "Pl_1_Recibidor", "family": "User", "type": "163", "label": "Cerradura", "features": { "holdBackLatchTime": 3, "calibrationType": 0, "autolock": { "active": true, "timeout": "1800" } } } ] } }

Apertura:

{ "operationName": "xSChangeSmartlockMode", "variables": { "numinst": "XXXXXXX", "panel": "SDVECUW", "deviceId": "01", "deviceType": "DR", "lock": false }, "query": "mutation xSChangeSmartlockMode($numinst: String!, $panel: String!, $deviceId: String!, $deviceType: String!, $lock: Boolean!) {\n xSChangeSmartlockMode(\n numinst: $numinst\n panel: $panel\n deviceId: $deviceId\n deviceType: $deviceType\n lock: $lock\n ) {\n res\n msg\n referenceId\n }\n}" }

Respuesta:

{ "data": { "xSChangeSmartlockMode": { "res": "OK", "msg": "Your request has been sent", "referenceId": "OWP______________XXXXXX__XXXXXXXX________________" } } }

{ "operationName": "xSChangeSmartlockModeStatus", "variables": { "numinst": "xxxxxxx", "panel": "SDVECUW", "deviceId": "01", "referenceId": "OWP_______________xxxxx_xxxxxxx_______________", "counter": 1 }, "query": "query xSChangeSmartlockModeStatus($numinst: String!, $panel: String!, $referenceId: String!, $deviceId: String, $counter: Int) {\n xSChangeSmartlockModeStatus(\n numinst: $numinst\n panel: $panel\n referenceId: $referenceId\n counter: $counter\n deviceId: $deviceId\n ) {\n res\n msg\n protomResponse\n status\n }\n}" }

{ "data": { "xSChangeSmartlockModeStatus": { "res": "WAIT", "msg": "Request in progress, please wait", "protomResponse": null, "status": null } } }

Y al final:

{ "data": { "xSChangeSmartlockModeStatus": { "res": "OK", "msg": "Request processed correctly", "protomResponse": null, "status": "procesed" } } }

Y para el cierre:

{ "operationName": "xSChangeSmartlockMode", "variables": { "numinst": "xxxxxxx", "panel": "SDVECUW", "deviceId": "01", "deviceType": "DR", "lock": true }, "query": "mutation xSChangeSmartlockMode($numinst: String!, $panel: String!, $deviceId: String!, $deviceType: String!, $lock: Boolean!) {\n xSChangeSmartlockMode(\n numinst: $numinst\n panel: $panel\n deviceId: $deviceId\n deviceType: $deviceType\n lock: $lock\n ) {\n res\n msg\n referenceId\n }\n}" }

bigramonk commented 1 month ago

Hola, Reconocí mi cerradura en la publicidad de Securitas. Parece ser una Danalock V3-BTZE (Zigbee y Bluetooth), aunque haya varios modelos y que en España se pueda distribuir otro. Si fuera el caso, creo que podría ser más sencillo ver qué protocolo usa Veritas e intentar integrar el otro directamente con Home Assistant (con zigbee2mqtt o con un bluetooth proxy). Así no tendrías ningún tipo de latencia al abrir o cerrar la cerradura.