Xenomes / Domoticz-TinyTUYA-Plugin

A bridge between Tinytuya and Domoticz
12 stars 7 forks source link

Smart Lock and Bluetooth Gateway #59

Closed ilkaskim closed 1 year ago

ilkaskim commented 1 year ago

Hello, I have installed 3 Smart Lock door openers and 1 Bluetooth gateway. Unfortunately, these are only displayed as text in Domoticz. Can you install the missing parts in your plugin please.

I have debugged the missing parts. I hope everything works out so far.

Best regards

smart_lock.txt

List of devices: [ { "name": "Wireless Bluetooth gateway", "id": "bf1af4b5ae7fdbcfae5yuo", "key": "Deleted", "mac": "50:8b:b9:a8:d6:56", "uuid": "39aec440542ca6e1", "sn": "10011271700174", "category": "wg2", "product_name": "Wireless Bluetooth gateway", "product_id": "mzxmuvrg", "biz_type": 18, "model": "CDT02", "sub": true, "icon": "https://images.tuyaeu.com/smart/icon/bay1631238927581Zvw8/2002632ef75be032aed3c6d3bf8afa9c.png"


  {
"name": "Ilhan",
"id": "bf5647vrauhlbpct",
"key": "Deleted",
"mac": "DC:23:4F:0D:FE:EC",
"uuid": "8db62e0e6a099582",
"category": "ms",
"product_name": "Smart Lock",
"product_id": "okkyfgfs",
"biz_type": 18,
"model": "P196_V",
"sub": true,
"icon": "https://images.tuyaeu.com/smart/icon/ay15724370520156puq6/6c357daee9ae07eebf83d262c813780e.jpg",
"node_id": "8db62e0e6a099582"

},


Properties of device: bf1af4b5ae7fdbcfae5yuo { "result": { "category": "wg2" }, "success": true, "t": 1694979999784, "tid": "eb5da556559211ee8504366935745e24" } Status of device: bf1af4b5ae7fdbcfae5yuo


Properties of device: bf5647vrauhlbpct { "result": { "category": "ms", "functions": [ { "code": "unlock_method_create", "desc": "{}", "name": "\u6dfb\u52a0\u5f00\u95e8\u65b9\u5f0f", "type": "Raw", "values": "{}" }, { "code": "unlock_method_delete", "desc": "{}", "name": "\u5220\u9664\u5f00\u95e8\u65b9\u5f0f", "type": "Raw", "values": "{}" }, { "code": "unlock_method_modify", "desc": "{}", "name": "\u4fee\u6539\u5f00\u95e8\u65b9\u5f0f", "type": "Raw", "values": "{}" }, { "code": "beep_volume", "desc": "{\"range\":[\"mute\",\"low\",\"normal\",\"high\"]}", "name": "\u95e8\u9501\u672c\u5730\u5bfc\u822a\u97f3\u91cf", "type": "Enum", "values": "{\"range\":[\"mute\",\"low\",\"normal\",\"high\"]}" }, { "code": "temporary_password_creat", "desc": "{}", "name": "\u6dfb\u52a0\u4e34\u65f6\u5bc6\u7801", "type": "Raw", "values": "{}" }, { "code": "temporary_password_delete", "desc": "{}", "name": "\u5220\u9664\u4e34\u65f6\u5bc6\u7801", "type": "Raw", "values": "{}" }, { "code": "temporary_password_modify", "desc": "{}", "name": "\u4fee\u6539\u4e34\u65f6\u5bc6\u7801", "type": "Raw", "values": "{}" }, { "code": "synch_method", "desc": "{}", "name": "\u540c\u6b65\u5f00\u95e8\u65b9\u5f0f\uff08\u5168\u91cf\u540c\u6b65\uff09", "type": "Raw", "values": "{}" }, { "code": "remote_no_pd_setkey", "desc": "{}", "name": "\u8bbe\u7f6e\u514d\u5bc6\u8fdc\u7a0b\u5f00\u95e8\u5bc6\u94a5", "type": "Raw", "values": "{}" }, { "code": "remote_no_dp_key", "desc": "{}", "name": "\u65b0\u514d\u5bc6\u8fdc\u7a0b\u5f00\u95e8-\u5e26\u5bc6\u94a5", "type": "Raw", "values": "{}" }, { "code": "password_offline_time", "desc": "{}", "name": "\u79bb\u7ebf\u5bc6\u7801T0\u65f6\u95f4\u4e0b\u53d1", "type": "String", "values": "{}" } ], "status": [ { "code": "unlock_method_create", "name": "\u6dfb\u52a0\u5f00\u95e8\u65b9\u5f0f", "type": "Raw", "values": "{}" }, { "code": "unlock_method_delete", "name": "\u5220\u9664\u5f00\u95e8\u65b9\u5f0f", "type": "Raw", "values": "{}" }, { "code": "unlock_method_modify", "name": "\u4fee\u6539\u5f00\u95e8\u65b9\u5f0f", "type": "Raw", "values": "{}" }, { "code": "residual_electricity", "name": "\u5269\u4f59\u7535\u91cf", "type": "Integer", "values": "{\"min\":-1,\"max\":100,\"scale\":0,\"step\":1}" }, { "code": "unlock_fingerprint", "name": "\u6307\u7eb9\u89e3\u9501", "type": "Integer", "values": "{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}" }, { "code": "unlock_password", "name": "\u666e\u901a\u5bc6\u7801\u89e3\u9501", "type": "Integer", "values": "{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}" }, { "code": "unlock_dynamic", "name": "\u52a8\u6001\u5bc6\u7801\u89e3\u9501", "type": "Integer", "values": "{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}" }, { "code": "unlock_ble", "name": "\u84dd\u7259\u89e3\u9501\u8bb0\u5f55", "type": "Integer", "values": "{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}" }, { "code": "alarm_lock", "name": "\u544a\u8b66", "type": "Enum", "values": "{\"range\":[\"wrong_finger\",\"wrong_password\",\"low_battery\"]}" }, { "code": "beep_volume", "name": "\u95e8\u9501\u672c\u5730\u5bfc\u822a\u97f3\u91cf", "type": "Enum", "values": "{\"range\":[\"mute\",\"low\",\"normal\",\"high\"]}" }, { "code": "lock_motor_state", "name": "\u9501\u5f00\u5408\u72b6\u6001", "type": "Boolean", "values": "{}" }, { "code": "temporary_password_creat", "name": "\u6dfb\u52a0\u4e34\u65f6\u5bc6\u7801", "type": "Raw", "values": "{}" }, { "code": "temporary_password_delete", "name": "\u5220\u9664\u4e34\u65f6\u5bc6\u7801", "type": "Raw", "values": "{}" }, { "code": "temporary_password_modify", "name": "\u4fee\u6539\u4e34\u65f6\u5bc6\u7801", "type": "Raw", "values": "{}" }, { "code": "synch_method", "name": "\u540c\u6b65\u5f00\u95e8\u65b9\u5f0f\uff08\u5168\u91cf\u540c\u6b65\uff09", "type": "Raw", "values": "{}" }, { "code": "unlock_temporary", "name": "\u4e34\u65f6\u5bc6\u7801\u89e3\u9501", "type": "Integer", "values": "{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}" }, { "code": "remote_no_pd_setkey", "name": "\u8bbe\u7f6e\u514d\u5bc6\u8fdc\u7a0b\u5f00\u95e8\u5bc6\u94a5", "type": "Raw", "values": "{}" }, { "code": "remote_no_dp_key", "name": "\u65b0\u514d\u5bc6\u8fdc\u7a0b\u5f00\u95e8-\u5e26\u5bc6\u94a5", "type": "Raw", "values": "{}" }, { "code": "unlock_phone_remote", "name": "\u8fdc\u7a0b\u624b\u673a\u89e3\u9501", "type": "Integer", "values": "{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}" }, { "code": "unlock_voice_remote", "name": "\u8fdc\u7a0b\u8bed\u97f3\u89e3\u9501", "type": "Integer", "values": "{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}" }, { "code": "password_offline_time", "name": "\u79bb\u7ebf\u5bc6\u7801T0\u65f6\u95f4\u4e0b\u53d1", "type": "String", "values": "{}" }, { "code": "unlock_offline_clear_single", "name": "\u5355\u6761\u79bb\u7ebf\u5bc6\u7801\u6e05\u7a7a\u4e0a\u62a5", "type": "Raw", "values": "{}" }, { "code": "unlock_offline_clear", "name": "\u79bb\u7ebf\u5bc6\u7801\u6e05\u7a7a\u4e0a\u62a5", "type": "Raw", "values": "{}" }, { "code": "unlock_offline_pd", "name": "\u79bb\u7ebf\u5bc6\u7801\u89e3\u9501\u4e0a\u62a5", "type": "Raw", "values": "{}" } ] }, "success": true, "t": 1694980000347, "tid": "ebb2bf22559211eeb3f09e6a0abc163a"

Xenomes commented 1 year ago

Hi thank you for the dump, unfortunately, it is incomplete to determine if it can be used for Domoticz. can you post or email the 'status of device: bf5647vrauhlbpct'?

ilkaskim commented 1 year ago

I hope that's right.

Status of device: bf5647vrauhlbpct { "result": [ { "code": "unlock_method_create", "value": "Af8BAQAAAA==" }, { "code": "unlock_method_delete", "value": "" }, { "code": "unlock_method_modify", "value": "" }, { "code": "residual_electricity", "value": 79 }, { "code": "unlock_fingerprint", "value": 100 }, { "code": "unlock_password", "value": 0 }, { "code": "unlock_dynamic", "value": 0 }, { "code": "unlock_ble", "value": 1 }, { "code": "alarm_lock", "value": "wrong_finger" }, { "code": "beep_volume", "value": "low" }, { "code": "lock_motor_state", "value": false }, { "code": "temporary_password_creat", "value": "" }, { "code": "temporary_password_delete", "value": "" }, { "code": "temporary_password_modify", "value": "" }, { "code": "synch_method", "value": "AQA=" }, { "code": "unlock_temporary", "value": 0 }, { "code": "remote_no_pd_setkey", "value": "AAAB" }, { "code": "remote_no_dp_key", "value": "" }, { "code": "unlock_phone_remote", "value": 0 }, { "code": "unlock_voice_remote", "value": 0 }, { "code": "password_offline_time", "value": "1694779471" }, { "code": "unlock_offline_clear_single", "value": "" }, { "code": "unlock_offline_clear", "value": "" }, { "code": "unlock_offline_pd", "value": "" } ], "success": true, "t": 1694980000506, "tid": "ebcb4922559211ee8298eeefa7b3467e" }

Xenomes commented 1 year ago

Hi, I think these three are useful: { "code": "alarm_lock", "name": "\u544a\u8b66", "type": "Enum", "values": "{"range":["wrong_finger","wrong_password","low_battery"]}" }, { "code": "unlock_temporary", "name": "\u4e34\u65f6\u5bc6\u7801\u89e3\u9501", "type": "Integer", "values": "{"min":0,"max":999,"scale":0,"step":1}" }, { "code": "lock_motor_state", "name": "\u9501\u5f00\u5408\u72b6\u6001", "type": "Boolean", "values": "{}" },

alarm_lock as a text device. unlock_temporary to unlock the door for 10 seconds. lock_motor_state to check if the door is locked.

If you think others are also useful, please comment on them.

ilkaskim commented 1 year ago

Hello, battery level would still be interesting. Is that part?

"code": "residual_electricity", "value": 79

You have already written down the most important information. šŸ‘

Best regards,

Xenomes commented 1 year ago

Yes, the battery will be used on all devices as battery level.

Xenomes commented 1 year ago

Your device has been added to the Smartlock branch. Please check all the functions and report any issues."

cd ~/domoticz/plugins/Domoticz-TinyTUYA-Plugin
git pull
git checkout Smartlock
sudo systemctl restart domoticz.service

To revert to the Master, change Smartlock to Master

ilkaskim commented 1 year ago

New switches have been added. But I can't switch from outside. The new switches are information from the state, which is all correct so far šŸ‘!

20230922_232139.jpg

There are still unknown devices available. Is that correct?

20230922_232618.jpg

Xenomes commented 1 year ago

I think it is the old device, can you delete it and reload the plugin.

ilkaskim commented 1 year ago

I removed the old devices and new switches were added. But I still can't switch externally.

Status changes, which is later than it should. Unfortunately, opening externally does not work.

Xenomes commented 1 year ago

The plugin pulls the status once a minute from the Tuya server. I realize that I forgot to assign a recognition point to the state switch. One switch represents the state, while the other sends a value of 10 to unlock_temporary. Can you pull the newer version from GitHub, delete the smartlock devices, and reload the plugin or restart Domoticz.

ilkaskim commented 1 year ago

Hi, Sry I've been on night shift šŸ˜

I installed the latest one and removed everything. All the new switches have come back, unfortunately opening them does not work. Could it be the problem with the Bluetooth gateway? Thank you for the effort šŸ‘

Xenomes commented 1 year ago

Hi no Problem, May be. think this is the first added to the plugin. I will look if we are using the correct code to open.

ilkaskim commented 1 year ago

If I look at tuya cloud website with debugging then I can't change the data there either.

Screenshot_20230923_195459_Chrome.jpg

Hopefully it works out as you imagined šŸ˜‰

Xenomes commented 1 year ago

That is too bad, you can't control it on the website. Then we can only show the status.

ilkaskim commented 1 year ago

That's a pity, but I still thank you for the effort. šŸ‘

Xenomes commented 1 year ago

I will then remove the device that controls the open/close and add it to the Master. Thanks for testing it on the Tuya website. If there's any improvement needed, you could reopen the ticket.

Xenomes commented 1 year ago

I had to move device ID 3 to 1. So, if you are reverting to the Master version, you'll need to delete devices 1 and 3. Alternatively, if you want to retain the history, delete device 1 and move device 3 to ID 1 in the database.

ilkaskim commented 1 year ago

Thanks, I'll do that šŸ‘