zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[New device support]: New Support for Aliexpress Smoke Detector

Open markro76 opened this issue 1 year ago • 19 comments

Link

https://de.aliexpress.com/item/1005006862684253.html?spm=a2g0o.order_list.order_list_main.48.21ef5c5fXBHDNu&gatewayAdapt=glo2deu

Database entry

{"id":41,"type":"EndDevice","ieeeAddr":"0xa4c138ffd7a8e9b2","nwkAddr":47773,"manufId":4417,"manufName":"_TZE284_rccxox8p","powerSource":"Battery","modelId":"TS0601","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0,60672],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"stackVersion":0,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":77,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1732536980570}

Zigbee2MQTT version

1.41.0-1

Comments

Please Help

Device '0xa4c138ffd7a8e9b2' with Zigbee model 'TS0601' and manufacturer name '_TZE284_rccxox8p' is NOT supported, please follow https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html

External definition



const definition = {
    zigbeeModel: ['TS0601'],
    model: 'TS0601',
    vendor: '_TZE284_rccxox8p',
    description: 'Automatically generated definition',
    extend: [],
    meta: {},
};

module.exports = definition;

What does/doesn't work with the external definition?

all

markro76 avatar Nov 25 '24 12:11 markro76

I just received the same device and realized it's not yet supported by zb2mqtt. But it appears to be more or less identical to a smoke detector called "PA-44Z": https://www.zigbee2mqtt.io/devices/PA-44Z.html

"PA-44Z" not only looks identical, it contains manufacturer ID "_TZE200_rccxox8p", which is very similar to "_TZE284_rccxox8p".

So I tried to simply add manufacturer id '_TZE284_rccxox8p' to the "PA-44Z" definition and at first sight it seems to work fine.

oyooyo avatar Nov 29 '24 16:11 oyooyo

I have no plan to write an new Config. Can you please give me the .js File from your Config.

Many Thanks

markro76 avatar Nov 29 '24 16:11 markro76

I haven't written a new config either as I have no experience with that too. All I did was opening the file "devices/tuya.js" from the "zigbee-herdsman-converters" package (just search for a file named tuya.js) with a text editor and then simply changing this line:

        fingerprint: tuya.fingerprint('TS0601', ['_TZE200_m9skfctm', '_TZE200_rccxox8p']),

to

        fingerprint: tuya.fingerprint('TS0601', ['_TZE200_m9skfctm', '_TZE200_rccxox8p', '_TZE284_rccxox8p']),

That's probably not the proper way to do it, as I assume those changes will get overwritten when updating zigbee2mqtt. But by that time the device will hopefully be supported out of the box, so I hope it will be okay.

oyooyo avatar Nov 29 '24 16:11 oyooyo

I can´t find the file. Can you tell me were i can find the File ?

markro76 avatar Nov 29 '24 16:11 markro76

Try <Directory where you installed zigbee2mqtt>/node_modules/zigbee-herdsman-converters/devices/tuya.js, but I am not 100% sure if it is always in this location.

p.s.: I had to unpair/remove the device from zigbee2mqtt and pair it again before the device was properly recognized by zb2mqtt after I made the changes.

oyooyo avatar Nov 29 '24 16:11 oyooyo

Any Idea how to make these changes permanent in a docker container. I am running zigbee2mqtt in home assistant. I can change the file in the container, but aber a restart ist is changed back.

atsoller avatar Nov 30 '24 14:11 atsoller

I have the same Problem. I Hope the device will have support in the next Version of zigbee2mqtt :-)

markro76 avatar Nov 30 '24 15:11 markro76

If you have Terminal installed in HA you need to switch off save mode. Than you an switch into the z2mqtt conternair with this command. docker exec -it $(docker ps | grep zigbee2mqtt | cut -d" " -f 1) /bin/sh Change to the directory cd node_modules/zigbee-herdsman-converters/devices/ and you can edit the file tuya.js, You need to install a editor or work wirh the installed Vi editor. So its good if you know a bit about linux.. But as I wrote before, i can not get it to work. I guess the fille is always updated when restarting the container. Maybe someone who knows more about containers can help with that..

atsoller avatar Dec 01 '24 08:12 atsoller

It looks like the configuration of PA-44Z works fine. So we probably don't need a new converter. The manufacturer id could be added to the PA-44Z converter. I will do further testing and will report any findings here. Thanks @oyooyo for your hint.

guener avatar Dec 17 '24 18:12 guener

The manufacture id is added in zigbee-herdsman-converters 21.13. I am on the latest Z2M release, wich has 21.12.

Is there anyway to update to 21.13? Iam running the HA Addon

QempZor avatar Jan 06 '25 13:01 QempZor

Is there anyway to update to 21.13? Iam running the HA Addon

The Version 21.13 was already merged. We need to wait for the next Z2M Release.

BOFH90 avatar Jan 08 '25 04:01 BOFH90

While waiting for the Update, I was able to bring the device up with the following external converter. To be clear here, I don´t understand what I´m doing. My ability is limited to google, copy and paste! Code for converter was found here: https://github.com/Koenkk/zigbee2mqtt/issues/23250

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

