zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Unsupported device ready to add (TS0222 / _TYZB01_kvwjujy9)

Open AlexKay88 opened this issue 5 years ago • 36 comments

Information about the device + link

I got a unsupported device working with Z2M: fingerprint: [{modelID: 'TS0222', manufacturerName: '_TYZB01_kvwjujy9'}] Vendor: Moes Model: ZSS-ZK-THL Description: Smart Brightness Thermometer Bought at: https://de.aliexpress.com/item/1005002549320064.html Picture: ZSS-ZK-THL

Pairing with Tuya gateway sniffed with CC2531

DeviceID_0x06bc_TS0222_TYZB01_kvwjujy9.pcapng.gz

Converter for the device

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 definition = {
    fingerprint: [{modelID: 'TS0222', manufacturerName: '_TYZB01_kvwjujy9'}],
    model: 'ZSS-ZK-THL',
    vendor: 'Moes',
    description: 'Smart Brightness Thermometer',
    fromZigbee: [fz.battery, fz.illuminance, fz.humidity, fz.temperature],
    toZigbee: [],
    exposes: [e.battery(), e.illuminance(), e.illuminance_lux().withUnit('lx'), e.humidity(), e.temperature()],
};
module.exports = definition;

data/database.db entry of the device

{"id":55,"type":"EndDevice","ieeeAddr":"0x5c0272fffe0a490b","nwkAddr":52115,"manufId":4098,"manufName":"_TYZB01_kvwjujy9","powerSource":"Battery","modelId":"TS0222","epList":[1,2],"endpoints":{"1":{"profId":260,"epId":1,"devId":262,"inClusterList":[0,1,1024],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"TS0222","manufacturerName":"_TYZB01_kvwjujy9","powerSource":3,"zclVersion":3,"appVersion":72,"stackVersion":0,"hwVersion":1,"dateCode":""}},"msIlluminanceMeasurement":{"attributes":{"measuredValue":10415}},"genPowerCfg":{"attributes":{"batteryPercentageRemaining":200}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":770,"inClusterList":[1026,1029],"outClusterList":[],"clusters":{"msIlluminanceMeasurement":{"attributes":{"61441":20}},"msTemperatureMeasurement":{"attributes":{"measuredValue":1904}},"msRelativeHumidity":{"attributes":{"measuredValue":4685}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":72,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1621459608001}

AlexKay88 avatar May 19 '21 22:05 AlexKay88

Well, I have 5 of that and nothing works... I hope they fix it soon possible! :(

freitas666 avatar May 20 '21 00:05 freitas666

@freitas666 if you don't want to wait, you can follow "2. Adding your device" at https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html The converter you need to copy&paste into a .js file, is shown above.

AlexKay88 avatar May 20 '21 01:05 AlexKay88

Hey bro.. I start some troubleshottings here and now looks like perfectly! :)

freitas666 avatar May 20 '21 03:05 freitas666

I found a strange bug.... not show the battery level....!LOL,,, have you some idea?

freitas666 avatar May 20 '21 03:05 freitas666

@freitas666 Battery powered devices sleep most of the time to save battery, that causes delay on updating some values. You can wait or wake up device by pressing orange button on right side of it. My two devices update Illuminance, humidity, temperature and battery without problems.

AlexKay88 avatar May 20 '21 09:05 AlexKay88

@AlexKay88 hey friend thank you for your feedback.... after some restarts in my z2m... they start working well...! :D

I have one doubt .... how do u sniff this connections to create a "template"?? Example actually I bought some door sensor (TS0203) but I have the same errors... Could you help me?

freitas666 avatar May 20 '21 15:05 freitas666

@freitas666 Glad to hear thats it's also working on your end. Thanks for confirmation. For your TS0203 pls. check if there is already an open issue and if not, pls open your own new issue and mention me. I will see what I can do.

@Koenkk Would be great if you could look at my new converter, check if I did not make any mistakes and add it as a new supported device. I am unexperienced, but I am learning every day.

AlexKay88 avatar May 20 '21 15:05 AlexKay88

@AlexKay88 thank you! @Koenkk actually I am using this converter and works good in 4 devices.

freitas666 avatar May 20 '21 15:05 freitas666

@AlexKay88 looks good, thanks! Added it.

Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html)

Koenkk avatar May 20 '21 17:05 Koenkk

Any idea why this sensor works normally with Z2M but when I try it in ZHA and Tasmota it reannounces itself on screen refresh and some values get stuck on 0?

blakadder avatar May 20 '21 17:05 blakadder

