PlusPlus-ua / ha_tuya_ble

Home Assistant support for Tuya BLE devices
MIT License
155 stars 98 forks source link

[Request] Support for Smart Lock S1-TY-BLE-PRO (category jtmspro) product id: xqeob8h6 #93

Open doli11 opened 5 months ago

doli11 commented 5 months ago

Hey, thanks for your efforts. I've tried to modify some files to make the smart lock working in HA based on the pull request #55 with little success (sensor entities working but no unlock function). Maybe you can add support for the lock or guide me in the right direction :)

With DP71 the lock seems to do something (I hear the motor spinning) but it won't unlock.

I've extracted some data from the cloud:

Device details:

 {
  "result": {
    "active_time": 1703203765,
    "category": "jtmspro",
    "create_time": 1703003068,
    "custom_name": "",
    "icon": "smart/icon/ay15637661355438qua2/f63a35cd47c91c90c5369b8bd0afacbc.png",
    "id": "xxx",
    "ip": "",
    "is_online": true,
    "lat": "xxx",
    "local_key": "xxx",
    "lon": "xxx",
    "model": "S1",
    "name": "S1-TY-BLE-PRO",
    "product_id": "xqeob8h6",
    "product_name": "S1-TY-BLE-PRO",
    "sub": true,
    "time_zone": "+01:00",
    "update_time": 1703203765,
    "uuid": "uuid1c469a584f0c"
  },
  "success": true,
  "t": 1703208685099,
  "tid": "d2057789a06911ee84c63652eadeec7d"
 }
{
  "result": {
    "properties": [
      {
        "code": "unlock_method_create",
        "custom_name": "",
        "dp_id": 1,
        "time": 1703211599000,
        "value": "A/8BAQEAAA=="
      },
      {
        "code": "unlock_method_delete",
        "custom_name": "",
        "dp_id": 2,
        "time": 1703209090780
      },
      {
        "code": "unlock_method_modify",
        "custom_name": "",
        "dp_id": 3,
        "time": 1703209090780
      },
      {
        "code": "residual_electricity",
        "custom_name": "",
        "dp_id": 8,
        "time": 1703211569000,
        "value": 100
      },
      {
        "code": "unlock_fingerprint",
        "custom_name": "",
        "dp_id": 12,
        "time": 1703203765342,
        "value": 0
      },
      {
        "code": "unlock_card",
        "custom_name": "",
        "dp_id": 15,
        "time": 1703203765342,
        "value": 0
      },
      {
        "code": "unlock_key",
        "custom_name": "",
        "dp_id": 16,
        "time": 1703203765342,
        "value": 0
      },
      {
        "code": "unlock_ble",
        "custom_name": "",
        "dp_id": 19,
        "time": 1703203765342,
        "value": 0
      },
      {
        "code": "lock_record",
        "custom_name": "",
        "dp_id": 20,
        "time": 1703209090780
      },
      {
        "code": "alarm_lock",
        "custom_name": "",
        "dp_id": 21,
        "time": 1703210871000,
        "value": "wrong_finger"
      },
      {
        "code": "hijack",
        "custom_name": "",
        "dp_id": 22,
        "time": 1703203765342,
        "value": false
      },
      {
        "code": "doorbell",
        "custom_name": "",
        "dp_id": 24,
        "time": 1703203765342,
        "value": false
      },
      {
        "code": "message",
        "custom_name": "",
        "dp_id": 25,
        "time": 1703203765342,
        "value": false
      },
      {
        "code": "automatic_lock",
        "custom_name": "",
        "dp_id": 33,
        "time": 1703211569000,
        "value": true
      },
      {
        "code": "unlock_switch",
        "custom_name": "",
        "dp_id": 34,
        "time": 1703211569000,
        "value": "single_unlock"
      },
      {
        "code": "auto_lock_time",
        "custom_name": "",
        "dp_id": 36,
        "time": 1703211569000,
        "value": 5
      },
      {
        "code": "closed_opened",
        "custom_name": "",
        "dp_id": 40,
        "time": 1703203765342,
        "value": "unknown"
      },
      {
        "code": "rtc_lock",
        "custom_name": "",
        "dp_id": 44,
        "time": 1703203765342,
        "value": false
      },
      {
        "code": "manual_lock",
        "custom_name": "",
        "dp_id": 46,
        "time": 1703206555987,
        "value": false
      },
      {
        "code": "lock_motor_state",
        "custom_name": "",
        "dp_id": 47,
        "time": 1703211569000,
        "value": false
      },
      {
        "code": "synch_method",
        "custom_name": "",
        "dp_id": 54,
        "time": 1703211578000,
        "value": "AQA="
      },
      {
        "code": "remote_no_dp_key",
        "custom_name": "",
        "dp_id": 61,
        "time": 1703206563135,
        "value": "AAAB"
      },
      {
        "code": "unlock_phone_remote",
        "custom_name": "",
        "dp_id": 62,
        "time": 1703206563000,
        "value": 1
      },
      {
        "code": "unlock_voice_remote",
        "custom_name": "",
        "dp_id": 63,
        "time": 1703203765342,
        "value": 0
      },
      {
        "code": "record",
        "custom_name": "",
        "dp_id": 69,
        "time": 1703211569000,
        "value": "AAEB"
      },
      {
        "code": "check_code_set",
        "custom_name": "",
        "dp_id": 70,
        "time": 1703209124000,
        "value": "AAH//wAAAAAAAAAAAP//AA=="
      },
      {
        "code": "ble_unlock_check",
        "custom_name": "",
        "dp_id": 71,
        "time": 1703209090780
      },
      {
        "code": "unlock_record_check",
        "custom_name": "",
        "dp_id": 72,
        "time": 1703209090780
      },
      {
        "code": "remote_pd_setkey_check",
        "custom_name": "",
        "dp_id": 73,
        "time": 1703203769434,
        "value": "AAH//zUyOTcwNDc1AQABAA=="
      },
      {
        "code": "unlock_double_kit",
        "custom_name": "",
        "dp_id": 74,
        "time": 1703209090780
      },
      {
        "code": "unlock_ble_ibeacon",
        "custom_name": "",
        "dp_id": 86,
        "time": 1703203765342,
        "value": 0
      },
      {
        "code": "ibeacon_scan_mode",
        "custom_name": "",
        "dp_id": 87,
        "time": 1703203765342,
        "value": "always"
      },
      {
        "code": "rssi_sensitivity_level",
        "custom_name": "",
        "dp_id": 88,
        "time": 1703203765342,
        "value": "inactive"
      },
      {
        "code": "ibeacon_switch",
        "custom_name": "",
        "dp_id": 90,
        "time": 1703211569000,
        "value": false
      }
    ]
  },
  "success": true,
  "t": 1703347060632,
  "tid": "00420beea1ac11ee9384da1e0a435480"
}

