Koenkk / zigbee2mqtt

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

[New device support]: TS0601 _TZE200_lvkk0hdg (EPTTECH Tank Level Monitor Zigbee) #21015

Open rvdlinden opened 7 months ago

rvdlinden commented 7 months ago

Link

https://www.aliexpress.com/item/1005006395402636.html

Database entry

{"id":66,"type":"EndDevice","ieeeAddr":"0x0ceff6fffe4bdda2","nwkAddr":39698,"manufId":4098,"manufName":"_TZE200_lvkk0hdg","powerSource":"Battery","modelId":"TS0601","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,4,5,61184],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"�ME-\u0019%NE-\u0019aNE-j�NE-j\u000fPE-j�KE-j�KE-\u0019>LE-i","65506":31,"65508":0,"65534":0,"appVersion":65,"modelId":"TS0601","manufacturerName":"_TZE200_lvkk0hdg","powerSource":3,"zclVersion":3,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":65,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":-708457359},"lastSeen":1706198663760,"defaultSendRequestWhen":"immediate"}

Comments

I have followed all the documentation on how to add a new unsupported device, but I got stuck on the configuration file. Only 3 out of the 7 Tuya Data Points are working (the read-only points), but the other 4 data points for configuration of the device are seen in Tuya IOT, but refused to be configured in Zigbee2MQTT

The attached external definition file is an attempt to setup the device, but that all I got and do not know how to continue.

The working Data Points and also the failing Data Points are all described in the definition file for easy reference.

NOTE: There is also an identical device, but then it's a Wifi based device. In the Smart Life app both devices are fully working (all 7 Data Points), but in HA (either via Zigbee2MQTT or LocalTuya) only 3 out of 7 Data Points can be used. See for the TLC2206 Wifi device https://www.aliexpress.com/item/1005005758585356.html

Both devices have equal Data Points {"1":"Liquid level status","2":"Liquid level depth","7":"Set Max","8":"Set Mini","19":"Installation height","21":"Sensor to full line","22":"Liquid level ratio"}

External defintion

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: 'TS0601',
      manufacturerName: '_TZE200_lvkk0hdg',
    },
  ],
  model: 'TS0601_tlc2206zb',
  vendor: 'TuYa',
  whiteLabel: [
    {
      vendor: 'EPTTECH',
      model: 'TLC2206-ZB',
    },
  ],
  description: 'EPTTECH Tank Level Monitor Zigbee',
  fromZigbee: [tuya.fz.datapoints],
  toZigbee: [tuya.tz.datapoints],
  onEvent: tuya.onEventSetTime,
  configure: tuya.configureMagicPacket,
  exposes: [
    e.numeric('liquid_level_percent', ea.STATE)
      .withUnit('%')
      .withDescription('Liquid level percentage'),
    e.numeric('liquid_depth', ea.STATE)
      .withUnit('m')
      .withDescription('Liquid Depth'),
    e.enum('liquid_state', ea.STATE, ['low', 'normal', 'high'])
      .withDescription('Liquid State'),
    // =============== Found but non functional ===============
    /*
    e.numeric('max_set', ea.STATE_SET)
      .withUnit('%')
      .withDescription('Liquid max percentage')
      .withValueMin(0)
      .withValueMax(100)
      .withValueStep(1),
    e.numeric('mini_set', ea.STATE_SET)
      .withUnit('%')
      .withDescription('Liquid minimal percentage')
      .withValueMin(0)
      .withValueMax(100)
      .withValueStep(1),
    e.numeric('installation_height', ea.STATE_SET)
      .withUnit('mm')
      .withDescription('Height from sensor to tank bottom')
      .withValueMin(100)
      .withValueMax(2500)
      .withValueStep(1),
    e.numeric('liquid_depth_max', ea.STATE_SET)
      .withUnit('mm')
      .withDescription('Height from sensor to liquid level')
      .withValueMin(100)
      .withValueMax(1000)
      .withValueStep(1),
    */
  ],
  meta: {
    tuyaDatapoints: [
      [1, 'liquid_state', tuya.valueConverterBasic.lookup({'low': 1, 'normal': 0, 'high': 2})],
      [2, 'liquid_depth', tuya.valueConverter.divideBy100],
      [22, 'liquid_level_percent', tuya.valueConverter.raw],
      // =============== Found but non functional ===============
      /*
      [7, 'max_set', tuya.valueConverter.raw],
      [8, 'mini_set', tuya.valueConverter.raw],
      [19, 'installation_height', tuya.valueConverter.raw],
      [21, 'liquid_depth_max', tuya.valueConverter.raw],
      */
    ],
  },
};

module.exports = definition;
DrTrotty commented 1 month ago

Thank you very much!

DrTrotty commented 1 month ago

I bought the device from Aliexpress and asked for a refund.

c4m0-lab commented 1 week ago

thanks for this - its awsome! Its my first unkown device.

I only have the problem that no image is displayed and when the power is "?". Does anyone know how to get this clean?

after this I need to look how to get the device not to be so chatty :)

DrTrotty commented 1 week ago

Hello. I have been corresponding with the manufacturer for some time. Does anyone have liquid_depth_max setting working? If so, did you buy it on Ali Express or directly from the manufacturer? The person I correspond with says it works. He also sent a video...let's say, it doesn't show whether the device is Wi-Fi, He says it's zigbee. That's our firmware version.

DrTrotty commented 1 week ago

This value does not work on my phone in the Tuya application either. Would it be possible to use a different gateway? There are miracles...

c4m0-lab commented 1 week ago

It was a long way yesterday.. but I think that works for me.. its zigbee and buyed by amazon. But I am still in the testing..

Zigbee2MQTT – Home Assistant

ps: I am using slzb-06

DrTrotty commented 1 week ago

When doing tests please check the parameter liquid_depth_max, for me it does not work because the liquid_depth and liquid_level_percent does not after I change liquid_depth_max.

c4m0-lab commented 1 week ago

first test worked. I cannot empty it, so I have to wait until it does it by itself (1-2 weeks). But by testing before the installation, it took some time but did it. I had to enter the value a few times one after the other until he took it.

PS: After every change some strange values where there but they normalized after some minutes.

DrTrotty commented 1 week ago

In case anyone else is interested...more correspondence with the manufacturer, they swear they checked the stock, all their zigbees devices work perfectly...maybe I bought a fake on ali express? When I get to the end, I'll order one from them, and I'll write about the progress.

c4m0-lab commented 3 days ago

after testing it a while it works :)

the only problem is it seems to send every second an update ... don't know how to fix that..

Vinsssounet commented 2 days ago

Hi there !

I'd like to purchase this device to use with Home Assistant.

I'm reading different things on this thread.

It seems the liquid depth max setting does not work for some people, but there's a workaround by using the current depth and calculating the percentage with a custom sensor ?

Are some people actually able to use thé device as intended ?

jesse-kaufman commented 1 day ago

Yes, max depth doesn’t change any of the sensor readings but it really isn’t necessary when you can create your own template sensor to calculate the % .. I’m using the device regularly, rely on it to notify me when the water is low, and it’s been working great. The max depth thing not working doesn’t affect my setup at all

Vinsssounet commented 1 day ago

Thank you, I'm gonna give it a a go 😉