Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.22k stars 1.69k forks source link

Smoke detector "TS0205 _TZ3210_up3pngle" go to offline #19910

Open jocamane opened 1 year ago

jocamane commented 1 year ago

What happened?

The smoke detector "TS0205 _TZ3210_up3pngle" apparently pairs well but after a few hours (+- 24h) it goes offline. If you press the test button it "wakes up". Remaining battery in % also shows N/A%

Zigbee2MQTT version: 1.33.2 commit: unknown Coordinator type: ConBee2/RaspBee2 Coordinator revision: 0x26780700 Frontend version: 0.6.142 Zigbee-herdsman-converters version: 15.106.0 Zigbee-herdsman version: 0.21.0

Core: 2023.11.3 Supervisor: 2023.11.3 Operating System: 11.1 Frontend: 20231030.2

If you need any more information, please let me know.

Thanks for the correction please.

What did you expect to happen?

That the smoke detector did not go offline and that it had values on the battery

How to reproduce it (minimal and precise)

the smoke detector is paired and everything works except the battery %. After about 24 hours it goes offline. During this time all other smoke sensors have "last seen" for a short time only this model this parameter is not changed

Zigbee2MQTT version

1.33.2

Adapter firmware version

0x26780700

Adapter

ConBee2

Debug log

No response

jocamane commented 1 year ago

image

jocamane commented 1 year ago

image

jocamane commented 12 months ago

@Koenkk Can you help me ?

vdb72 commented 12 months ago