Here I've unlocked the device two times with fingerprint:

2023-12-23 17:36:58.784 WARNING (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Device unexpectedly disconnected; RSSI: -92
2023-12-23 17:36:58.784 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Scheduling reconnect; RSSI: -92
2023-12-23 17:36:58.785 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Reconnect, ensuring connection
2023-12-23 17:36:58.797 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Connecting; RSSI: -92
2023-12-23 17:37:09.747 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Connected; RSSI: -92
2023-12-23 17:37:09.777 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending device info request
2023-12-23 17:37:09.777 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #1 FUN_SENDER_DEVICE_INFO
2023-12-23 17:37:10.136 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 0081013004fa13466812fcc7bec312cc2156c31f
2023-12-23 17:37:10.158 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01c8ddb593836b6fe3f288e9cc735766e7b2fea4
2023-12-23 17:37:10.161 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 027593e3fe9ede5e19050b4cf239cda1d7dd94b4
2023-12-23 17:37:10.254 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 03ce73f28c1cfbeeccfb17ace69ed8e58ad6a9be
2023-12-23 17:37:10.255 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 041bbb5a22e64ff0caf80fa743593e6a657944ab
2023-12-23 17:37:10.256 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 0560e6b62840c22738ca930c50452cac2c494b7a
2023-12-23 17:37:10.291 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 06c69f53072f611b7c7b811415c7e492bf4779
2023-12-23 17:37:10.292 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #1 FUN_SENDER_DEVICE_INFO, response to #1
2023-12-23 17:37:10.292 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received expected response to #1, result: 0
2023-12-23 17:37:10.293 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending pairing request
2023-12-23 17:37:10.293 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #2 FUN_SENDER_PAIR
2023-12-23 17:37:10.560 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 00213005eba63b21a6f45d7c097d52aef567a1f0
2023-12-23 17:37:10.593 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01fc530de0bd5f2fa41a6442ae541d7a6d
2023-12-23 17:37:10.594 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #2 FUN_SENDER_PAIR, response to #2
2023-12-23 17:37:10.594 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Device is already paired
2023-12-23 17:37:10.594 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received expected response to #2, result: 0
2023-12-23 17:37:10.595 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Successfully connected
2023-12-23 17:37:10.595 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Reconnect, connection ensured
2023-12-23 17:37:10.596 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 0021300590fbd4185b55e372783faf7309141ea9
2023-12-23 17:37:10.664 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01d66e883df673741af3721114c9436b9f
2023-12-23 17:37:10.665 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #3 FUN_RECEIVE_TIME1_REQ
2023-12-23 17:37:10.665 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #3 FUN_RECEIVE_TIME1_REQ in response to #3
2023-12-23 17:37:10.666 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 003130052ce304097246fb98dfd9431b32cfd911
2023-12-23 17:37:10.666 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 013379527ca84ef6fc33df721f3cdd6c58afdfc7
2023-12-23 17:37:10.669 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 02f864517eb6ca48abedc8d71aa7
2023-12-23 17:37:10.670 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #4 FUN_RECEIVE_DP
2023-12-23 17:37:10.670 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received datapoint update, id: 69, type: DT_RAW: value: b'\x00\x01\x01'
2023-12-23 17:37:10.670 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-12-23 17:37:10.671 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #4 FUN_RECEIVE_DP in response to #4
2023-12-23 17:37:21.210 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 003130059481add86dbd81ba59691c5e318b4144
2023-12-23 17:37:21.213 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01d6b2a27747a4d020f4f10180e5bb27c4749150
2023-12-23 17:37:21.248 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 02238af2a59d8ce5ef31c0b8039b
2023-12-23 17:37:21.249 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #5 FUN_RECEIVE_DP
2023-12-23 17:37:21.249 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received datapoint update, id: 47, type: DT_BOOL: value: True
2023-12-23 17:37:21.249 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-12-23 17:37:21.251 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #5 FUN_RECEIVE_DP in response to #5
2023-12-23 17:37:23.152 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 00313005b876218a798513984ca2db81bafb0504
2023-12-23 17:37:23.153 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 018c19585f7f8a6ef2b25457421e505ee77fe75a
2023-12-23 17:37:23.154 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 020220797027cb06bbd843ff616c
2023-12-23 17:37:23.154 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #6 FUN_RECEIVE_TIME_DP
2023-12-23 17:37:23.154 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received timestamp: Sat Dec 23 17:37:23 2023
2023-12-23 17:37:23.154 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received datapoint update, id: 12, type: DT_VALUE: value: 1
2023-12-23 17:37:23.154 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-12-23 17:37:23.156 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #6 FUN_RECEIVE_TIME_DP in response to #6
2023-12-23 17:37:27.049 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 003130053b557199a3af7749b1f94285a5c69d7d
2023-12-23 17:37:27.050 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01083eb5152ee6b9d27f303df43a7934af36cb3b
2023-12-23 17:37:27.051 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 0279a01e66d8b359f3c8e98a4f40
2023-12-23 17:37:27.051 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #7 FUN_RECEIVE_DP
2023-12-23 17:37:27.051 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received datapoint update, id: 47, type: DT_BOOL: value: False
2023-12-23 17:37:27.051 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-12-23 17:37:27.054 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #7 FUN_RECEIVE_DP in response to #7
2023-12-23 17:37:28.171 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 00313005cbd7303d91737e0f23df5e7a8663e04f
2023-12-23 17:37:28.172 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01c6c85788ad2896d6a354f069ec01fd3151c5a9
2023-12-23 17:37:28.275 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 02bba5eca279c50d53cf98a4578d
2023-12-23 17:37:28.276 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #8 FUN_RECEIVE_TIME_DP
2023-12-23 17:37:28.276 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received timestamp: Sat Dec 23 17:37:23 2023
2023-12-23 17:37:28.276 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received datapoint update, id: 12, type: DT_VALUE: value: 1
2023-12-23 17:37:28.276 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-12-23 17:37:28.277 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #8 FUN_RECEIVE_TIME_DP in response to #8
2023-12-23 17:37:29.190 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 00313005b830ebf5bb2c8fa67cc1fa2288b103b3
2023-12-23 17:37:29.194 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01305062ca011c2ba6e4ea6d6e43f5403b86d2f1
2023-12-23 17:37:29.236 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 025681bd2372472cda18a0a26eb0
2023-12-23 17:37:29.236 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #9 FUN_RECEIVE_DP
2023-12-23 17:37:29.236 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received datapoint update, id: 47, type: DT_BOOL: value: True
2023-12-23 17:37:29.236 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-12-23 17:37:29.238 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #9 FUN_RECEIVE_DP in response to #9
2023-12-23 17:37:33.499 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 00313005866a4256eeee0fce021e05c8d1396767
2023-12-23 17:37:33.500 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01486509bb5615dcf2bd753bf6b547b6b77b310c
2023-12-23 17:37:33.536 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 02c1e82af0a2183b6a84ec165cb1
2023-12-23 17:37:33.536 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #10 FUN_RECEIVE_TIME_DP
2023-12-23 17:37:33.537 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received timestamp: Sat Dec 23 17:37:23 2023
2023-12-23 17:37:33.537 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received datapoint update, id: 12, type: DT_VALUE: value: 1
2023-12-23 17:37:33.537 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-12-23 17:37:33.538 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #10 FUN_RECEIVE_TIME_DP in response to #10
2023-12-23 17:37:34.960 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 003130054caa9800e5e84d8777f3d40509904da6
2023-12-23 17:37:34.961 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01b16bcc8a6a5b4f1251d7f47c05481411ac454b
2023-12-23 17:37:34.961 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 02eea3e8651e5ba509460d9f61c1
2023-12-23 17:37:34.962 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #11 FUN_RECEIVE_DP
2023-12-23 17:37:34.962 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received datapoint update, id: 47, type: DT_BOOL: value: False
2023-12-23 17:37:34.962 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-12-23 17:37:34.963 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #11 FUN_RECEIVE_DP in response to #11
2023-12-23 17:37:37.706 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 003130050acf74321d86a13aea4576e5ec418169
2023-12-23 17:37:37.989 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 01382ce638d179dc11c102838e41a77d83201556
2023-12-23 17:37:37.998 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Packet received: 02d2eab1f904cdf0a428b9a2afb5
2023-12-23 17:37:37.999 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received: #12 FUN_RECEIVE_DP
2023-12-23 17:37:37.999 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Received datapoint update, id: 8, type: DT_VALUE: value: 94
2023-12-23 17:37:37.999 DEBUG (MainThread) [custom_components.tuya_ble.devices] Manually updated tuya_ble data
2023-12-23 17:37:38.005 DEBUG (MainThread) [custom_components.tuya_ble.tuya_ble.tuya_ble] DC:23:4F:80:B0:41: Sending packet: #12 FUN_RECEIVE_DP in response to #12

I don't know if it's helpful but here is also the instruction set:

unlock_method_create    Raw {}
unlock_method_delete    Raw {}
unlock_method_modify    Raw {}
lock_record Raw {}
message Boolean "{true,false}"
automatic_lock  Boolean "{true,false}"
unlock_switch   Enum    {
  "range": [
    "single_unlock",
    "finger_card"
  ]
}
auto_lock_time  Integer {
  "min": 1,
  "max": 1800,
  "scale": 0,
  "step": 1
}
rtc_lock    Boolean "{true,false}"
manual_lock Boolean "{true,false}"
synch_method    Raw {}
remote_no_dp_key    Raw {}
record  Raw {}
check_code_set  Raw {}
ble_unlock_check    Raw {}
remote_pd_setkey_check  Raw {}
unlock_ble_ibeacon  Integer {
  "min": 0,
  "max": 999,
  "scale": 0,
  "step": 1
}
ibeacon_scan_mode   Enum    {
  "range": [
    "always",
    "5min",
    "10min",
    "20min",
    "40min",
    "60min",
    "90min",
    "120min"
  ]
}
rssi_sensitivity_level  Enum    {
  "range": [
    "inactive",
    "90db",
    "80db",
    "70db",
    "60db",
    "50db",
    "40db",
    "30db",
    "20db"
  ]
}
ibeacon_switch  Boolean "{true,false}"
NdS-Research-Facilities commented 5 months ago

Cool, I have a jtmspro with another deviceID, it says bfb4bcebctlqoztj but that can't be correct as it is 16 characters long, and all I see is 8 Will try to see if I can modify and use your code

doli11 commented 5 months ago

Cool, I have a jtmspro with another deviceID, it says bfb4bcebctlqoztj but that can't be correct as it is 16 characters long, and all I see is 8 Will try to see if I can modify and use your code

device ID != product ID ;-) you've looked up the wrong ID

