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

[New device support]: RTX QS-Zigbee-D02-TRIAC-LN -- Model TS110E -- Manufacturer Name _TZ3210_ngqk6jia #11853

Closed
DesertF0x opened this issue Mar 15, 2022 · 44 comments
Labels
new device support New device support request stale Stale issues

Comments

@DesertF0x
Copy link

DesertF0x commented Mar 15, 2022

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:
image

I managed to switch it on/off and read the brightness like this but I can not set the brightness:

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 tuya = require("zigbee-herdsman-converters/lib/tuya");
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');

const {
    precisionRound, mapNumberRange, isLegacyEnabled, toLocalISOString, numberWithinRange, hasAlreadyProcessedMessage,
    calibrateAndPrecisionRoundOptions, addActionGroup, postfixWithEndpointName, getKey,
    batteryVoltageToPercentage, getMetaValue,
} = require('zigbee-herdsman-converters/lib/utils');

const fzLocal = {
    brightness: {
        cluster: 'genLevelCtrl',
        type: ['attributeReport', 'readResponse'],
        convert: (model, msg, publish, options, meta) => {
            if (msg.data.hasOwnProperty('61440')) {
                const property = postfixWithEndpointName('brightness', msg, model);
                return {[property]: msg.data['61440']};
            }
        },
    },
}

const definition = {
    // Since a lot of Tuya devices use the same modelID, but use different data points
    // it's usually necessary to provide a fingerprint instead of a zigbeeModel
    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, fzLocal.brightness], // We will add this later
    toZigbee: [tz.on_off, tz.light_onoff_brightness], // Should be empty, unless device can be controlled (e.g. lights, switches).
//    fromZigbee: [
      //  fz.ignore_basic_report, // Add this if you are getting no converter for 'genBasic'
//        fz.tuya_data_point_dump, // This is a debug converter, it will be described in the next part
//    ],
//    toZigbee: [
//        tz.tuya_data_point_test, // Another debug converter
//    ],
//    configure: async (device, coordinatorEndpoint, logger) => {
 //       const endpoint = device.getEndpoint(1);
  //      await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']);
   // },
    exposes: [e.linkquality(),e.light_brightness()], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
};

module.exports = definition;

Log Output:

