0x5e / homebridge-tuya-platform

Make homebridge-tuya-platform great again.
MIT License
217 stars 67 forks source link

Add support for Smart Alarm #193

Open drhatemalfarra opened 1 year ago

drhatemalfarra commented 1 year ago

Would you please add this device, it is working on Tuya app, but on plugin showing as not supported, and on HB-UI accessories (i can not see it in the list) Device info 1- from json:

{ "active_time": 1672693138, "biz_type": 0, "category": "sgbj", "create_time": 1672693138, "icon": "smart/icon/bay1582725542891RIK5/00740aed253fa09a4283b8fad6ae3b51.png", "id": "bf8e818ec57400c71eehjl", "ip": "**", "lat": "*", "local_key": "****", "lon": "*****", "model": "SH.63.220", "name": "Smart Alarm", "online": true, "owner_id": "71465053", "product_id": "zynxlsbb1owzhz4n", "product_name": "Smart Alarm", "status": [ { "code": "alarm_switch", "value": false }, { "code": "alarm_time", "value": 10 }, { "code": "alarm_volume", "value": "middle" } ], "sub": false, "time_zone": "+01:00", "uid": "***", "update_time": 1672693147, "uuid": "815a42525b099074", "schema": [ { "code": "alarm_switch", "mode": "rw", "type": "Boolean", "property": {} }, { "code": "alarm_time", "mode": "rw", "type": "Integer", "property": { "unit": "", "min": 1, "max": 30, "scale": 0, "step": 1 } }, { "code": "alarm_volume", "mode": "rw", "type": "Enum", "property": { "range": [ "low", "middle", "high", "mute" ] } } ]

2- from mqtt logs: [2-1-2023 22:58:43] [@0x5e/homebridge-tuya-platform] [TuyaOpenMQ] onMessage: topic = cloud/token/in/fce9cfa9425b6b495a84ab1d0ceff5a6 protocol = 4 message = { "dataId": "09c488a4-2481-4cf0-9632-d99b1c3372c6", "devId": "bf8e818ec57400c71eehjl", "productKey": "zynxlsbb1owzhz4n", "status": [ { "1": "mute" }, { "13": false, "code": "alarm_switch", "t": "1672696722", "value": false } ] } t = 1672696722

0x5e commented 1 year ago

There's no suitable homekit sensor for sgbj. Maybe Leak Sensor is the last choice. Which one do you prefer? https://developers.homebridge.io/#/characteristic/

drhatemalfarra commented 1 year ago

You asked which one I prefer? I see only one option! if no other choice, then let's have it. Thx in advance

0x5e commented 1 year ago

https://developer.tuya.com/cn/docs/iot/s?id=K9gf48qox8rvt

seems your device is missing alarm_state. can you test each dp code on tuya web device debugging tool, I need to know which one means alarm event.

drhatemalfarra commented 1 year ago

I tried to do this, but firstly I am not so expert to carry out this, and secondly I can't see the alarm_state in the persist file, even the alarm event!

Here is Copy&paste from

Configure Control Instruction Mode LSC SMART Connect Sirene Devices:Product Type:Siren Select Control Instruction Mode This configuration will affect the control instruction mode of the specified product under this project. Before you change the mode, refer to the following table of instructions and check the instructions applicable to this product in the two modes respectively.

Table of Instructions

DP Instruction | Standard Instruction -- | -- alarm_state | alarm_state alarm_volume | alarm_volume alarm_time | alarm_time alarm_switch | alarm_switch
drhatemalfarra commented 1 year ago
Code | Type | Values -- | -- | -- alarm_state | Enum | { "range": [ "light", "voice", "light_voice", "mute" ] }
dsants00 commented 1 year ago

https://developers.homebridge.io/#/characteristic/

Is it possible to use something related to security?

https://developers.homebridge.io/#/service/SecuritySystem