sevagjb commented 5 months ago

i have also the lock i love to see the support on the integration soon

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.1.0",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.11.6",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Amsterdam",
    "os_name": "Linux",
    "os_version": "6.1.63-haos-raspi",
    "supervisor": "2023.12.0",
    "host_os": "Home Assistant OS 11.3",
    "docker_version": "24.0.7",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "browser_mod": {
      "version": "2.3.0",
      "requirements": []
    },
    "hass_agent_mediaplayer": {
      "version": "2022.5.6",
      "requirements": []
    },
    "mass": {
      "version": "2023.12.0",
      "requirements": [
        "music-assistant==2.0.0b79"
      ]
    },
    "watchman": {
      "version": "0.5.1",
      "requirements": [
        "prettytable==3.0.0"
      ]
    },
    "battery_notes": {
      "version": "1.3.5",
      "requirements": []
    },
    "hass_agent_notifier": {
      "version": "2022.10.25.1",
      "requirements": []
    },
    "zoom": {
      "version": "v0.8.5",
      "requirements": []
    },
    "google_home": {
      "version": "1.11.0",
      "requirements": [
        "glocaltokens==0.7.0"
      ]
    },
    "dash_cast": {
      "version": "1.0.0",
      "requirements": []
    },
    "tuya_ble": {
      "version": "0.1.8",
      "requirements": [
        "tuya-iot-py-sdk==0.6.6",
        "pycountry==22.3.5"
      ]
    },
    "sonoff": {
      "version": "3.5.4",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "trakt_tv": {
      "version": "0.8.6",
      "requirements": []
    },
    "uptime_kuma": {
      "version": "2.1.0",
      "requirements": [
        "pyuptimekuma-hass"
      ]
    },
    "dwains_dashboard": {
      "version": "3.6.0",
      "requirements": []
    },
    "thermal_comfort": {
      "version": "2.2.1",
      "requirements": []
    },
    "webrtc": {
      "version": "v3.5.0",
      "requirements": []
    },
    "youtube": {
      "version": "0.9.1",
      "requirements": []
    },
    "afvalwijzer": {
      "version": "2023.12.02",
      "requirements": []
    },
    "samsungtv_smart": {
      "version": "0.13.1",
      "requirements": [
        "websocket-client!=1.4.0,>=0.58.0",
        "wakeonlan>=2.0.0",
        "aiofiles>=0.8.0",
        "casttube>=0.2.1"
      ]
    },
    "smartlife": {
      "version": "0.1.0",
      "requirements": [
        "tuya-device-sharing-sdk==0.1.9"
      ]
    },
    "authenticated": {
      "version": "21.9.0",
      "requirements": []
    },
    "wyzeapi": {
      "version": "0.1.23",
      "requirements": [
        "wyzeapy==0.5.20"
      ]
    },
    "hacs": {
      "version": "1.33.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "spotcast": {
      "version": "v3.6.30",
      "requirements": []
    },
    "entity_controller": {
      "version": "9.6.1",
      "requirements": [
        "transitions==0.8.8"
      ]
    },
    "proxmoxve": {
      "version": "3.2.2",
      "requirements": [
        "proxmoxer==2.0.1"
      ]
    },
    "multiscrape": {
      "version": "6.5.0",
      "requirements": [
        "lxml>=4.9.1",
        "beautifulsoup4>=4.12.2"
      ]
    },
    "fontawesome": {
      "version": "2.2.1",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "smartlife",
    "name": "smartlife",
    "codeowners": [
      "@smartlife"
    ],
    "config_flow": true,
    "dependencies": [
      "ffmpeg"
    ],
    "dhcp": [
      {
        "macaddress": "105A17*"
      },
      {
        "macaddress": "10D561*"
      },
      {
        "macaddress": "1869D8*"
      },
      {
        "macaddress": "381F8D*"
      },
      {
        "macaddress": "508A06*"
      },
      {
        "macaddress": "68572D*"
      },
      {
        "macaddress": "708976*"
      },
      {
        "macaddress": "7CF666*"
      },
      {
        "macaddress": "84E342*"
      },
      {
        "macaddress": "D4A651*"
      },
      {
        "macaddress": "D81F12*"
      }
    ],
    "documentation": "https://www.home-assistant.io/integrations/smartlife",
    "integration_type": "hub",
    "iot_class": "cloud_push",
    "version": "0.1.0",
    "requirements": [
      "tuya-device-sharing-sdk==0.1.9"
    ],
    "is_built_in": false
  },
  "data": {
    "endpoint": "https://apigw.tuyaeu.com",
    "terminal_id": "1702857532161Aaj0Es",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "id": "bf9ac3xcno2cglua",
    "name": "S1-TY-BLE-PRO",
    "category": "jtmspro",
    "product_id": "xqeob8h6",
    "product_name": "S1-TY-BLE-PRO",
    "online": false,
    "sub": false,
    "time_zone": "+01:00",
    "active_time": "2024-01-04T18:01:44+00:00",
    "create_time": "2024-01-04T18:01:44+00:00",
    "update_time": "2024-01-04T18:01:44+00:00",
    "function": {
      "unlock_method_create": {
        "type": "Raw",
        "value": {}
      },
      "unlock_method_delete": {
        "type": "Raw",
        "value": {}
      },
      "unlock_method_modify": {
        "type": "Raw",
        "value": {}
      },
      "lock_record": {
        "type": "Raw",
        "value": {}
      },
      "message": {
        "type": "Boolean",
        "value": {}
      },
      "automatic_lock": {
        "type": "Boolean",
        "value": {}
      },
      "unlock_switch": {
        "type": "Enum",
        "value": {
          "range": [
            "single_unlock",
            "finger_card"
          ]
        }
      },
      "auto_lock_time": {
        "type": "Integer",
        "value": {
          "min": 1,
          "max": 1800,
          "scale": 0,
          "step": 1
        }
      },
      "rtc_lock": {
        "type": "Boolean",
        "value": {}
      },
      "manual_lock": {
        "type": "Boolean",
        "value": {}
      },
      "synch_method": {
        "type": "Raw",
        "value": {}
      },
      "remote_no_dp_key": {
        "type": "Raw",
        "value": {}
      },
      "record": {
        "type": "Raw",
        "value": {}
      },
      "check_code_set": {
        "type": "Raw",
        "value": {}
      },
      "ble_unlock_check": {
        "type": "Raw",
        "value": {}
      },
      "remote_pd_setkey_check": {
        "type": "Raw",
        "value": {}
      },
      "unlock_ble_ibeacon": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 999,
          "scale": 0,
          "step": 1
        }
      },
      "ibeacon_scan_mode": {
        "type": "Enum",
        "value": {
          "range": [
            "always",
            "5min",
            "10min",
            "20min",
            "40min",
            "60min",
            "90min",
            "120min"
          ]
        }
      },
      "rssi_sensitivity_level": {
        "type": "Enum",
        "value": {
          "range": [
            "inactive",
            "90db",
            "80db",
            "70db",
            "60db",
            "50db",
            "40db",
            "30db",
            "20db"
          ]
        }
      },
      "ibeacon_switch": {
        "type": "Boolean",
        "value": {}
      }
    },
    "status_range": {
      "unlock_method_create": {
        "type": "Raw",
        "value": {}
      },
      "unlock_method_delete": {
        "type": "Raw",
        "value": {}
      },
      "unlock_method_modify": {
        "type": "Raw",
        "value": {}
      },
      "residual_electricity": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 100,
          "scale": 0,
          "step": 1
        }
      },
      "unlock_fingerprint": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 999,
          "scale": 0,
          "step": 1
        }
      },
      "unlock_card": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 999,
          "scale": 0,
          "step": 1
        }
      },
      "unlock_key": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 999,
          "scale": 0,
          "step": 1
        }
      },
      "unlock_ble": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 999,
          "scale": 0,
          "step": 1
        }
      },
      "lock_record": {
        "type": "Raw",
        "value": {}
      },
      "alarm_lock": {
        "type": "Enum",
        "value": {
          "range": [
            "wrong_finger",
            "wrong_password",
            "wrong_card",
            "wrong_face",
            "tongue_bad",
            "too_hot",
            "unclosed_time",
            "tongue_not_out",
            "pry",
            "key_in",
            "low_battery",
            "power_off",
            "shock",
            "defense"
          ]
        }
      },
      "hijack": {
        "type": "Boolean",
        "value": {}
      },
      "doorbell": {
        "type": "Boolean",
        "value": {}
      },
      "message": {
        "type": "Boolean",
        "value": {}
      },
      "automatic_lock": {
        "type": "Boolean",
        "value": {}
      },
      "unlock_switch": {
        "type": "Enum",
        "value": {
          "range": [
            "single_unlock",
            "finger_card"
          ]
        }
      },
      "auto_lock_time": {
        "type": "Integer",
        "value": {
          "min": 1,
          "max": 1800,
          "scale": 0,
          "step": 1
        }
      },
      "closed_opened": {
        "type": "Enum",
        "value": {
          "range": [
            "unknown",
            "open",
            "closed"
          ]
        }
      },
      "rtc_lock": {
        "type": "Boolean",
        "value": {}
      },
      "manual_lock": {
        "type": "Boolean",
        "value": {}
      },
      "lock_motor_state": {
        "type": "Boolean",
        "value": {}
      },
      "synch_method": {
        "type": "Raw",
        "value": {}
      },
      "remote_no_dp_key": {
        "type": "Raw",
        "value": {}
      },
      "unlock_phone_remote": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 999,
          "scale": 0,
          "step": 1
        }
      },
      "unlock_voice_remote": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 999,
          "scale": 0,
          "step": 1
        }
      },
      "record": {
        "type": "Raw",
        "value": {}
      },
      "check_code_set": {
        "type": "Raw",
        "value": {}
      },
      "ble_unlock_check": {
        "type": "Raw",
        "value": {}
      },
      "unlock_record_check": {
        "type": "Raw",
        "value": {}
      },
      "remote_pd_setkey_check": {
        "type": "Raw",
        "value": {}
      },
      "unlock_double_kit": {
        "type": "Raw",
        "value": {}
      },
      "unlock_ble_ibeacon": {
        "type": "Integer",
        "value": {
          "min": 0,
          "max": 999,
          "scale": 0,
          "step": 1
        }
      },
      "ibeacon_scan_mode": {
        "type": "Enum",
        "value": {
          "range": [
            "always",
            "5min",
            "10min",
            "20min",
            "40min",
            "60min",
            "90min",
            "120min"
          ]
        }
      },
      "rssi_sensitivity_level": {
        "type": "Enum",
        "value": {
          "range": [
            "inactive",
            "90db",
            "80db",
            "70db",
            "60db",
            "50db",
            "40db",
            "30db",
            "20db"
          ]
        }
      },
      "ibeacon_switch": {
        "type": "Boolean",
        "value": {}
      }
    },
    "status": {
      "unlock_method_create": "Av8AAgUAAA==",
      "unlock_method_delete": "",
      "unlock_method_modify": "",
      "residual_electricity": 100,
      "unlock_fingerprint": 1,
      "unlock_card": 5,
      "unlock_key": 0,
      "unlock_ble": 1,
      "lock_record": "",
      "alarm_lock": "wrong_finger",
      "hijack": false,
      "doorbell": false,
      "message": false,
      "automatic_lock": true,
      "unlock_switch": "single_unlock",
      "auto_lock_time": 10,
      "closed_opened": "unknown",
      "rtc_lock": false,
      "manual_lock": true,
      "lock_motor_state": false,
      "synch_method": "AQE=",
      "remote_no_dp_key": "",
      "unlock_phone_remote": 0,
      "unlock_voice_remote": 0,
      "record": "AAEB",
      "check_code_set": "AAH//wAAAAAAAAAAAP//AA==",
      "ble_unlock_check": "AAH//zI3NTQyMDM5AWWXO0cAAA==",
      "unlock_record_check": "",
      "remote_pd_setkey_check": "",
      "unlock_double_kit": "",
      "unlock_ble_ibeacon": 0,
      "ibeacon_scan_mode": "always",
      "rssi_sensitivity_level": "inactive",
      "ibeacon_switch": false
    },
    "home_assistant": {
      "name": "S1-TY-BLE-PRO",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": []
    },
    "set_up": false,
    "support_local": true
  }
}
mpanasci commented 5 months ago