debug 2022-03-15 11:13:34: Received Zigbee message from 'LichtWohnzimmer', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2022-03-15 11:13:34: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"linkquality":142,"state":"ON"}'
debug 2022-03-15 11:13:37: Received Zigbee message from 'LichtWohnzimmer', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":369}' from endpoint 1 with groupID 0
info  2022-03-15 11:13:37: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":369,"linkquality":142,"state":"ON"}'
debug 2022-03-15 11:13:37: Received Zigbee message from 'LichtWohnzimmer', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":431}' from endpoint 1 with groupID 0
info  2022-03-15 11:13:37: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":431,"linkquality":138,"state":"ON"}'
debug 2022-03-15 11:13:38: Received Zigbee message from 'LichtWohnzimmer', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":494}' from endpoint 1 with groupID 0
info  2022-03-15 11:13:38: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":494,"linkquality":145,"state":"ON"}'
debug 2022-03-15 11:13:38: Received Zigbee message from 'LichtWohnzimmer', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":557}' from endpoint 1 with groupID 0
info  2022-03-15 11:13:38: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":557,"linkquality":145,"state":"ON"}'
debug 2022-03-15 11:13:38: Received Zigbee message from 'LichtWohnzimmer', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":588}' from endpoint 1 with groupID 0
info  2022-03-15 11:13:38: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":588,"linkquality":138,"state":"ON"}'
debug 2022-03-15 11:13:40: Received Zigbee message from 'LichtWohnzimmer', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
info  2022-03-15 11:13:40: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":588,"linkquality":127,"state":"OFF"}'
debug 2022-03-15 11:14:31: Received MQTT message on 'zigbee2mqtt/LichtWohnzimmer/set' with data '{"state":"ON"}'
debug 2022-03-15 11:14:31: Publishing 'set' 'state' to 'LichtWohnzimmer'
debug 2022-03-15 11:14:31: Received Zigbee message from 'LichtWohnzimmer', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2022-03-15 11:14:31: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":588,"linkquality":142,"state":"ON"}'
info  2022-03-15 11:14:31: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":588,"linkquality":142,"state":"ON"}'
debug 2022-03-15 11:14:37: Received MQTT message on 'zigbee2mqtt/LichtWohnzimmer/set' with data '{"brightness":229}'
debug 2022-03-15 11:14:37: Publishing 'set' 'brightness' to 'LichtWohnzimmer'
info  2022-03-15 11:14:37: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":229,"linkquality":142,"state":"ON"}'
debug 2022-03-15 11:14:53: Received MQTT message on 'zigbee2mqtt/LichtWohnzimmer/get' with data '{"state":""}'
debug 2022-03-15 11:14:53: Publishing get 'get' 'state' to 'LichtWohnzimmer'
debug 2022-03-15 11:14:54: Received Zigbee message from 'LichtWohnzimmer', type 'readResponse', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2022-03-15 11:14:54: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":229,"linkquality":134,"state":"ON"}'
debug 2022-03-15 11:14:58: Received MQTT message on 'zigbee2mqtt/LichtWohnzimmer/get' with data '{"brightness":""}'
debug 2022-03-15 11:14:58: Publishing get 'get' 'brightness' to 'LichtWohnzimmer'
debug 2022-03-15 11:14:58: Received Zigbee message from 'LichtWohnzimmer', type 'readResponse', cluster 'genLevelCtrl', data '{"currentLevel":3}' from endpoint 1 with groupID 0
debug 2022-03-15 11:15:03: Received MQTT message on 'zigbee2mqtt/LichtWohnzimmer/get' with data '{"state":""}'
debug 2022-03-15 11:15:03: Publishing get 'get' 'state' to 'LichtWohnzimmer'
debug 2022-03-15 11:15:03: Received Zigbee message from 'LichtWohnzimmer', type 'readResponse', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2022-03-15 11:15:03: MQTT publish: topic 'zigbee2mqtt/LichtWohnzimmer', payload '{"brightness":229,"linkquality":142,"state":"ON"}'
debug 2022-03-15 11:15:06: Received MQTT message on 'zigbee2mqtt/LichtWohnzimmer/set' with data '{"brightness":75}'

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

const fzLocal = {
    brightness: {
        cluster: 'genLevelCtrl',
        type: ['attributeReport', 'readResponse'],
        convert: (model, msg, publish, options, meta) => {
            if (msg.data.hasOwnProperty('61440')) {
                const property = postfixWithEndpointName('brightness', msg, model);
                return {[property]: msg.data['61440']};
            }
        },
    },
}

Supported color modes

No response

Color temperature range

No response

@DesertF0x DesertF0x added the new device support New device support request label Mar 15, 2022
@Koenkk
Copy link
Owner

Koenkk commented Mar 15, 2022

Instead of tz.light_onoff_brightness, can you try if setting the brightness works when using: tz.tuya_dimmer_level?

@DesertF0x
Copy link
Author

