make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.07k stars 431 forks source link

Request support for Bluetooth Door Lock #1813

Open OsaedYahya opened 2 months ago

OsaedYahya commented 2 months ago

Information about DPS mappings

{ "name": "Door", "id": "xxxxxxx", "key": "xxxxxxxxx", "mac": "xxxxxxxx", "uuid": "xxxxxxxx", "category": "jtmspro", "product_name": "Smart Lock", "product_id": "xicdxood", "biz_type": 18, "model": "C502", "sub": true, "icon": "https://images.tuyaeu.com/smart/program_category_icon/jtmspro.png", "node_id": "39d4c4d15050b51a", "mapping": { "1": { "code": "unlock_method_create", "type": "Raw", "values": {} }, "2": { "code": "unlock_method_delete", "type": "Raw", "values": {} }, "3": { "code": "unlock_method_modify", "type": "Raw", "values": {} }, "8": { "code": "residual_electricity", "type": "Integer", "values": { "min": 0, "max": 100, "scale": 0, "step": 1 } }, "12": { "code": "unlock_fingerprint", "type": "Integer", "values": { "min": 0, "max": 999, "scale": 0, "step": 1 } }, "13": { "code": "unlock_password", "type": "Integer", "values": { "min": 0, "max": 999, "scale": 0, "step": 1 } }, "14": { "code": "unlock_dynamic", "type": "Integer", "values": { "min": 0, "max": 999, "scale": 0, "step": 1 } }, "15": { "code": "unlock_card", "type": "Integer", "values": { "min": 0, "max": 999, "scale": 0, "step": 1 } }, "19": { "code": "unlock_ble", "type": "Integer", "values": { "min": 0, "max": 999, "scale": 0, "step": 1 } }, "21": { "code": "alarm_lock", "type": "Enum", "values": { "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" ] } }, "24": { "code": "doorbell", "type": "Boolean", "values": {} }, "28": { "code": "language", "type": "Enum", "values": { "range": [ "chinese_simplified", "english" ] } }, "31": { "code": "beep_volume", "type": "Enum", "values": { "range": [ "mute", "low", "normal", "high" ] } }, "44": { "code": "rtc_lock", "type": "Boolean", "values": {} }, "54": { "code": "synch_method", "type": "Raw", "values": {} }, "70": { "code": "check_code_set", "type": "Raw", "values": {} }, "71": { "code": "ble_unlock_check", "type": "Raw", "values": {} } }, "parent": "" }

Product ID

xicdxood

Information about how the device functions

This is a bluetooth door lock, I've tried to create the config file for it (was able to add it but it doesn't open or do anything just shows the battery)

name: Smart lock products:

OsaedYahya commented 2 months ago

@make-all I am modifying the code you've created and so far I fixed a lot of things (for my own devices) but since one device is very dumb and is using "RRGGBBHHHHSSVV" as a string instead of an object it's really giving me a headache but I was able to make it "set" the value but every 1 or 2 seconds it refreshes to empty on the UI because the Light component expects an object with r g b values. Can I override this in Light.py? or how can I handle the state changes