-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crash with Aqara S2 lock Koenkk/zigbee2mqtt#349 #2
Conversation
Thanks! |
Unfortunately I have to revert this as it's causing issues (Koenkk/zigbee2mqtt#1710). I've checked the code again but it doesn't make sense to me,
|
@Koenkk i will check this, but with xiaomi struct decode it will crash with some devices, i remember the author of those code said that we must let the decode without xiaomi struct and then apply it with specific device later, because it again the standard. Example we can apply those code for devices in zigbee seppherd conveter only, after convert ascii string back to hex, so it will never crash |
@Koenkk We can replace function ru.clause('xiaoMiStruct', function (name) with those code in the zigbee-shepherd-converters: https://github.com/TedTolboom/com.xiaomi-mi-zigbee/blob/e7a7ac0e9ec4129cefabc5d2fba82e939f09529e/drivers/sensor_magnet.aq2/device.js#L65 |
Can you make a pr and test? |
@Koenkk Yes, i will test it with some Xiaomi devices. |
@Koenkk i tested the code but for some data it not decode like original "xiaoMiStruct" (example voltage, power usage of xiaomi plug not decode) function here:
I am not very good at nodejs or Javascript, you can convert it to normal function and add it to zigbee-shepherd-converters parseData function? I wrote here https://github.com/dzungpv/zigbee-shepherd-converters/blob/6c3ab10f2e1fa022f6f94452b222a23f0dffda5c/converters/fromZigbee.js#L7 If we can move it here, it will fix the bug with Aqara S2 Lock and other undecode data, because those data is original string in Zigbee standard Xiaomi use to encode their data |
Update parameters for VZM31-SN to camelCase
Fix issue: Koenkk/zigbee2mqtt#349 (comment)
This code need for the pull Koenkk/zigbee-herdsman-converters#497
@Koenkk I make less change to zcl-packet, i also test it not affect exist device support in zigbee-shepherd-converters, it only crash with Aqara S2 doorlock and struct-string data of Xiaomi, atribute id: 65281 so i whitelist only Xiaomi lock from this code.