Hello,

I also have this device (Smart Lock S1-TY-BLE-PRO from tuya) and I hope it will be soon compatible with home assistant.

Thanks.

sevagjb commented 5 months ago

i like that too, nice to have the lock on HA soon :)

RafaelDuncan commented 4 months ago

I also bought this lock and it would be fantastic if we could also add it to Home Assistant via the Tuya BLE integration. I would like to help realize this if desired, I don't know to what extent there is room for this with the developer? Here is also the logging from my side.

Device details:

{ "active_time": 1706127697, "biz_type": 0, "category": "jtmspro", "create_time": 1706046372, "icon": "smart/icon/ay15637661355438qua2/f63a35cd47c91c90c5369b8bd0afacbc.png", "id": "bfcd55dkubmlf6qy", "ip": "", "lat": "", "local_key": "", "lon": "", "model": "S1", "name": "S1-TY-BLE-PRO", "online": false, "owner_id": "24130268", "product_id": "xqeob8h6", "product_name": "S1-TY-BLE-PRO", "status": [ { "code": "unlock_method_create", "value": "" }, { "code": "unlock_method_delete", "value": "" }, { "code": "unlock_method_modify", "value": "" }, { "code": "residual_electricity", "value": 100 }, { "code": "unlock_fingerprint", "value": 0 }, { "code": "unlock_card", "value": 0 }, { "code": "unlock_key", "value": 0 }, { "code": "unlock_ble", "value": 1 }, { "code": "lock_record", "value": "" }, { "code": "alarm_lock", "value": "wrong_finger" }, { "code": "hijack", "value": false }, { "code": "doorbell", "value": false }, { "code": "message", "value": false }, { "code": "automatic_lock", "value": true }, { "code": "unlock_switch", "value": "single_unlock" }, { "code": "auto_lock_time", "value": 5 }, { "code": "closed_opened", "value": "unknown" }, { "code": "rtc_lock", "value": false }, { "code": "manual_lock", "value": true }, { "code": "lock_motor_state", "value": false }, { "code": "synch_method", "value": "" }, { "code": "remote_no_dp_key", "value": "" }, { "code": "unlock_phone_remote", "value": 0 }, { "code": "unlock_voice_remote", "value": 0 }, { "code": "record", "value": "" }, { "code": "check_code_set", "value": "AAH//wAAAAAAAAAAAP//AA==" }, { "code": "ble_unlock_check", "value": "AAH//zM5MzQ2MDUwAWWxcVgAAA==" }, { "code": "unlock_record_check", "value": "" }, { "code": "remote_pd_setkey_check", "value": "" }, { "code": "unlock_double_kit", "value": "" }, { "code": "unlock_ble_ibeacon", "value": 0 }, { "code": "ibeacon_scan_mode", "value": "always" }, { "code": "rssi_sensitivity_level", "value": "inactive" }, { "code": "ibeacon_switch", "value": false } ], "sub": false, "time_zone": "+01:00", "uid": "***", "update_time": 1706127697, "uuid": "uuid10ca70954282" },

