-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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]: RTX QS-Zigbee-D02-TRIAC-LN -- Model TS110E -- Manufacturer Name _TZ3210_ngqk6jia #11853
Comments
Instead of |
ts110e_brightness: {
key: ['brightness'],
convertSet: async (entity, key, value, meta) => {
const minBrightness = meta.state.hasOwnProperty("brightness_min")
? meta.state.brightness_min
: 0;
const maxBrightness = meta.state.hasOwnProperty("brightness_max")
? meta.state.brightness_max
: 1000;
const level = utils.mapNumberRange(
value,
0,
255,
minBrightness,
maxBrightness
);
const payload1 = {level, transtime: 0}
await entity.command('genOnOff', 1, {}, utils.getOptions(meta.mapped, entity));
await utils.sleep(1000)
await entity.command('genLevelCtrl', 'moveToLevelTuya', payload1, utils.getOptions(meta.mapped, entity));
},
convertGet: async (entity, key, meta) => {
await entity.read('genLevelCtrl', [61440]);
},
},
};``` |
cool, can you make a pull request so this device can be supported out-of-the-box? |
I will try to find out what goes where for the pull request. Apart from that I have the problem that the device reports 0 brightness when reading the brightness even though it is not zero: debug 2022-03-16 10:12:26: Received MQTT message on 'zigbee2mqtt/LichtEGFlur/set' with data '{"brightness":119}'
debug 2022-03-16 10:12:26: Publishing 'set' 'brightness' to 'LichtEGFlur'
debug 2022-03-16 10:12:26: TS110E: TZ-Brightness level changed to: 533
debug 2022-03-16 10:12:26: Received Zigbee message from 'LichtEGFlur', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info 2022-03-16 10:12:26: MQTT publish: topic 'zigbee2mqtt/LichtEGFlur', payload '{"brightness":-153,"brightness_max":800,"brightness_min":300,"led_type":"led","linkquality":72,"power_on_behavior":"previous","state":"ON"}'
debug 2022-03-16 10:12:26: Received Zigbee message from 'LichtEGFlur', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":533}' from endpoint 1 with groupID 0
debug 2022-03-16 10:12:26: TS110E: FZ-Brightness level changed to: 119
info 2022-03-16 10:12:26: MQTT publish: topic 'zigbee2mqtt/LichtEGFlur', payload '{"brightness":119,"brightness_max":800,"brightness_min":300,"led_type":"led","linkquality":72,"power_on_behavior":"previous","state":"ON"}'
debug 2022-03-16 10:12:27: Received Zigbee message from 'LichtEGFlur', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":529}' from endpoint 1 with groupID 0
debug 2022-03-16 10:12:27: TS110E: FZ-Brightness level changed to: 117
info 2022-03-16 10:12:27: MQTT publish: topic 'zigbee2mqtt/LichtEGFlur', payload '{"brightness":117,"brightness_max":800,"brightness_min":300,"led_type":"led","linkquality":72,"power_on_behavior":"previous","state":"ON"}'
debug 2022-03-16 10:12:32: Received Zigbee message from 'LichtEGFlur', type 'read', cluster 'genTime', data '["localTime"]' from endpoint 1 with groupID 0 reading brightness debug 2022-03-16 10:14:16: Received MQTT message on 'zigbee2mqtt/LichtEGFlur/get' with data '{"brightness":""}'
debug 2022-03-16 10:14:16: Publishing get 'get' 'brightness' to 'LichtEGFlur'
debug 2022-03-16 10:14:16: Received Zigbee message from 'LichtEGFlur', type 'readResponse', cluster 'genLevelCtrl', data '{"61440":0}' from endpoint 1 with groupID 0
debug 2022-03-16 10:14:16: TS110E: FZ-Brightness level changed to: -153
info 2022-03-16 10:14:16: MQTT publish: topic 'zigbee2mqtt/LichtEGFlur', payload '{"brightness":-153,"brightness_max":800,"brightness_min":300,"led_type":"led","linkquality":65,"power_on_behavior":"previous","state":"ON"}' Is it possible to request the brightness in a different way? |
Could you try replacing |
currentLevel is always 3 debug 2022-03-18 20:32:16: Received MQTT message on 'zigbee2mqtt/LichtWohnzimmer/get' with data '{"brightness":""}'
debug 2022-03-18 20:32:16: Publishing get 'get' 'brightness' to 'LichtWohnzimmer'
debug 2022-03-18 20:32:16: Received Zigbee message from 'LichtWohnzimmer', type 'readResponse', cluster 'genLevelCtrl', data '{"currentLevel":3}' from endpoint 1 with groupID 0 |
Seems the device doesn't properly support this, this is not unexpected since none of the TuYa devices support this. |
OK. can that read be removed then? |
Yes, just remove
|
As that leads to error No converter available for 'get' 'brightness' () I'll just remove |
Replacing |
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 |
That works, thanks. |
Hi @DesertF0x ,
Thank's |
Here you go: const fz = require("zigbee-herdsman-converters/converters/fromZigbee");
const tz = require("zigbee-herdsman-converters/converters/toZigbee");
const exposes = require("zigbee-herdsman-converters/lib/exposes");
const reporting = require("zigbee-herdsman-converters/lib/reporting");
const extend = require("zigbee-herdsman-converters/lib/extend");
const e = exposes.presets;
const ea = exposes.access;
const utils = require("zigbee-herdsman-converters/lib/utils");
const tuya = require("zigbee-herdsman-converters/lib/tuya");
const DataType = {
uint8: 0x20,
uint16: 0x21,
};
const fzLocal = {
ts110e_brightness: {
cluster: "genLevelCtrl",
type: ["attributeReport", "readResponse"],
convert: (model, msg, publish, options, meta) => {
if (msg.data.hasOwnProperty("61440")) {
let minBrightness = meta.state.hasOwnProperty("brightness_min")
? meta.state.brightness_min
: 0;
let maxBrightness = meta.state.hasOwnProperty("brightness_max")
? meta.state.brightness_max
: 1000;
let brightness = msg.data["61440"] > maxBrightness ? maxBrightness : msg.data["61440"];
brightness = brightness < minBrightness ? minBrightness : brightness;
let level = utils.mapNumberRange(
brightness,
minBrightness,
maxBrightness,
0,
255
);
meta.logger.debug(`TS110E: FZ-Brightness level changed to: ${level}`);
return { brightness: level };
}
},
},
brightness_min: {
cluster: "genLevelCtrl",
type: ["attributeReport", "readResponse"],
convert: (model, msg, publish, options, meta) => {
if (msg.data.hasOwnProperty("64515")) {
return { brightness_min: msg.data["64515"] };
}
},
},
brightness_max: {
cluster: "genLevelCtrl",
type: ["attributeReport", "readResponse"],
convert: (model, msg, publish, options, meta) => {
if (msg.data.hasOwnProperty("64516")) {
return { brightness_max: msg.data["64516"] };
}
},
},
led_type: {
cluster: "genLevelCtrl",
type: ["attributeReport", "readResponse"],
convert: (model, msg, publish, options, meta) => {
const lookup1 = { 0: "led", 1: "incandescent", 2: "halogen" };
if (msg.data.hasOwnProperty("64514")) {
const property = utils.postfixWithEndpointName("led_type", msg, model);
return { [property]: lookup1[msg.data["64514"]] };
}
},
},
};
const tzLocal = {
light_onoff_brightness: {
key: ["brightness"],
options: [exposes.options.transition()],
convertSet: async (entity, key, value, meta) => {
const minBrightness = meta.state.hasOwnProperty("brightness_min")
? meta.state.brightness_min
: 0;
const maxBrightness = meta.state.hasOwnProperty("brightness_max")
? meta.state.brightness_max
: 1000;
const level = utils.mapNumberRange(value, 0, 255, minBrightness, maxBrightness);
meta.logger.debug(`TS110E: TZ-Brightness level changed to: ${level}`);
const switchState = value > 0 ? "ON" : "OFF";
// await tz.on_off.convertSet(entity, "state", switchState, meta);
await entity.command(
"genOnOff",
1,
{},
utils.getOptions(meta.mapped, entity)
);
await utils.sleep(1); // To-Think: why is this needed?
await entity.command(
"genLevelCtrl",
"moveToLevelTuya",
{ level, transtime: 100 },
utils.getOptions(meta.mapped, entity)
);
},
convertGet: async (entity, key, meta) => {
if (key === "state") {
await tz.on_off.convertGet(entity, key, meta);
}
},
},
ts110e_brightness_min: {
key: ["brightness_min"],
convertSet: async (entity, key, value, meta) => {
let payload = { 64515: { value: value, type: DataType.uint16 } };
await entity.write(
"genLevelCtrl",
payload,
utils.getOptions(meta.mapped, entity)
);
},
convertGet: async (entity, key, meta) => {
await entity.read("genLevelCtrl", [64515]);
},
},
ts110e_brightness_max: {
key: ["brightness_max"],
convertSet: async (entity, key, value, meta) => {
let payload = { 64516: { value: value, type: DataType.uint16 } };
await entity.write(
"genLevelCtrl",
payload,
utils.getOptions(meta.mapped, entity)
);
},
convertGet: async (entity, key, meta) => {
await entity.read("genLevelCtrl", [64516]);
},
},
ts110e_led_type: {
key: ["led_type"],
convertSet: async (entity, key, value, meta) => {
value = value.toLowerCase();
const lookup1 = { led: 0, incandescent: 1, halogen: 2 };
newValue = parseInt(lookup1[value]);
payload = { 64514: { value: newValue, type: DataType.uint8 } };
await entity.write(
"genLevelCtrl",
payload,
utils.getOptions(meta.mapped, entity)
);
},
convertGet: async (entity, key, meta) => {
await entity.read("genLevelCtrl", [64514]);
},
},
};
const definition = {
fingerprint: [
{
// The model ID from: Device with modelID 'TS0601' is not supported
// You may need to add \u0000 at the end of the name in some cases
modelID: 'TS110E',
// The manufacturer name from: Device with modelID 'TS0601' is not supported.
manufacturerName: '_TZ3210_ngqk6jia'
},
],
model: 'QS-Zigbee-D02-TRIAC-LN', // Vendor model number, look on the device for a model number
vendor: 'RTX', // Vendor of the device (only used for documentation and startup logging)
description: 'RTX One Channel Dimmer', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
fromZigbee: [
fz.on_off,
fz.moes_power_on_behavior,
fzLocal.ts110e_brightness,
fzLocal.brightness_min,
fzLocal.brightness_max,
fzLocal.led_type,
],
toZigbee: [
tz.on_off,
tz.moes_power_on_behavior,
tzLocal.light_onoff_brightness,
tzLocal.ts110e_brightness_min,
tzLocal.ts110e_brightness_max,
tzLocal.ts110e_led_type,
],
exposes: [
e.light_brightness().setAccess('brightness', ea.STATE_SET),
exposes.numeric("brightness_min", ea.ALL),
exposes.numeric("brightness_max", ea.ALL),
exposes
.enum("led_type", ea.ALL, ["led", "incandescent", "halogen"])
.withDescription("Controls the type led"),
exposes
.enum("power_on_behavior", ea.ALL, ["off", "previous", "on"])
.withDescription("Controls the behaviour when the device is powered on"),
],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await extend
.light_onoff_brightness()
.configure(device, coordinatorEndpoint, logger);
await reporting.bind(endpoint, coordinatorEndpoint, [
"genOnOff",
"genLevelCtrl",
]);
await reporting.onOff(endpoint);
},
};
module.exports = definition; |
Thank's @DesertF0x Good job, |
@DesertF0x Do you know what the 0xfc02 (64514) attribute correspond to? |
I have checked and brightness_min and _max work. |
Do we need to send genOnOff and genLevelControl? I am getting three answers... |
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 |
I really hope that the work on this device will be completed, it will be useful |
I have a two gang version of QS-Zigbee-D02-TRIAC-LN. I used the above external convertor and it works with Switch1. What changes need to be made to support switch 2? |
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 |
Hello! I have the same device and the same brightness control problem. Will this fix ever by merged? if now, how I can I implement it in my system? |
I have simular device with manufacturer name _TZ3210_weaqkhab. This converter works with it with exception to bulb type setting and power on behavour. |
I have external_converters:
- TS100E.js and created file in |
The device is working, there are some minor issues but it is usable. I am using several of these devices every day. I do not know how to include and push the change and I don't have enough time to get into this and figure out right now... Sorry.
13.11.2022 13:18:14 Łukasz Chojnicki ***@***.***>:
… @Koenkk[https://github.com/Koenkk] if main funcionality does not work, I think this issue should be reopened? #12763[#12763] as well I want to but and try this dimmer, but not when everyone is telling that it does not work correctly :/
—
Reply to this email directly, view it on GitHub[#11853 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAIV2EYTWUTV7GSADMLKFR3WIDMALANCNFSM5QYH4ZSA].
You are receiving this because you were mentioned.[Verfolgungsbild][https://github.com/notifications/beacon/AAIV2EYFCXLL42IUDGSDMSLWIDMALA5CNFSM5QYH4ZSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJY7HR6Q.gif]
|
@DesertF0x I've refactored your converter a bit, Can you check if everything works fine with the following external converter? https://gist.github.com/Koenkk/77aaef4845c1291f3777a1722f9a9eda If yes, then I can integrate it for out-of-the-box support.
external_converters:
- ext_converter.js
|
@Koenkk I bought and tested this converter. Setting brightness works, as well as all other settings, cool. But I found one issue for now. State (on/off) is not updated in dashboard after manually clicking on dimmer switch, even after clicking refresh button in that setting. Brightness works. Edit: Not that I tested only 1 gang version.
|
Updated https://gist.github.com/Koenkk/77aaef4845c1291f3777a1722f9a9eda
Added the brightness_move converter but not sure if it works, let me know, also added the |
@Koenkk No success with any of it. State update works now. Anything can be done with |
Do you have the most recent version of ZigBee2Mqtt? I had to update to make the converter work.... .
17.11.2022 20:19:40 Łukasz Chojnicki ***@***.***>:
… Added the brightness_move converter but not sure if it works, let me know, also added the *transition*.
@Koenkk[https://github.com/Koenkk] No success with any of it
—
Reply to this email directly, view it on GitHub[#11853 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAIV2EZBGHN3ZTB3JCK64HLWI2AMXANCNFSM5QYH4ZSA].
You are receiving this because you were mentioned.[Verfolgungsbild][https://github.com/notifications/beacon/AAIV2E3627BCRV5AIAZD5JDWI2AMXA5CNFSM5QYH4ZSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJ2P4C6I.gif]
|
Converter works, I'm testing latest changes with move/transitions functionality like described in last messages. But yes, I do. |
Ah, sorry, got it wrong in the emails. I can confirm that the on off state is not updated in the first version. Did not have time yet to test the second.
17.11.2022 20:23:04 Łukasz Chojnicki ***@***.***>:
… Do you have the most recent version of ZigBee2Mqtt? I had to update to make the converter work.... . 17.11.2022 20:19:40 Łukasz Chojnicki /*@*/.***>:
…[#]
Added the brightness_move converter but not sure if it works, let me know, also added the /transition/. @Koenkk[https://github.com/Koenkk][https://github.com/Koenkk] No success with any of it — Reply to this email directly, view it on GitHub[#11853 (comment)[#11853 (comment)]], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAIV2EZBGHN3ZTB3JCK64HLWI2AMXANCNFSM5QYH4ZSA]. You are receiving this because you were mentioned.[Verfolgungsbild][https://github.com/notifications/beacon/AAIV2E3627BCRV5AIAZD5JDWI2AMXA5CNFSM5QYH4ZSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJ2P4C6I.gif]
Converter works, I'm testing latest changes with move/transitions functionality like described in last messages.
—
Reply to this email directly, view it on GitHub[#11853 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAIV2E4PLZCVAH3RX5YRVG3WI2AZPANCNFSM5QYH4ZSA].
You are receiving this because you were mentioned.[Verfolgungsbild][https://github.com/notifications/beacon/AAIV2E65SF3BRBSB6OFOIDTWI2AZPA5CNFSM5QYH4ZSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJ2P5AGI.gif]
|
Hi @Koenkk , your latest converter seems to be working fine except two minor things:
On/off state now gets updated and brightness_move is working. |
@marthubner great!
|
@Koenkk I already tried before changing tanstime to hardcoded value but this does not give any effects. Same with payload like I said in previous messages. I can also confirm issue with brightness values jumping always -1 after changing it. Cannot provide logs tho, because I already returned device to seller since transition was all I was hoping for. |
@Koenkk This is the log of events when I set brightness to 200 and end up having 199:
I will try this later in the evening. |
I tried and transition really is not working as @chojnicki already said. |
I see, removed that now. Regarding the small brightness jump, this is because the device publishes this. On a scale from 0-100:
I've integrated it now! Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) |
Is it normal that the device is always sending two messages?
|
Not normal, but this is what the device does ( |
Anybody got transition to work on TS110E varients? |
Link
https://www.ebay.de/itm/333784732285
Database entry
{"id":2,"type":"Router","ieeeAddr":"0xa4c1380a718757a2","nwkAddr":5229,"manufId":4417,"manufName":"_TZ3210_ngqk6jia","powerSource":"Mains (single phase)","modelId":"TS110E","epList":[1,242],"endpoints">
Comments
I tried to get this in wall dimmer module running:

I managed to switch it on/off and read the brightness like this but I can not set the brightness:
Log Output:
I have tried with tuya debug converter but that did not generate output.
How can I write to 61440 instead of brightness/level? I think this might be worth a try.
External converter
Supported color modes
No response
Color temperature range
No response
The text was updated successfully, but these errors were encountered: