Skip to content
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

[Wrong device]: Moes ZB-LZD10-RCW detected as Tuya TS0505B_1 #23230

Closed
wraeuk opened this issue Jul 2, 2024 · 10 comments
Closed

[Wrong device]: Moes ZB-LZD10-RCW detected as Tuya TS0505B_1 #23230

wraeuk opened this issue Jul 2, 2024 · 10 comments

Comments

@wraeuk
Copy link

wraeuk commented Jul 2, 2024

Link

https://www.aliexpress.com/item/1005004382991985.html

Model

ZB-LZD10-RCW

Description

10W RGB+CCT Smart Downlight

Vendor

Moes

Picture (link)

https://www.zigbee2mqtt.io/images/devices/ZB-LZD10-RCW.png

Database entry

{"id":10,"type":"Router","ieeeAddr":"0xa4c1387c2a278a83","nwkAddr":4512,"manufId":4107,"manufName":"_TZ3210_jjqdqxfq","powerSource":"Mains (single phase)","modelId":"TS0505B","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":269,"inClusterList":[0,3,6280,4,5,6,8,768,10,4096,65518],"outClusterList":[25,4096,65518],"clusters":{"genLevelCtrl":{"attributes":{"61440":1000}},"genBasic":{"attributes":{"hwVersion":0}},"lightingColorCtrl":{"attributes":{"57344":1000,"57345":[1000,65536113],"61453":1,"colorCapabilities":8,"colorTempPhysicalMin":143,"colorTempPhysicalMax":500,"tuyaRgbMode":0}},"genOnOff":{"attributes":{"61440":0,"onOff":0}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":112,"stackVersion":2,"hwVersion":0,"swBuildId":"z.1.0","zclVersion":3,"interviewCompleted":true,"meta":{"configured":332242049},"lastSeen":1719886938850}

Notes

Curiously I had one of the 15 lights correctly detect, despite all being bought at the same time (and looking physically identical.) Removing and repairing any of the incorrectly detected ones goes back to TS0505B_1, I haven't been game to re-pair the correctly detected one, but it's definitely detected incorrectly in the past.

The correctly detected device has the following db entry
{"id":11,"type":"Router","ieeeAddr":"0xa4c1386bac72e5b4","nwkAddr":22013,"manufId":4417,"manufName":"_TZ3210_s9lumfhn","powerSource":"Mains (single phase)","modelId":"TS0505B","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":269,"inClusterList":[3,4,5,6,4096,8,768,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"TS0505B","manufacturerName":"_TZ3210_s9lumfhn","powerSource":1,"zclVersion":3,"appVersion":101,"stackVersion":0,"hwVersion":1,"dateCode":""}},"lightingColorCtrl":{"attributes":{"colorCapabilities":25,"colorTempPhysicalMin":153,"colorTempPhysicalMax":500,"colorMode":2,"currentX":8880,"currentY":2615,"colorTemperature":168,"currentHue":170,"currentSaturation":254}},"genOnOff":{"attributes":{"onOff":0}},"genLevelCtrl":{"attributes":{"currentLevel":39}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":101,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":332242049},"lastSeen":1719886887988}

@Koenkk
Copy link
Owner

Koenkk commented Jul 2, 2024

Fixed!

Changes will be available in the dev branch in a few hours from now.

@wraeuk
Copy link
Author

wraeuk commented Jul 3, 2024

This has solved the visual but it hasn't solved the quirks with being on the wrong device type (sorry if this is confusing things).

The "correct" device has working brightness adjustment in color_xy whereas the others do not, and the db entry is still fairly different

not working

{"id":10,"type":"Router","ieeeAddr":"0xa4c1387c2a278a83","nwkAddr":47559,"manufId":4107,"manufName":"_TZ3210_jjqdqxfq","powerSource":"Mains (single phase)","modelId":"TS0505B","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":269,"inClusterList":[0,3,6280,4,5,6,8,768,10,4096,65518],"outClusterList":[25,4096,65518],"clusters":{"genBasic":{"attributes":{"hwVersion":0}},"lightingColorCtrl":{"attributes":{"colorCapabilities":8,"colorTempPhysicalMin":143,"colorTempPhysicalMax":500}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":112,"stackVersion":2,"hwVersion":0,"swBuildId":"z.1.0","zclVersion":3,"interviewCompleted":true,"meta":{"configured":332242049},"lastSeen":1719962059231}

working

{"id":11,"type":"Router","ieeeAddr":"0xa4c1386bac72e5b4","nwkAddr":22013,"manufId":4417,"manufName":"_TZ3210_s9lumfhn","powerSource":"Mains (single phase)","modelId":"TS0505B","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":269,"inClusterList":[3,4,5,6,4096,8,768,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"TS0505B","manufacturerName":"_TZ3210_s9lumfhn","powerSource":1,"zclVersion":3,"appVersion":101,"stackVersion":0,"hwVersion":1,"dateCode":""}},"lightingColorCtrl":{"attributes":{"colorCapabilities":25,"colorTempPhysicalMin":153,"colorTempPhysicalMax":500,"colorMode":2,"currentX":8880,"currentY":2615,"colorTemperature":168,"currentHue":170,"currentSaturation":254}},"genOnOff":{"attributes":{"onOff":0}},"genLevelCtrl":{"attributes":{"currentLevel":39}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":101,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":332242049},"lastSeen":1719961021405}

Is this just as simple as "that's a physically different device" and I need to work out the appropriate quirk on the other lights or has a converter not applied how I thought it would (or.. both)?

@Koenkk
Copy link
Owner

Koenkk commented Jul 3, 2024

The "correct" device has working brightness adjustment in color_xy whereas the others do not

I don't understand fully, can you explain in more detail what the issue is?

@wraeuk
Copy link
Author

wraeuk commented Jul 3, 2024

Yep, sorry.

The devices in question are physically identical.
The device with "manufName":"_TZ3210_s9lumfhn" is working as expected
The device with "manufName":"_TZ3210_jjqdqxfq" mostly works except when changing to color_xy, where the brightness adjustment doesn't do anything (stays at 100%, or goes to off at 0%). Brightness adjustment works fine when using color_temp.

I logged a new device support issue for this ages ago and never got around to looking at it harder (it aged out) #17570 which has some info from a tuya gateway if that helps make sense of it.

If this helps, the generated external converters for each

_TZ3210_s9lumfhn
const {identify, light} = require('zigbee-herdsman-converters/lib/modernExtend');

const definition = {
zigbeeModel: ['TS0505B'],
model: 'TS0505B',
vendor: '_TZ3210_s9lumfhn',
description: 'Automatically generated definition',
extend: [identify(), light({"colorTemp":{"range":[153,500]},"color":{"modes":["xy","hs"]}})],
meta: {},
};

module.exports = definition;

_TZ3210_jjqdqxfq
const {identify} = require('zigbee-herdsman-converters/lib/modernExtend');
const {philipsLight} = require('zigbee-herdsman-converters/lib/philips');

const definition = {
zigbeeModel: ['TS0505B'],
model: 'TS0505B',
vendor: '_TZ3210_jjqdqxfq',
description: 'Automatically generated definition',
extend: [identify(), philipsLight({"color":true})],
meta: {},
};

module.exports = definition;

@Koenkk
Copy link
Owner

Koenkk commented Jul 4, 2024

with the tuya gateway, did the brightness change when color_xy was used?

@wraeuk
Copy link
Author

wraeuk commented Jul 5, 2024

Yep, sure did.
Should I open another ticket for this?

I'll rip one of these off my z2m network and put it back on the tuya gateway for further testing.

More data for dp5 "colorful"
Red 100% - 000003e803e8
Green 100% - 007803e803e8
Blue 100% - 00f003e803e8
Blue 50% - 00f003e801f6
Blue 1% - 00f003e8000a
Dragging saturation down to zero (color would have changed a bit because of the UI) - 00e40000000a

It seems to want DP5 in the format of
[4 characters of hex between dec 0-6000(ish) for color][4 characters of hex between dec 0-1000 for saturation][4 characters of hex between dec 0-1000 for brightness]

@Koenkk
Copy link
Owner

Koenkk commented Jul 6, 2024

From what I understand:

  • _TZ3210_s9lumfhn -> uses standard commands
  • _TZ3210_jjqdqxfq -> is controlled through datapoints?

@wraeuk
Copy link
Author

wraeuk commented Jul 7, 2024

That does seem to be the case. Here's a full listing of the datapoints from the tuya portal if that helps any

{
"1": "ON/OFF",
"2": "Mode",
"209": "Cycle Timing",
"210": "Vacation Timing",
"3": "Brightness",
"30": "Rhythms",
"31": "Light to sleep",
"32": "Light to wake",
"33": "Power Off Memory",
"34": "Do not Disturb",
"35": "ON/OFF Gradient",
"4": "Color Temp",
"5": "Colorful",
"6": "Scene",
"7": "Timer",
"8": "Music",
"81": "zigbee light link threshold",
"9": "Adjust"
}

The "Brightness" data point does not change when adjusting brightness when using the "Color" mode (dp2)
When set to the "white" mode (dp2) the Color Temp (dp4) and Brightness (dp3) points work, and are values from 0-1000

I'm not sure if this is standard, as I haven't looked at _TZ3210_s9lumfhn on the tuya gateway, but I can if that would help.

@Koenkk
Copy link
Owner

Koenkk commented Jul 8, 2024

Can you try to write a simple external converter using datapoints with e.g. just the state? You can find an example here: https://github.com/Koenkk/zigbee-herdsman-converters/blob/1fe26bb1ed52f10ab7c7a7b219d500476f852958/src/devices/tuya.ts#L2001

@eerison
Copy link

eerison commented Aug 23, 2024

@Koenkk

I saw that you fixed some wrong model detection changing this "magical number/reference", how do I know what is the correct one for my device? I am stuck on this 🥲🥲.

Note: I'm almost 1 month trying to fix it 🫠🫠
#22813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants