-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[New device support]: Tuya Zigbee Smart Vibration Detector #10534
Comments
I tried getting it to work, but didn't get very far. External converter:
I added I added this to
|
The format of the |
Also, the most recent version of how to add a Tuya device is not yet part of the published documentation, you can find it here: https://github.com/Koenkk/zigbee2mqtt.io/blob/develop/docs/advanced/support-new-devices/02_support_new_tuya_devices.md |
I installed the
This is great, because it means the device does send boolean data. |
TLRD: I managed to get it to work! Just to share some things that aren't or weren't clear to me during the process, perhaps it's useful:
Variables
If the debug output is correct, why not refer people to that instead of using How does exposes functionality work?
In the end it seems that exposes was handled automatically. Adding those names to the external converter seems to be all I needed to do. Very nice. About the example in the documentation: I found it very useful to have this inside my converter:
And since I'm at it:
|
For Tuya Smart Vibration sensor Koenkk/zigbee2mqtt#10534
The device and converter files are in https://github.com/Koenkk/zigbee-herdsman-converters, which is installed as an npm module when installing zigbee2mqtt. I suppose that's why it is simpler to use an external converter first. But yes, once it works and if you want the device to be supported upstream, the changes need to go to zigbee-herdsman-converters.
In general they are available across devices. I suppose that some are very specific to devices (for Tuya, it looks like device manufacturers pick data point IDs pretty much at random)
The output of the Python script still looks very wrong. A log line written by the current development version looks like this:
Yes, it means that the DP is 4, but you are right, it is 10 indeed. As said, if you generated the dump file with a version giving out log lines with
Usually, they should match 😉. The Python script actually decodes the data (into enum, int, string, bool, ...). But yes, it has limited value.
I am quite new to zigbee2mqtt development myself. The exposes part also looks like magic to me, still.
I wonder if:
honestly, I have no idea. |
For Tuya Smart Vibration sensor Koenkk/zigbee2mqtt#10534 Question: is the `return {vibration: Boolean(value)};` valid?
This huge device (powered by AAA batteries) is both a contact and vibration sensor. This is my first time adding a Zigbee device, so please scrutinise. Github issue: Koenkk/zigbee2mqtt#10534
Thanks @gmbnomis I like that idea of adding the logger. Still, i think the current debug output already gave me all I needed. I just added a pull request :-) |
* Added tuyaVibration dataPoint (10) For Tuya Smart Vibration sensor Koenkk/zigbee2mqtt#10534 * Add converter for Tuya Smart Vibration Sensor For Tuya Smart Vibration sensor Koenkk/zigbee2mqtt#10534 Question: is the `return {vibration: Boolean(value)};` valid? * Adding support for Tuya Smart Vibration Sensor This huge device (powered by AAA batteries) is both a contact and vibration sensor. This is my first time adding a Zigbee device, so please scrutinise. Github issue: Koenkk/zigbee2mqtt#10534 * Added raw type Testing with an out-of-the-box Sonoff 3 USB stick, I noticed it required `raw` to be used. * Update tuya.js * Update fromZigbee.js Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
Commit 38cae96 (Add TS0601_vibration_sensor (Koenkk#3619)) added the "from Zigbee" converter `tuya_smart_vibration_sensor`. However, it uses the old lib/tuya.js interface which does not work anymore. Adapt it to use the new interface (including a for loop) and add a couple of tests (using the DP values in the logs from Koenkk/zigbee2mqtt#10534 as input).
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days |
Link
https://nl.aliexpress.com/item/1005003168207230.html
Database entry
{"id":26,"type":"EndDevice","ieeeAddr":"0x540f57fffeXXXXXX","nwkAddr":21950,"manufId":4098,"manufName":"_TZE200_kzm5w4iz","powerSource":"Battery","modelId":"TS0601","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,4,5,61184],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0004\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0012\u0000\u0000\u0000\u0000\u0012\u000b_O)\u0017\f_O)\u0013\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0012\u0000\u0000\u0000\u0000\u0012","65506":31,"65508":0,"modelId":"TS0601","manufacturerName":"_TZE200_kzm5w4iz","powerSource":3,"zclVersion":3,"appVersion":68,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[{"cluster":0,"type":"endpoint","deviceIeeeAddress":"0x00212effffXXXXXX","endpointID":1}],"configuredReportings":[],"meta":{}}},"appVersion":68,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":821693351},"lastSeen":1641205346747,"useImplicitCheckin":true}
Comments
I'm trying to add a new Tuya device (a huge vibration sensor that runs on AAA batteries).
I tried following the guide but ran into issues documented in this other issue
These is the live debug output:
After doing a little modification I managed to get the
tuya.dump.txt
file. It looks like this (after removing privacy-sensitive data):I fed that into the python parser (
tail -f -n +0 tuya.dump.txt | python3 read_tuya_dump.py
) and got this output:Since the device is not a
frost detect
sensor, I wonder how I should interpret this.bool: False
occurs when the magnet is moved away or back to the device.enum: 0
occurs when the main body is shaken or hit (vibration)int: 97
is probably the battery level?What should my next step be?
External converter
Supported color modes
No response
Color temperature range
No response
The text was updated successfully, but these errors were encountered: