zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

unsupported device with Zigbee model 'TS0601' and manufacturer name '_TZE200_yojqa8xn'

Open hasifm2010 opened this issue 4 years ago • 43 comments

Link

https://www.aliexpress.com/item/1005003944885010.html?spm=a2g0o.order_list.0.0.21ef1802vpsuEp

Database entry

Received message from unsupported device with Zigbee model 'TS0601' and manufacturer name '_TZE200_yojqa8xn' MQTT publish: topic 'zigbee2mqtt/Gas Detector', payload '{"last_seen":"2022-10-20T23:24:49+04:00","linkquality":58}'

Comments

Warning 2022-10-21 11:04:10Received message from unsupported device with Zigbee model 'TS0601' and manufacturer name '_TZE200_yojqa8xn' Warning 2022-10-21 11:04:10Please see: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html

External converter

No response

Supported color modes

No response

Color temperature range

No response

hasifm2010 avatar Oct 21 '22 07:10 hasifm2010

Could you update to the latest dev (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) and check if the issue is fixed with the following external converter:

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 ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ggev5fsl', '_TZE200_u319yc66', '_TZE200_yojqa8xn']),
    model: 'TS0601_gas_sensor',
    vendor: 'TuYa',
    description: 'gas sensor',
    fromZigbee: [tuya.fzDataPoints],
    toZigbee: [tuya.tzDataPoints],
    configure: tuya.configureMagicPacket,
    exposes: [e.gas(), tuya.exposes.selfTest(), tuya.exposes.selfTestResult(), tuya.exposes.faultAlarm(), tuya.exposes.silence()],
    meta: {
        tuyaDatapoints: [
            [1, 'gas', tuya.valueConverter.true0ElseFalse],
            [8, 'self_test', tuya.valueConverter.raw],
            [9, 'self_test_result', tuya.valueConverter.selfTestResult],
            [11, 'fault_alarm', tuya.valueConverter.trueFalse],
            [16, 'silence', tuya.valueConverter.raw],
        ],
    },
};

module.exports = definition;

  • 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

Koenkk avatar Oct 21 '22 14:10 Koenkk

Thanks.. Zigbee2mqtt edge can learn device now after following above steps. However, i am getting below warning in logs.

Warning 2022-10-22 09:34:41Datapoint 2 not defined for '_TZE200_yojqa8xn' with data {"dp":2,"datatype":2,"data":{"type":"Buffer","data":[0,0,0,2]}}

hasifm2010 avatar Oct 22 '22 05:10 hasifm2010

I'm not sure what this value means; to find out: https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html#_7-find-your-devices

Koenkk avatar Oct 22 '22 07:10 Koenkk

[14:34:32] INFO: Preparing to start... [14:34:33] INFO: Socat not enabled [14:34:38] INFO: Starting Zigbee2MQTT... /app/dist/util/externally-loaded.js:20 exposes: [e.gas(), tuya.exposes.selfTest(), tuya.exposes.selfTestResult(), tuya.exposes.faultAlarm(), tuya.exposes.silence()], ^ TypeError: tuya.exposes.selfTest is not a function at /app/dist/util/externally-loaded.js:20:37 at Script.runInContext (node:vm:141:12) at Script.runInNewContext (node:vm:146:17) at Object.runInNewContext (node:vm:306:38) at loadModuleFromText (/app/lib/util/utils.ts:148:8) at loadModuleFromFile (/app/lib/util/utils.ts:155:12) at Object.getExternalConvertersDefinitions (/app/lib/util/utils.ts:165:25) at getExternalConvertersDefinitions.next () at new ExternalConverters (/app/lib/extension/externalConverters.ts:12:20) at new Controller (/app/lib/controller.ts:84:58)

Ucsus avatar Oct 29 '22 11:10 Ucsus

@Ucsus you are probably not using the latest dev branch: https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html

Koenkk avatar Oct 29 '22 15:10 Koenkk

@Ucsus you are probably not using the latest dev branch: https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html

I'm using HA, z2m edge version

Ucsus avatar Oct 31 '22 08:10 Ucsus

@Ucsus you are probably not using the latest dev branch: https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html

Reinstalled Z2M and it worked, thanks!

Ucsus avatar Oct 31 '22 13:10 Ucsus

Great!

Koenkk avatar Oct 31 '22 18:10 Koenkk

Did anyone could improve the converter to get the gas reading on the Zigbee version? I've also have the wifi one and it gives me the readings...

This converter works but looks a little glitched. I get many errors on Z2M when detection is triggered,

pauloon avatar Nov 05 '22 14:11 pauloon