const definition = {
        fingerprint: tuya.fingerprint('TS0601', ['_TZE284_rccxox8p', '_TZE222_rccxox8p']),
        model: 'PA-44Z',
        vendor: 'Tuya',
        description: 'Photoelectric smoke detector',
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        onEvent: tuya.onEventSetTime,
        configure: tuya.configureMagicPacket,
        exposes: [
            e.smoke(),
            e.battery(),
            tuya.exposes.silence(),
            e.test(),
            e.numeric('smoke_concentration', ea.STATE).withUnit('ppm').withDescription('Parts per million of smoke detected'),
            e.binary('device_fault', ea.STATE, true, false).withDescription('Indicates a fault with the device'),
        ],
        meta: {
            tuyaDatapoints: [
                [1, 'smoke', tuya.valueConverter.trueFalse0],
                [2, 'smoke_concentration', tuya.valueConverter.divideBy10],
                [11, 'device_fault', tuya.valueConverter.raw],
                [15, 'battery', tuya.valueConverter.raw],
                [16, 'silence', tuya.valueConverter.raw],
                [101, 'test', tuya.valueConverter.raw],
            ],
        },
    };

module.exports = definition;

m-lindemann avatar Jan 17 '25 11:01 m-lindemann

While waiting for the Update, I was able to bring the device up with the following external converter. To be clear here, I don´t understand what I´m doing. My ability is limited to google, copy and paste! Code for converter was found here: #23250

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

const definition = { fingerprint: tuya.fingerprint('TS0601', ['_TZE284_rccxox8p', '_TZE222_rccxox8p']), model: 'PA-44Z', vendor: 'Tuya', description: 'Photoelectric smoke detector', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket, exposes: [ e.smoke(), e.battery(), tuya.exposes.silence(), e.test(), e.numeric('smoke_concentration', ea.STATE).withUnit('ppm').withDescription('Parts per million of smoke detected'), e.binary('device_fault', ea.STATE, true, false).withDescription('Indicates a fault with the device'), ], meta: { tuyaDatapoints: [ [1, 'smoke', tuya.valueConverter.trueFalse0], [2, 'smoke_concentration', tuya.valueConverter.divideBy10], [11, 'device_fault', tuya.valueConverter.raw], [15, 'battery', tuya.valueConverter.raw], [16, 'silence', tuya.valueConverter.raw], [101, 'test', tuya.valueConverter.raw], ], }, };

module.exports = definition;

Hello:

In which folder have you copied the converter? I have created an external_coverters folder in the zigbee2mqtt configuration and copied the .js file there, but it still doesn't recognise the smoke sensor.

Thank you very much.

withdemon1 avatar Jan 20 '25 13:01 withdemon1

You must restart the Zigbee2mqtt Addon. In the LogFiles of the Addon you can see the loaded Files of the folder. See Screenshot

Image

markro76 avatar Jan 20 '25 13:01 markro76

You must restart the Zigbee2mqtt Addon. In the LogFiles of the Addon you can see the loaded Files of the folder. See Screenshot

Image

Thank you very much, I see it correctly.

withdemon1 avatar Jan 20 '25 13:01 withdemon1

I have bought recently this device thinking it was PA-44Z. I would love that Zigbee2mqtt supports it.

alvarokrn avatar Feb 12 '25 08:02 alvarokrn

Taking in consideration that this model is like a clone of the Tuya PA-44Z and looks like it works pretty similar. This should be pretty straightforward to support it, isn't it?

EDIT: I realised that with the last version of Z2M the device is supported (althought this ticket is still open). So someone should close it.

alvarokrn avatar Feb 25 '25 20:02 alvarokrn

I have the following error when trying to selftest: 'Error: No datapoint defined for 'self_test''

cypherbits avatar Mar 12 '25 18:03 cypherbits

While waiting for the Update, I was able to bring the device up with the following external converter. To be clear here, I don´t understand what I´m doing. My ability is limited to google, copy and paste! Code for converter was found here: #23250

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

const definition = { fingerprint: tuya.fingerprint('TS0601', ['_TZE284_rccxox8p', '_TZE222_rccxox8p']), model: 'PA-44Z', vendor: 'Tuya', description: 'Photoelectric smoke detector', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket, exposes: [ e.smoke(), e.battery(), tuya.exposes.silence(), e.test(), e.numeric('smoke_concentration', ea.STATE).withUnit('ppm').withDescription('Parts per million of smoke detected'), e.binary('device_fault', ea.STATE, true, false).withDescription('Indicates a fault with the device'), ], meta: { tuyaDatapoints: [ [1, 'smoke', tuya.valueConverter.trueFalse0], [2, 'smoke_concentration', tuya.valueConverter.divideBy10], [11, 'device_fault', tuya.valueConverter.raw], [15, 'battery', tuya.valueConverter.raw], [16, 'silence', tuya.valueConverter.raw], [101, 'test', tuya.valueConverter.raw], ], }, };

module.exports = definition;

This worked like a charm, thank you!

Fograd avatar Mar 20 '25 12:03 Fograd

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar May 20 '25 00:05 github-actions[bot]