EXTRA INFORMATION FROM LOGGING:

[["tuya","bfcd55dkubmlf6qy"]],"manufacturer":"Tuya","model":"S1-TY-BLE-PRO (unsupported)","name_by_user":null,"name":"S1-TY-BLE-PRO","serial_number":null,"sw_version":null,"via_device_id":null},{"area_id":null,"configuration_url":null,"config_entries":["f96c4ba92a366865721ee17a181bcb32"],"connections":[["bluetooth","DC:23:4F:80:B1:97"]],"disabled_by":null,"entry_type":null,"hw_version":"","id":"99c55e6c230d0d59a894035469432121","identifiers":[["tuya_ble","DC:23:4F:80:B1:97"]],"manufacturer":"Tuya","model":"S1 (xqeob8h6)","name_by_user":null,"name":"S1-TY-BLE-PRO 80B197","serial_number":null,"sw_version":" (protocol )","via_device_id":null},{"area_id":null,"configuration_url":"homeassistant://hacs","config_entries":["32ea0678147fea30cb788c001d6b2911"],"connections":[],"disabled_by":null,"entry_type":"service","hw_version":null,"id":"4136ab4c9916c11e197cf6560e99c5b1","identifiers":

RafaelDuncan commented 4 months ago

Here is some additional log information from Home Assistant:

Logger: homeassistant.config_entries Source: config_entries.py:561 First occurred: 08:42:51 (24 occurrences) Last logged: 11:11:38

Error unloading entry S1-TY-BLE-PRO 80B197 for sensor Error unloading entry S1-TY-BLE-PRO 80B197 for binary_sensor Error unloading entry S1-TY-BLE-PRO 80B197 for select Error unloading entry S1-TY-BLE-PRO 80B197 for switch Error unloading entry S1-TY-BLE-PRO 80B197 for text Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 561, in async_unload result = await component.async_unload_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/button/init.py", line 77, in async_unload_entry return await component.async_unload_entry(entry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 203, in async_unload_entry raise ValueError("Config entry was never loaded!") ValueError: Config entry was never loaded!