tz.tuya_dimmer_level does not work.
This from #9878 works, I took mapNumberRange from one of the answers and added it.

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]);
     },
   },
};```

@Koenkk
Copy link
Owner

Koenkk commented Mar 16, 2022

cool, can you make a pull request so this device can be supported out-of-the-box?

@DesertF0x
Copy link
Author

DesertF0x commented Mar 18, 2022

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:
setting brightness

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?

@Koenkk
Copy link
Owner

Koenkk commented Mar 18, 2022

Could you try replacing await entity.read('genLevelCtrl', [61440]); with await entity.read('genLevelCtrl', ['currentLevel']); ?

@DesertF0x
Copy link
Author

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

@Koenkk
Copy link
Owner

Koenkk commented Mar 19, 2022

Seems the device doesn't properly support this, this is not unexpected since none of the TuYa devices support this.

@DesertF0x
Copy link
Author

OK. can that read be removed then?

@Koenkk
Copy link
Owner

Koenkk commented Mar 20, 2022

Yes, just remove

     convertGet: async (entity, key, meta) => {
            await entity.read('genLevelCtrl', [61440]);
     },

@DesertF0x
Copy link
Author

As that leads to

error No converter available for 'get' 'brightness' ()

I'll just remove await entity.read('genLevelCtrl', [61440]); to avoid error messages.

@Koenkk
Copy link
Owner

Koenkk commented Mar 21, 2022

Replacing exposes: [e.linkquality(),e.light_brightness()], with exposes: [e.linkquality(),e.light_brightness().setAccess('brightness', ea.STATE_SET)], should fix that

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale Stale issues label Apr 21, 2022
@DesertF0x
Copy link
Author

That works, thanks.
Can you point me to an example pull request I can follow to find the right files/places easier?

@ThierryBourbon
Copy link

ThierryBourbon commented Apr 22, 2022

Hi @DesertF0x ,
Can you post the final converter. I have a similar module (QS-Zigbee-D02-TRIAC-L whitout neutral)

manufacturerName: '_TZ3210_weaqkhab'

Thank's

@DesertF0x
Copy link
Author

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;

@ThierryBourbon
Copy link

Thank's @DesertF0x Good job,
Works fine, simply changing manufacturerName.
(model without neutral don' t support led_type nor power_on_behavior) (Verified by Zboss-Wireshark)

QS-Zigbee-D002-TRIAC-L.zip

@github-actions github-actions bot removed the stale Stale issues label Apr 23, 2022
@ThierryBourbon
Copy link

ThierryBourbon commented Apr 25, 2022

@DesertF0x
Do you have the same problem ?
I can write the attributes brightness_min 64515 and brightness_max 64516 and there are acked
(ZCL : Write attribute - ZCL : Write attribute response)
but this has no effect on operation.
EDIT: Found the problem. Values of brightness min and max are in the range 0 -1000

Do you know what the 0xfc02 (64514) attribute correspond to?

@DesertF0x
Copy link
Author

I have checked and brightness_min and _max work.
I do not know what 64514 (LED_Type) does...

@DesertF0x
Copy link
Author

Do we need to send genOnOff and genLevelControl? I am getting three answers...

@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2022

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

@github-actions github-actions bot added the stale Stale issues label Jun 1, 2022
@Tozapid
Copy link

Tozapid commented Jun 1, 2022

I really hope that the work on this device will be completed, it will be useful

@github-actions github-actions bot removed the stale Stale issues label Jun 2, 2022
@rajil
Copy link

rajil commented Jun 9, 2022

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?

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the stale Stale issues label Jul 10, 2022
@vascozorrinho
Copy link

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?

@mkile
Copy link

mkile commented Sep 5, 2022

I have simular device with manufacturer name _TZ3210_weaqkhab. This converter works with it with exception to bulb type setting and power on behavour.

@gejgalis
Copy link

gejgalis commented Oct 2, 2022

I have _TZ3210_pagajpog and I also can't read/write the brightness.
Anyone knows how can I configure external_converters in HomeAssistant on Rasberry Pi4 ?
I'm trying to set:

external_converters:
  - TS100E.js

and created file in /config/zigbee2mqtt/TS100E.js then restarted few times the add-on but this file is never picked up :(

@chojnicki
Copy link

@Koenkk if main funcionality does not work, I think this issue should be reopened? #12763 as well I want to but and try this dimmer, but not when everyone is telling that it does not work correctly :/

@DesertF0x
Copy link
Author

DesertF0x commented Nov 14, 2022 via email

@Koenkk
Copy link
Owner

Koenkk commented Nov 14, 2022

@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.

  • save this as file next to configuration.yaml as ext_converter.js
  • add it to configuration.yaml:
external_converters:
  - ext_converter.js
  • start z2m, check if device works

@chojnicki
Copy link

chojnicki commented Nov 17, 2022

@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.
Edit2: Also this is another Tuya dimmer where brightness_move or setting brightness with transition does not work. Related to #14817 but this time I'm getting errors in log, so it looks like it is not coded in converter. Maybe this device supports it and could be added?

No converter available for 'brightness_move' (20)
No converter available for 'transition' (10)

@Koenkk
Copy link
Owner

Koenkk commented Nov 17, 2022

@chojnicki

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.

Updated https://gist.github.com/Koenkk/77aaef4845c1291f3777a1722f9a9eda

Also this is another Tuya dimmer where brightness_move

Added the brightness_move converter but not sure if it works, let me know, also added the transition.

@chojnicki
Copy link

chojnicki commented Nov 17, 2022

Added the brightness_move converter but not sure if it works, let me know, also added the transition.

@Koenkk No success with any of it. State update works now. Anything can be done with brightness_move?

@DesertF0x
Copy link
Author

DesertF0x commented Nov 17, 2022 via email

@chojnicki
Copy link

chojnicki commented Nov 17, 2022

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 @.***>:

Converter works, I'm testing latest changes with move/transitions functionality like described in last messages. But yes, I do.

@DesertF0x
Copy link
Author

DesertF0x commented Nov 18, 2022 via email

@marthubner
Copy link

@chojnicki

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.

Updated https://gist.github.com/Koenkk/77aaef4845c1291f3777a1722f9a9eda

Also this is another Tuya dimmer where brightness_move

Added the brightness_move converter but not sure if it works, let me know, also added the transition.

Hi @Koenkk , your latest converter seems to be working fine except two minor things:

  1. Transition doesn´t seem to be doing anything
  2. When brightness higher than 133 is set it always drops down by one number. Eg when I set 255 it drops to 254, when I set 254 I get 253 etc. Probably some rounding issue. I donť know if it is even a problem...

On/off state now gets updated and brightness_move is working.

@Koenkk
Copy link
Owner

Koenkk commented Nov 24, 2022

@marthubner great!

  1. can you try changing await entity.command("genLevelCtrl", "moveToLevelTuya", {level, transtime: transition.time}, utils.getOptions(meta.mapped, entity)); to await entity.command("genLevelCtrl", "moveToLevelTuya", {level, transtime: 5000}, utils.getOptions(meta.mapped, entity)); and see if the tranistion is 5 seconds now? If this doesn't work, it seems this device does not support transitions.
  2. Can you provide the debug log of this?
    See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable debug logging.

@chojnicki
Copy link

chojnicki commented Nov 24, 2022

@marthubner great!

  1. can you try changing await entity.command("genLevelCtrl", "moveToLevelTuya", {level, transtime: transition.time}, utils.getOptions(meta.mapped, entity)); to await entity.command("genLevelCtrl", "moveToLevelTuya", {level, transtime: 5000}, utils.getOptions(meta.mapped, entity)); and see if the tranistion is 5 seconds now? If this doesn't work, it seems this device does not support transitions.
  2. Can you provide the debug log of this?
    See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable debug logging.

@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.

@marthubner
Copy link

  1. Can you provide the debug log of this?
    See https://www.zigbee2mqtt.io/guide/usage/debug.html on how to enable debug logging.

@Koenkk This is the log of events when I set brightness to 200 and end up having 199:

debug 2022-11-24 16:45:52: Received MQTT message on 'zigbee2mqtt/Loznice/set' with data '{"brightness":200}'
debug 2022-11-24 16:45:52: Publishing 'set' 'brightness' to 'Loznice'
info 2022-11-24 16:45:52: MQTT publish: topic 'zigbee2mqtt/Loznice', payload '{"brightness":239,"last_seen":"2022-11-24T16:45:52+01:00","led_type":"led","linkquality":117,"max_brightness":255,"min_brightness":103,"power_on_behavior":"previous","state":"ON"}'
info 2022-11-24 16:45:52: MQTT publish: topic 'zigbee2mqtt/Loznice', payload '{"brightness":200,"last_seen":"2022-11-24T16:45:52+01:00","led_type":"led","linkquality":117,"max_brightness":255,"min_brightness":103,"power_on_behavior":"previous","state":"ON"}'
debug 2022-11-24 16:45:52: Received Zigbee message from 'Loznice', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":787}' from endpoint 1 with groupID 0
info 2022-11-24 16:45:52: MQTT publish: topic 'zigbee2mqtt/Loznice', payload '{"brightness":200,"last_seen":"2022-11-24T16:45:52+01:00","led_type":"led","linkquality":117,"max_brightness":255,"min_brightness":103,"power_on_behavior":"previous","state":"ON"}'
debug 2022-11-24 16:45:53: Received Zigbee message from 'Loznice', type 'attributeReport', cluster 'genLevelCtrl', data '{"61440":784}' from endpoint 1 with groupID 0
info 2022-11-24 16:45:53: MQTT publish: topic 'zigbee2mqtt/Loznice', payload '{"brightness":199,"last_seen":"2022-11-24T16:45:53+01:00","led_type":"led","linkquality":114,"max_brightness":255,"min_brightness":103,"power_on_behavior":"previous","state":"ON"}'

  1. can you try changing await entity.command("genLevelCtrl", "moveToLevelTuya", {level, transtime: transition.time}, utils.getOptions(meta.mapped, entity)); to await entity.command("genLevelCtrl", "moveToLevelTuya", {level, transtime: 5000}, utils.getOptions(meta.mapped, entity)); and see if the tranistion is 5 seconds now? If this doesn't work, it seems this device does not support transitions.

I will try this later in the evening.

@marthubner
Copy link

  1. can you try changing await entity.command("genLevelCtrl", "moveToLevelTuya", {level, transtime: transition.time}, utils.getOptions(meta.mapped, entity)); to await entity.command("genLevelCtrl", "moveToLevelTuya", {level, transtime: 5000}, utils.getOptions(meta.mapped, entity)); and see if the tranistion is 5 seconds now? If this doesn't work, it seems this device does not support transitions.

I will try this later in the evening.

I tried and transition really is not working as @chojnicki already said.

@Koenkk
Copy link
Owner

Koenkk commented Nov 25, 2022

I see, removed that now.

Regarding the small brightness jump, this is because the device publishes this.

On a scale from 0-100:

  1. {"61440":787}
  2. {"61440":784}

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)

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Nov 25, 2022
@DesertF0x
Copy link
Author

Is it normal that the device is always sending two messages?

debug 2022-11-27 12:22:00: Received Zigbee message from 'LichtEGFlur', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0 info 2022-11-27 12:22:00: MQTT publish: topic 'zigbee2mqtt/LichtEGFlur', payload '{"brightness":201,"brightness_max":1000,"brightness_min":0,"led_type":"led","linkquality":65,"power_on_behavior":"previous","state":"ON"}' debug 2022-11-27 12:22:05: Received Zigbee message from 'LichtEGFlur', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0 info 2022-11-27 12:22:05: MQTT publish: topic 'zigbee2mqtt/LichtEGFlur', payload '{"brightness":201,"brightness_max":1000,"brightness_min":0,"led_type":"led","linkquality":43,"power_on_behavior":"previous","state":"ON"}' debug 2022-11-27 12:22:57: Received MQTT message on 'zigbee2mqtt/LichtEGFlur/set' with data '{"state":"OFF"}' debug 2022-11-27 12:22:58: Publishing 'set' 'state' to 'LichtEGFlur' info 2022-11-27 12:22:58: MQTT publish: topic 'zigbee2mqtt/LichtEGFlur', payload '{"brightness":201,"brightness_max":1000,"brightness_min":0,"led_type":"led","linkquality":61,"power_on_behavior":"previous","state":"OFF"}' debug 2022-11-27 12:22:58: Received Zigbee message from 'LichtEGFlur', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0 debug 2022-11-27 12:22:58: Received Zigbee message from 'LichtEGFlur', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0 info 2022-11-27 12:22:58: MQTT publish: topic 'zigbee2mqtt/LichtEGFlur', payload '{"brightness":201,"brightness_max":1000,"brightness_min":0,"led_type":"led","linkquality":61,"power_on_behavior":"previous","state":"OFF"}' info 2022-11-27 12:22:58: MQTT publish: topic 'zigbee2mqtt/LichtEGFlur', payload '{"brightness":201,"brightness_max":1000,"brightness_min":0,"led_type":"led","linkquality":61,"power_on_behavior":"previous","state":"OFF"}'

@Koenkk
Copy link
Owner

Koenkk commented Nov 27, 2022

Not normal, but this is what the device does (Received Zigbee message from...)

@shaulbarlev
Copy link

Anybody got transition to work on TS110E varients?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request stale Stale issues
Projects
None yet
Development

No branches or pull requests