I have the same issue. :-(

pixeldoc2000 commented 11 months ago

I have the same issue :-(

This could by design to save power on the Device, could also be a firmware bug on the device?

Or maybe we have to figure out, if (constant) report is configureable via Zigbee for this device? Looks like Tuya Devices are a "special" case. https://www.zigbee2mqtt.io/advanced/support-new-devices/02_support_new_tuya_devices.html Anybody here with a Tuya Gateway ready to Debug?

Maybe the support for this device is incomplete? Looks like Tuya devices are (more) difficult to support because of there own "dp" properties.

Tuya TS0205: https://www.zigbee2mqtt.io/devices/TS0205.html

It looks like the Tuya TS0601 (https://www.zigbee2mqtt.io/devices/TS0601_smoke_1.html) does send his status every 3h because of specific implementation?

pixeldoc2000 commented 11 months ago

Looking at the heardsman convert for TS0205, it looks like (very) basic support: https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/devices/tuya.ts Also ignore_basic_report is defined, maybe thats why we don't get (status) update ?

pixeldoc2000 commented 11 months ago

My Device: Zigbee Model: TS0205 Zigbee Manufacturer: _TZ3210_up3pngle

Looks like there is no "alias" / fingerprint for for "_TZ3210_up3pngle" ?

pixeldoc2000 commented 11 months ago

Sadly, the device does not seem to support / respond to bind of genPowerCfg for batteryPercentageRemaining or batteryVoltage

debug 2023-12-05 00:36:20 binding cluster 'genPowerCfg' from '0xa4c13867c545a189' to 'Coordinator'
error 2023-12-05 00:36:30 Failed to bind cluster 'genPowerCfg' from '0xa4c13867c545a189' to 'Coordinator' (Error: Bind 0xa4c13867c545a189/1 genPowerCfg from '0x00124b0021a8eb98/1' failed (AREQ - ZDO - bindRsp after 10000ms))

Edit: Bind and batteryPercentageRemaining Report is working. The Devices sends it's battery state every 4h and stays online this way.

pixeldoc2000 commented 11 months ago

@jocamane @vdb72 Please test the following as an external converter: https://www.zigbee2mqtt.io/guide/configuration/more-config-options.html#external-converters and report back here.

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 definition = {
    fingerprint: [{modelID: 'TS0205', manufacturerName: '_TZ3210_up3pngle'}],
    model: 'TS0205_new',
    vendor: 'TuYa',
    description: 'Smoke sensor',
    fromZigbee: [fz.ias_smoke_alarm_1, fz.battery, fz.ignore_basic_report],
    toZigbee: [],
    configure: async (device, coordinatorEndpoint, logger) => {
        try {
            const endpoint = device.getEndpoint(1);
            await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
            await reporting.batteryPercentageRemaining(endpoint);
            //await reporting.batteryVoltage(endpoint);
        } catch (error) {/* Fails for some*/}
    },
    exposes: [e.smoke(), e.battery_low(), e.battery(), e.tamper()],
    whiteLabel: [
        {vendor: 'Tesla Smart', model: 'TSL-SEN-SMOKE'},
        {vendor: 'Dongguan Daying Electornics Technology', model: 'YG400A (Zigbee)'},
    ],
};

module.exports = definition;
jocamane commented 11 months ago

~Sadly, the device does not seem to support / respond to bind of genPowerCfg for batteryPercentageRemaining or batteryVoltage~

debug 2023-12-05 00:36:20 binding cluster 'genPowerCfg' from '0xa4c13867c545a189' to 'Coordinator'
error 2023-12-05 00:36:30 Failed to bind cluster 'genPowerCfg' from '0xa4c13867c545a189' to 'Coordinator' (Error: Bind 0xa4c13867c545a189/1 genPowerCfg from '0x00124b0021a8eb98/1' failed (AREQ - ZDO - bindRsp after 10000ms))

Edit: Bind and batteryPercentageRemaining Report is working. The Devices sends it's battery state every 4h and stays online this way.

In my case the device after +-24 hours go to offline state

jocamane commented 11 months ago

@jocamane @vdb72 Please test the following as an external converter: https://www.zigbee2mqtt.io/guide/configuration/more-config-options.html#external-converters and report back here.

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 definition = {
    fingerprint: [{modelID: 'TS0205', manufacturerName: '_TZ3210_up3pngle'}],
    model: 'TS0205_new',
    vendor: 'TuYa',
    description: 'Smoke sensor',
    fromZigbee: [fz.ias_smoke_alarm_1, fz.battery, fz.ignore_basic_report],
    toZigbee: [],
    configure: async (device, coordinatorEndpoint, logger) => {
        try {
            const endpoint = device.getEndpoint(1);
            await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
            await reporting.batteryPercentageRemaining(endpoint);
            //await reporting.batteryVoltage(endpoint);
        } catch (error) {/* Fails for some*/}
    },
    exposes: [e.smoke(), e.battery_low(), e.battery(), e.tamper()],
    whiteLabel: [
        {vendor: 'Tesla Smart', model: 'TSL-SEN-SMOKE'},
        {vendor: 'Dongguan Daying Electornics Technology', model: 'YG400A (Zigbee)'},
    ],
};

module.exports = definition;

OK, I try

jocamane commented 11 months ago

I repaired one of the devices. The other two I chose not to do. I only removed the lid to cause the tamper to move and put it back in place. After that, it stopped being offline and went online.

Now let's wait 24 hours to see the behavior of the 3 devices

jocamane commented 11 months ago

image

It hasn't reached 24 hours yet but it looks like it will be offline again

pixeldoc2000 commented 11 months ago

@jocamane It seems you have setup the external converter correctly, as it says Model: TS0205_new (= external converter).

After setting up the external converter, you need to pair the device again or try to repair the devices via zigbee2mqtt. Otherwise zigbee2mqtt may not establish bind to PowerCfg Cluster and Reporting for the device.

It should look like this:

Bind: grafik

Reporting: grafik The device should report the battery status at least every 4h .

Change your log level to debug and check if there is any error for the device on interview while pairing / repair.

pixeldoc2000 commented 11 months ago

@jocamane

I repaired one of the devices.

Which device did you repair and how?

pixeldoc2000 commented 11 months ago

image

It hasn't reached 24 hours yet but it looks like it will be offline again

LQI value of 255 for the devices looks off. Are the devices right next to the coordinator? Do you have any device with other LQI value?

What coordinator do you use?

jocamane commented 11 months ago

@jocamane It seems you have setup the external converter correctly, as it says Model: TS0205_new (= external converter).

After setting up the external converter, you need to pair the device again or try to repair the devices via zigbee2mqtt. Otherwise zigbee2mqtt may establish bind to PowerCfg Cluster and Reporting for the device.

It should look like this:

Bind: grafik

Reporting: grafik The device should report the battery status at least every 4h .

Change your log level to debug and check if there is any error for the device on interview while pairing / repair.

I repaired 1 device (Det Fumo Escritorio ZG). I deleted it from the z2m and re-paired it. Interestingly, it is one of those that is offline again. I didn't do anything with the other two, but I'm going to pair them.

Regarding bind and reporting, I have 2 identical to the ones you sent in the print and one of them has nothing. Regarding LQI: On the z2m home screen I have all devices with 255, but on the map they have different values. My coordinator is zigbeeII

This is what I repaired: image image

I didn't do anything about these: image image

image image

The actual situation is: image

jocamane commented 11 months ago

image

pixeldoc2000 commented 11 months ago

@jocamane

I repaired 1 device (Det Fumo Escritorio ZG). I deleted it from the z2m and re-paired it. Interestingly, it is one of those that is offline again. I didn't do anything with the other two, but I'm going to pair them.

"Det Fumo Escritorio ZG" is connected via repeater to your coordinator. Maybe the repeater does not (fully) support the device. Maybe pair the device close to the coordinator. Some repeaters can cause all sorts of problems. Also, restarting zigbee2mqtt may have trigger bind and reporting for (all) devices.

Regarding bind and reporting, I have 2 identical to the ones you sent in the print and one of them has nothing.

Please repair the device close to the coordinator.

Some devices stay online and some don't, correct?

Never seen "wrong" LQI values in zigbee2mqtt device list. At least the Zigbee maps shows reals values. Maybe open a new issue for that problem.

jocamane commented 11 months ago

@pixeldoc2000

"Det Fumo Escritorio ZG" is connected via repeater to your coordinator. Maybe the repeater does not (fully) support the device. Maybe pair the device close to the coordinator. Some repeaters can cause all sorts of problems. Also, restarting zigbee2mqtt may have trigger bind and reporting for (all) devices.

The pair was made close to the coordinator but was connected to the repeater. I even put the "permit coordinator" only on z2m. Note that there are two sensors connected to the coordinator and one apparently works well and the other does not. tomorrow I will try repair again

Regarding restarting the z2m, I've already restarted the entire HA and it stayed the same.

Some devices stay online and some don't, correct?

Yes, one of them goes online and the other two don't

Never seen "wrong" LQI values in zigbee2mqtt device list. At least the Zigbee maps shows reals values. Maybe open a new issue for that problem.

I think that would be a good approach. If you need any help from me with logs, let me know

jocamane commented 11 months ago

hi, I did the following:

In the end the map looked like this:

image

These messages appear in the core log whenever I pair one device, which have already appeared on other occasions when pairing other devices, so I don't pay much attention to them:

Logger: homeassistant.components.mqtt.mixins Source: components/mqtt/mixins.py:553 Integration: MQTT (documentation, issues) First occurred: 11:50:15 (10 occurrences) Last logged: 12:04:11

Erroneous JSON:


Logger: homeassistant.helpers.template Source: helpers/template.py:2244 First occurred: 11:50:15 (10 occurrences) Last logged: 12:04:11

Template variable error: 'value_json' is undefined when rendering '{{ value_json.smoke }}' Template variable error: 'value_json' is undefined when rendering '{{ value_json.battery_low }}' Template variable error: 'value_json' is undefined when rendering '{{ value_json.battery }}' Template variable error: 'value_json' is undefined when rendering '{{ value_json.tamper }}'


Logger: homeassistant.helpers.template Source: helpers/template.py:750 First occurred: 11:50:15 (7 occurrences) Last logged: 12:04:11

Error parsing value: 'value_json' is undefined (value: , template: {{ value_json.smoke }}) Error parsing value: 'value_json' is undefined (value: , template: {{ value_json.battery_low }}) Error parsing value: 'value_json' is undefined (value: , template: {{ value_json.tamper }})

Follows the z2m debug log when pairing one of the devices:

0xa4c138589ac24520.txt

Now Is there any way to know if it's ok without waiting 24 hours?

thanks

jocamane commented 11 months ago

However, after this, I downgraded the conbeeII firmware because I read that the version I had could cause problems. (Warning: Conbee 2 firmware versions newer than 0x26580700 will result in an unstable network with devices dropping randomly, see Issue 9554)

NOTE: After firmware downgrade, the LQI now appears well on the main screen

image

but strangely, the coordinator no longer has children connected to it and the 3 smoke sensors “TS0205_new” are not connected anywhere

image

Now wait....

jocamane commented 11 months ago

image

Apparently it's ok, although the "last seen" time is much longer than other smoke sensors I have. I'll wait a little longer.

image

As far as the map is concerned, everything remains the same. the smoke detectors do not appear connected to anything. The next thing to do is to re-pair the devices now with the "old" version of the ZigBee firmware. Note that the devices were paired before I downgraded the firmware.

@pixeldoc2000 Do you have any other ideas for what I can do?

jocamane commented 11 months ago

Apparently it's ok, the "last seen" time is 17 hours but ok

image

please apply the correction in the next z2m version

thanks

Chartreusito commented 11 months ago

Just here to confirm the external converter is working fine on my end @pixeldoc2000. This device model is advertised as "YG400A" on the one i bought. Do you want me to handle de picture PR ?

ThomasKlesse commented 11 months ago

Yes, the external conveter works very well. Thank you. But don't forgett to reset - delete and teach again - your device.

pixeldoc2000 commented 11 months ago

@jocamane @Chartreusito @ThomasKlesse Thanks for your Feedback.

Made a pull request that should fix the device: https://github.com/Koenkk/zigbee-herdsman-converters/pull/6724

jocamane commented 11 months ago

@jocamane @Chartreusito @ThomasKlesse Thanks for your Feedback.

Made a pull request that should fix the device: Koenkk/zigbee-herdsman-converters#6724

Don't forget to change the picture, please

Chartreusito commented 11 months ago

@jocamane @Chartreusito @ThomasKlesse Thanks for your Feedback. Made a pull request that should fix the device: Koenkk/zigbee-herdsman-converters#6724

Don't forget to change the picture, please

Picture PR is ready : https://github.com/Koenkk/zigbee2mqtt.io/pull/2406 Converter need to name the device accordingly for it to work.

pixeldoc2000 commented 11 months ago

@Chartreusito Fixed the name. I've added "Zigbee" to the model name because I noticed, the same model is sold with WIFI.

Smarticor commented 11 months ago

Hi. After adding external converter device was several times online info 2023-12-18 21:46:28: MQTT publish: topic 'zigbee2mqtt/smoke', payload '{"ac_status":false,"battery":63,"battery_defect":false,"battery_low":false,"last_seen":"2023-12-18T21:46:28+01:00","linkquality":176,"restore_reports":false,"smoke":false,"supervision_reports":false,"tamper":false,"test":false,"trouble":false}'

info 2023-12-19 04:45:11: MQTT publish: topic 'zigbee2mqtt/smoke', payload '{"ac_status":false,"battery":63,"battery_defect":false,"battery_low":false,"last_seen":"2023-12-19T04:45:11+01:00","linkquality":176,"restore_reports":false,"smoke":false,"supervision_reports":false,"tamper":false,"test":false,"trouble":false}'

But now it is offline again image

pszewello commented 10 months ago

I have the same issue... it joins, but can't set the bind or reporting (they timeout), battery % is always unknown, and device goes offline. image

jocamane commented 10 months ago

Hello. I just installed z2m version 1.35.1 and removed the external converter for this smoke detector. Apparently everything is OK

Thanks

emilianogetino commented 10 months ago

Does it already show the battery percentage? It always shows it to me as:

Battery Remaining battery in %, can take up to 24 hours before reported. N/A%

Greetings, thank you.

attilabalazsy commented 10 months ago

I've also updated to the lastest version as I'm facing the same issues as described above (no battery level indicator and continuous disconnect), but the latest version is not solving the battery level. I hope, that it at least solves the disconnect issue. Will see tomorrow.

george4ac commented 9 months ago

I have updated to ver. 1.35.2 but smoke detectors are continuously disconnected. When tamper is activated smoke detector immediately send message. I tested detector by smoke also and it detect smoke and send message also. Know somebody solution for disconnecting and battery level?

attilabalazsy commented 9 months ago

@george4ac I've updated to the latest version, but the battery was not solved, so I've applied the external converter workaround (see at the beginning of the thread) and this solved both the battery and connection issues. It is running smooth for 2 weeks.

fufurax commented 9 months ago

@george4ac I've updated to the latest version, but the battery was not solved, so I've applied the external converter workaround (see at the beginning of the thread) and this solved both the battery and connection issues. It is running smooth for 2 weeks.

I've the same issue. My zigbee devise goes to offline :( I've installed latest version in docker container ([1.35.3]), delete and pair the smoke detector but nothing...same issue :(

So I've try to install the external converter :

but I've an error in the log folder:

error 2024-02-07 19:00:12: Failed to load external converter file 'smoke.js' (ENOENT: no such file or directory, open '/app/data/smoke.js')
error 2024-02-07 19:00:12: Probably there is a syntax error in the file or the external converter is not compatible with the current Zigbee2MQTT version

Do you have an idea @george4ac ?

Chartreusito commented 9 months ago

@fufurax this looks like a config issue, i'd check file path and permissions. i'm using HA Add-on so i could not help you with container config

fufurax commented 9 months ago

i'm using HA Add-on ?? It's the configuration.yaml is in Z2M not in HA.

Chartreusito commented 9 months ago

Then that's what it looks like for me :

external_converters:
  - YG400A.js

I usually manually put my js files in config/zigbee2mqtt folder then enable then using the "Settings -> External Converters" tab of z2m Just put the name of the file in the blank field and click submit

founek2 commented 9 months ago

I am still having issues with disconnect even with external connector, which at least fixes the baterry percentage reporting. I am running zigbee2mqtt v1.35.1. Does anyone have some points, which would help with the disconnect?

After pairing, it becomes "unavailable" after some time and never reconnects - only force disconnect and pairing again helps (but disconnects again).

Snímek obrazovky 2024-02-17 v 22 16 38 Snímek obrazovky 2024-02-17 v 22 17 02

I apologise for the non-English language on the screenshots, but I am not sure how to switch the language in the UI.

jocamane commented 9 months ago

here it is the same: image after repair go to offline after a few hours and the state is:

image and image

Core: 2024.1.6 Supervisor: 2024.01.1 Operating System: 11.4 Frontend: 20240104.0

Zigbee2MQTT version: [1.35.1] commit: [unknown] Coordinator type: ConBee2/RaspBee2 Coordinator revision: 0x26580700 Coordinator IEEE Address: 0x00212effff07afaa Frontend version: 0.6.151 Zigbee-herdsman-converters version: 18.9.0 Zigbee-herdsman version: 0.30.0

what to do ?

fufurax commented 9 months ago

Hi team, is there a workaround to fix the issue ?

vdb72 commented 9 months ago

@fufurax Have been trying a lot myself as per suggestions in this thread, but still going offline after 24h. So I have no fix and might simply replace them with a bit more expensive zigbee smoke versions that I already own and do stay awake. (heiman hs1sa and xiaomi JTYJ-GD-01LM/BW)

Could have tried this myself by puting my house on fire ;-)... , but maybe someone knows...do they wake up / become active again when they detect smoke?

jocamane commented 9 months ago

@fufurax Have been trying a lot myself as per suggestions in this thread, but still going offline after 24h. So I have no fix and might simply replace them with a bit more expensive zigbee smoke versions that I already own and do stay awake. (heiman hs1sa and xiaomi JTYJ-GD-01LM/BW)

Could have tried this myself by puting my house on fire ;-)... , but maybe someone knows...do they wake up / become active again when they detect smoke?

YES. if there is smoke they activate

jocamane commented 9 months ago

The solution is to put the external converter back in?

jocamane commented 9 months ago

If I put the external converter (TS0205.js) back in and do a new PAIR it works fine, no offline anymore.

Except the image that has the zigbee symbol and the name that has TS0205_NEW.

@Chartreusito @pixeldoc2000 - what do I do now ?

george4ac commented 9 months ago

Try change this lines in TS0205.js: whiteLabel: [ {vendor: 'Tesla Smart', model: 'TSL-SEN-SMOKE'}, {vendor: 'Dongguan Daying Electornics Technology', model: 'YG400A'}, ]

jocamane commented 9 months ago

Try change this lines in TS0205.js: whiteLabel: [ {vendor: 'Tesla Smart', model: 'TSL-SEN-SMOKE'}, {vendor: 'Dongguan Daying Electornics Technology', model: 'YG400A'}, ]

@george4ac and what exactly is this for?