Hello, today I have received the tuya zigbee gateway.... the datapoints are more different then the converter ... I have found:

1 Gas detection state 2 Detected Gas 6 Alarm Ringtone 7 Alarm Time 8 Auto-detect 9 Auto-detect Result 10 Preheat

I don't understand how to find the datatype and the values for create a correct converter... can anyone help me?

sercio avatar Nov 08 '22 20:11 sercio

@sercio can you provide the data/database.db entry of your device so I can write the converter?

Koenkk avatar Nov 09 '22 16:11 Koenkk

this is the entry in z2m database.db

{"id":2,"type":"Router","ieeeAddr":"0xa4c1381aea7ee7a6","nwkAddr":2556,"manufId":4417,"manufName":"_TZE200_yojqa8xn","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"\u0019��)\u0017S\u0000\u0000\u0000eT\u0000\u0000\u0000\u0012","65506":54,"65508":1,"modelId":"TS0601","manufacturerName":"_TZE200_yojqa8xn","powerSource":1,"zclVersion":3,"appVersion":70,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":70,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1662022924671,"defaultSendRequestWhen":"immediate"}

Do you need other information?

sercio avatar Nov 09 '22 17:11 sercio

With the following converter https://gist.github.com/Koenkk/86ea747a683752fd6ff9390abf9fda55 everything should be exposed in the z2m frontend -> device -> state. However these are the raw values, we need to map them to more human friendly ones.

For each data point, can you give more context on what it does and what the possible options are?

Koenkk avatar Nov 09 '22 18:11 Koenkk

OK, I can try. There is a tool or a method or I must to try all the options?

sercio avatar Nov 10 '22 07:11 sercio

I need to know what options are provided in the TuYa app

Koenkk avatar Nov 10 '22 16:11 Koenkk

OK, I try.

1 Gas detection state Normal (no gas) 2 Detected Gas 0.00LEL (level of gas) 6 Alarm Ringtone 1 (number of alarm ringtone from 1 to 5 ) 7 Alarm Time 180s (alarm duration from 1 to 180s) 8 Auto-detect (auto test: value on, off) 9 Auto-detect Result (auto test Result value processing, success) 10 Preheat (value on, off)

This is what I understand using app and tuya device debug

sercio avatar Nov 11 '22 09:11 sercio

Thanks, can you check what appears in the z2m frontend -> device -> state with the following external conveter? https://gist.github.com/Koenkk/86ea747a683752fd6ff9390abf9fda55

Koenkk avatar Nov 11 '22 16:11 Koenkk

OK, but it's impossible for me before 24/11. I'll send you the information as soon as possible. Thanks


Da: Koen Kanters @.> Inviato: venerdì 11 novembre 2022 17:01 A: Koenkk/zigbee2mqtt @.> Cc: sercio @.>; Mention @.> Oggetto: Re: [Koenkk/zigbee2mqtt] unsupported device with Zigbee model 'TS0601' and manufacturer name '_TZE200_yojqa8xn' (Issue #14571)

Thanks, can you check what appears in the z2m frontend -> device -> state with the following external conveter? https://gist.github.com/Koenkk/86ea747a683752fd6ff9390abf9fda55

— Reply to this email directly, view it on GitHubhttps://github.com/Koenkk/zigbee2mqtt/issues/14571#issuecomment-1311888211, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACFWCXWERPU42W2LLCC5RGDWHZUUJANCNFSM6AAAAAARK34BMI. You are receiving this because you were mentioned.Message ID: @.***>

sercio avatar Nov 11 '22 16:11 sercio

this is what i am getting when i use this converter https://gist.github.com/Koenkk/86ea747a683752fd6ff9390abf9fda55

{ "detected_gas": 1, "gas": false, "last_seen": "2022-11-12T00:59:58+04:00", "linkquality": 69, "self_test": false, "self_test_result": "success", "silence": false }

hasifm2010 avatar Nov 11 '22 21:11 hasifm2010

Some time ago found somewhere DP info for '_TZE200_yojqa8xn'

sensor_status:   1 - enum (0-detected,1-not detected)
sensor_value:    2 - raw, DivideBy10
alarm_ringtone:  6
alarm_time:      7
self_checking:   8 - work with tuya.exposes.selfTest() & tuya.valueConverter.raw
checking_result: 9 - work with tuya.exposes.selfTestResult() & tuya.valueConverter.selfTestResult
preheat:        10
alarm_switch:   13
muffling:       16 - raw, use tuya.exposes.silence()

usable exposes & converters checked by me. Still working on alarm_ringtone & time, as well alarm_switch.

Masterz69 avatar Nov 30 '22 18:11 Masterz69