it stills dont work, I have the edge in my HA. I did a force remote. Take out the battery and wait a few minuts. After try to pair again, I got this log: Info Successfully interviewed '0x5c0272fffe0a438d', device has successfully been paired Warning Device '0x5c0272fffe0a438d' with Zigbee model 'TS0222' and manufacturer name '_TYZB01_kvwjujy9' is NOT supported, please follow https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html Info MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":null,"friendly_name":"0x5c0272fffe0a438d","ieee_address":"0x5c0272fffe0a438d","status":"successful","supported":false},"type":"device_interview"}' Info MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"friendly_name":"0x5c0272fffe0a438d","supported":false},"type":"pairing"}' Warning Received message from unsupported device with Zigbee model 'TS0222' and manufacturer name '_TYZB01_kvwjujy9' Warning Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html.

DavidFFerreira avatar May 24 '21 21:05 DavidFFerreira

@DavidFFerreira

hello friend... Actually i have 5 devices working good in my Z2M.. Could you put the steps here?

freitas666 avatar May 25 '21 02:05 freitas666

Hi, I have a batch of 6 ZSS-ZK-THL devices. Nice devices perfect for room temperature monitoring with a screen for humans and ZigBee connection for automation...

As @blakadder and @DavidFFerreira, my devices are behaving badly. After a variable moment, devices don't display or report temperature and humidity. Strangely light sensor is still working both on display and on zigbee connection. I must remove briefly the battery to reset it. Then it works for about one week.

I have contacted Moes. They consider that the device must be used with a Tuya hub.

I suspect a product defect. Otherwise why lux sensor is still working? Or mayby Z2M is not gentle with them, and make them fautlling.

@freitas666, are your devices still working? Are them connected to an Tuya hub?

My configuration: USB ConBee2 stick plugged on a Pi4 running the latest docker image

simulot avatar Sep 28 '21 08:09 simulot

Same here. After some time temperature and humidity is stuck, while light sensor is still working. Pressing the side button sometimes helps. If not, removing and reinserting battery helps.

AlexKay88 avatar Sep 28 '21 08:09 AlexKay88

@simulot @AlexKay88 can you make an experiment, pairing the TS0222 very close to a Zigbee repeating device that is also connected to the same z2m coordinator? It may work also if you simply remove the batteries for 1 minute and insert the battery cell again, while the sensor is very close to the repeater. Zigbee repeating devices are any mains powered zigbee devices, such as a power plugs, zigbee bulbs, etc... This is to ensure that the communication between the sensor and the zigbee coordinator is not direct, but through a repeating device. You can also verify on the Zigbee2MQTT Map whether the link is via repeater or direct. For the experiment, leave the TS0222 close to the repeater if possible. You can monitor the performance in the HA History for a day or two, when the device resets there are rapid drops of the temperature and humidity values on the graph. The above setup has worked for me on several different zigbee platforms.. When TS0222 communicates directly to the zigbee coordinator, it will self-reset periodically. When the communication goes through a zigbee repeater, the device is working stable without any resets for days!
Can someone else confirm this finding?

kkossev avatar Sep 28 '21 21:09 kkossev

My two devices are currently connected via repeaters and have also been connected via repeaters in the past. After a few days they don't show temperature and humidity any longer.

AlexKay88 avatar Sep 29 '21 07:09 AlexKay88

Same here. Some of thermometers are located upstairs, using repeater devices.

To be sure, I have placed one thermometer close to a smart plug, and I have re-paired it. 12 hours later, it is still running. However, it takes usually about one week to fail.

simulot avatar Sep 30 '21 07:09 simulot

Thank you @AlexKay88 and @simulot ! Same observations here, I had an almost 3 weeks period where TS0222 paired through a repeater worked without restarts, sending true measurements data when temperature, humidity or illuminance changes.. But at the end, probably something has changed in the zigbee network and the restarts began again.

This TS0222 device does not work reliably with any zigbee hub, other than Tuya.

kkossev avatar Oct 01 '21 05:10 kkossev

@kkossev, the tested thermometer has crashed this morning. Since then, no more temperature / humidity measure. It has ran during 18h. The display shows "E1" as temp. Lux is still functioning. It is relayed by a TuYa TS0121_plug

In the next room, another thermometer is running since 26 days. This one is relayed by a Ikea ICPSHC24-30EU-IL-1. Another thermometer relayed by another TuYa TS0121_plug is running since more than 30 days.

@Koenkk It's time to remove this device from the compatibility list, or at least add big warnings

simulot avatar Oct 01 '21 07:10 simulot

I have the same device but it advertises as Zigbee model 'TS0222' and manufacturer name '_TYZB01_ftdkanlj'

I am using zigbee2mqtt as HomeAssistant addon though and I am unsure about how to add proceed. Can this other manufacturer name just be added to the existing definition? Where would I find that?

Edit: I see that may already have happened just now

https://github.com/Koenkk/zigbee-herdsman-converters/commit/173763014caac9c1e47106a0c054ce0f34520c89

maweki avatar Feb 01 '22 11:02 maweki