Tuya liquid level sensor TZE200_lvkk0hdg (shipping box labelled TLC2206-ZB-EU)

Hello!

I plan to purchase a Tuya liquid level sensor TZE200_lvkk0hdg, but I’m not sure if it is supported.

According to this thread, there are some problems, but I don’t know if this means that it won’t work with deCONZ, specifically with my ConBee III stick:

More is there:

Thanks for sharing your thoughts! :+1:

Nope, there is nothing in Deconz tu support this device.
And we need lot of new field, like percent, height, depth, and ect, so will be problem for integration.

1 Like

Please excuse my question (as I’m just a user with little experience about development): Could I contribute to make it work by buying the device and providing any kind of helpful debug info etc.?

If this is a dead end, should I rather follow the guidance from the Home Assistant forum, introducing a “quirk” and using ZHA?

Alternatively, there is the same device with WiFi instead of ZigBee.

This device is used a lot, I can see lot of issue with it, and lot of informations, but if you want a basic support not so hard
for exemple

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_lvkk0hdg",
  "modelid": "TS0601",
  "vendor": "Tuya",
  "product": "Tuya liquid level sensor",
  "sleeper": true,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_WATER_LEAK_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0xEF00"
      ],
      "items": [
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
         "name": "config/tuya_unlock"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0000",
            "at": "0x0001",
            "script": "tuya_swversion.js"
          },
          "read": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0000",
            "at": "0x0001"
          }
        },
        {
          "name": "cap/measured_value/max",
          "parse": {
            "fn": "tuya",
            "dpid": 7,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 7,
            "dt": "0x2b",
            "eval": "Item.val;"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "cap/measured_value/min",
          "parse": {
            "fn": "tuya",
            "dpid": 8,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 8,
            "dt": "0x2b",
            "eval": "Item.val;"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "cap/measured_value/quantity",
          "static": "level"
        },
        {
          "name": "cap/measured_value/substance",
          "static": "percent"
        },
        {
          "name": "cap/measured_value/unit",
          "static": "%"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/measured_value",
          "read": {
            "fn": "none"
          },
          "parse": {
            "dpid": 22,
            "eval": "Item.val = Attr.val;",
            "fn": "tuya"
          },
          "default": 0
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ]
}

This DDF can support min/max set and return a % level.
But This DDf is random I have used min/max, but I think it will be better to use installation_height (19) and liquid_depth_max(21) to set min/max.

And I m using a ZHAWater, so can be a problem in HA, better to use for exemple a ZHAGauge.

1 Like

I’ve ordered it and wait for its delivery. When it has arrived, I’ll revisit this thread and might have more questions and hopefully also something to give back to you and the community. :blush:

Sure, I can use bad dpid on the previous DDF (I realy have no clue how this device is working), but the logic is here.
Unfortunately as it use Tuya cluster, not possible to use the GUI to set value, we will need to use the debug log.
For memory dpid from Z2M (I m using 22/7/8 on the DDF)

      [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],
      [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],

Hello @Smanar

Sorry that it took so long! The device has arrived, but I already fail to get it paired with my ConBee III. There is a button to press (short/long, all tested) and LEDs along with it (green, red, blue), but when I search for a new sensor in the Phoscon GUI, the new device is not found. Maybe I am missing something obvious to you or others? If that’s the case, please be patient with me and help me to better understand the proper approach. I really appreciate it! :blush: And I will be happy to provide feedback from my end that might help other users of this tank level sensor (labelled on its shipping box with “TLC2206-ZB-EU”). For now, I cannot do so, as I don’t understand how to pair it. :thinking:

What is your OS ?
Have you created the DDF from this post Tuya liquid level sensor TZE200_lvkk0hdg (shipping box labelled TLC2206-ZB-EU) - #4 by Smanar
If you have a normal OS

All DDF provided directly with deCONZ typically reside in /usr/share/deCONZ/devices/on a Linux system and are loaded first. However, files residing in the home directory of the user running deCONZ (e.g./home//.local/share/dresden-elektronik/deCONZ/devices) will override the pre-packaged files to allow users to amend and keep their own files if desired.

Just need to create a text file called whatyouwwant.json with the DDF contain (in the devices/tuya folder if possible), they restart deconz (deconz load DDF only at start)

If you are using docker will be another story.

Take care, now you have the device the model ID and the manufacture name can be different (tuya cloning)

You can check them using the GUI ? How to read Clusters · dresden-elektronik/deconz-rest-plugin Wiki · GitHub

About the pairing procedure.
When you include the device on deconz, it will be visible on deconz (the GUI).
But if the device is not supported in the API, you can’t see it in Phoscon yet, you need the DDF for that.

1 Like

It’s a bit complicated: My ConBee III USB stick is attached to my Synology NAS, which runs Home Assistant and deCONZ integration. So yes, docker containers are involved. I have /mnt/data/supervisor/addons/data/core_deconz/.local/share/deCONZ/devices/.

I first create a folder like so:

mkdir -p /mnt/data/supervisor/addons/data/core_deconz/.local/share/deCONZ/devices/tuya

… and then store mydevice.json there. However, after every Home Assistant deCONZ add-on restart, it reverted to some default. After some further investigations I learnt that I need to put it rather there:
/mnt/data/supervisor/addons/data/core_deconz/.local/share/dresden-elektronik/deCONZ/devices/tuya

Not there:
/mnt/data/supervisor/addons/data/core_deconz/.local/share/deCONZ/devices/tuya

With your initial code (many thanks again! :heart:) slightly amended:

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_lvkk0hdg",
  "modelid": "TS0601",
  "vendor": "Tuya",
  "product": "Tuya liquid level sensor (TLC2206-ZB-EU)",
  "sleeper": false,
  "status": "Gold",
  "path": "/devices/tuya/tlc2206_lvkk0hdg.json",
  "subdevices": [
    {
      "type": "$TYPE_WATER_LEAK_SENSOR",
      "restapi": "/sensors",
      "uuid": ["$address.ext", "0x01", "0xEF00"],
      "items": [
        { "name": "attr/lastannounced" },
        { "name": "attr/lastseen" },
        { "name": "attr/manufacturername" },
        { "name": "attr/modelid" },
        { "name": "attr/name" },
        {
          "name": "attr/swversion",
          "parse": { "fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js" },
          "read":  { "fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001" }
        },
        { "name": "attr/type" },
        { "name": "attr/uniqueid" },

        {
          "name": "cap/measured_value/max",
          "read":  { "fn": "none" },
          "write": { "fn": "tuya", "dpid": 7, "dt": "0x2b", "eval": "Item.val;" },
          "parse": { "fn": "tuya", "dpid": 7, "eval": "Item.val = Attr.val;" },
          "default": 0
        },
        {
          "name": "cap/measured_value/min",
          "read":  { "fn": "none" },
          "write": { "fn": "tuya", "dpid": 8, "dt": "0x2b", "eval": "Item.val;" },
          "parse": { "fn": "tuya", "dpid": 8, "eval": "Item.val = Attr.val;" },
          "default": 0
        },
        { "name": "cap/measured_value/quantity", "static": "level" },
        { "name": "cap/measured_value/substance", "static": "water" },
        { "name": "cap/measured_value/unit", "static": "%" },

        { "name": "config/on" },
        { "name": "config/reachable" },
        { "name": "config/tuya_unlock", "public": false, "refresh.interval": 86400, "default": false },

        { "name": "state/lastupdated" },

        {
          "name": "state/measured_value",
          "read":  { "fn": "none" },
          "parse": { "fn": "tuya", "dpid": 22, "eval": "Item.val = Attr.val;" },
          "default": 0
        },

        {
          "name": "state/water",
          "parse": { "fn": "tuya", "dpid": 22, "eval": "Item.val = Attr.val > 0;" },
          "default": false
        }
      ]
    }
  ]
}

… the tank level sensor appeared as “water 133” (I meanwhile renamed it) in the GUIs.

deCONZ:

Phoscon:

Home Assistant:

So with your very kind help I made progress. :blush: Since I was very much occupied in my job during the last weeks, I was not able to reply earlier or to test the water level function. I plan to test more and report here again.

Kind regards
7wells

Yep, there is a persisten folder for Ha in /data/.local/share/dresden-elektronik/deCONZ/devices/

And same for me, I will go to scotland for a week so I will be not here for some days.

1 Like

I have updated my code, because it only showed dry/wet (binary_sensor), whereas I am of course interested in a sensor with a value in percentage. And I have renamed the device.

EDIT: I had pasted wrong code below, but this is what I use and see in deCONZ for my water level device:

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_lvkk0hdg",
  "modelid": "TS0601",
  "vendor": "Tuya",
  "product": "Tuya liquid level sensor (TLC2206-ZB-EU)",
  "sleeper": false,
  "status": "Gold",
  "path": "/devices/tuya/tze200_lvkk0hdg.json",
  "subdevices": [
    {
      "type": "ZHAHumidity",
      "restapi": "/sensors",
      "uuid": ["$address.ext", "0x01", "0xEF00"],
      "items": [
        { "name": "attr/lastannounced" },
        { "name": "attr/lastseen" },
        { "name": "attr/manufacturername" },
        { "name": "attr/modelid" },
        {
          "name": "attr/name",
          "default": "Water level (%)"
        },
        {
          "name": "attr/swversion",
          "parse": { "fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js" },
          "read":  { "fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001" }
        },
        { "name": "attr/type" },
        { "name": "attr/uniqueid" },

        { "name": "config/on" },
        { "name": "config/reachable" },
        { "name": "config/tuya_unlock", "public": false, "refresh.interval": 86400, "default": false },

        {
          "name": "config/installation_height_cm",
          "read":  { "fn": "none" },
          "write": { "fn": "tuya", "dpid": 15 },
          "parse": { "fn": "tuya", "dpid": 15, "eval": "Item.val = Attr.val;" },
          "unit": "cm",
          "default": 0
        },
        {
          "name": "config/max_liquid_depth_cm",
          "read":  { "fn": "none" },
          "write": { "fn": "tuya", "dpid": 16 },
          "parse": { "fn": "tuya", "dpid": 16, "eval": "Item.val = Attr.val;" },
          "unit": "cm",
          "default": 0
        },

        { "name": "state/lastupdated" },

        {
          "name": "state/humidity",
          "read":  { "fn": "none" },
          "parse": { "fn": "tuya", "dpid": 22, "eval": "Item.val = Attr.val;" },
          "unit": "%",
          "default": 0
        }
      ]
    }
  ]
}

I am still experimenting with the device in order to correctly calibrate it.

PS: Scotland is a really nice country with very pleasant people as I experienced last year. I hope you enjoy it! :scotland:

Yep, was fine ^^.

And about your DDF you are using third app or only phoscon ?
Because you are right you have a binary sensor, a ZHAWater, but this one need to have fields state/measured_value with percent value, nope ?

I don’t understand the second sensor you are trying to create (the ZHAhumidity) and this one have synthax problem, you have used ChapGPT ?

I have not yet used the Tuya or some other app besides the (Android) Phoscon app, the Phoscon GUI, and the deCONZ GUI, but maybe calibration is only possible via the Tuya or a similar app?

After I have applied the code that I recently posted here, I only see one sensor for my device, i.e. a humidity sensor and a value with the unit of percentage, which is good to my understanding. I no longer see the binary sensor, which is good, because dry/wet does not make sense for measuring the water level in my rain water cistern.

Thanks for your hint about a syntax error; however, I don’t know what exactly you mean. Would you mind pointing it out to me?

EDIT:
My bad, I pasted wrong code in my post above. This is what I use:

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_lvkk0hdg",
  "modelid": "TS0601",
  "vendor": "Tuya",
  "product": "Tuya liquid level sensor (TLC2206-ZB-EU)",
  "sleeper": false,
  "status": "Gold",
  "path": "/devices/tuya/tze200_lvkk0hdg.json",
  "subdevices": [
    {
      "type": "ZHAHumidity",
      "restapi": "/sensors",
      "uuid": ["$address.ext", "0x01", "0xEF00"],
      "items": [
        { "name": "attr/lastannounced" },
        { "name": "attr/lastseen" },
        { "name": "attr/manufacturername" },
        { "name": "attr/modelid" },
        {
          "name": "attr/name",
          "default": "Water level (%)"
        },
        {
          "name": "attr/swversion",
          "parse": { "fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js" },
          "read":  { "fn": "zcl:attr", "ep": 1, "cl": "0x0000", "at": "0x0001" }
        },
        { "name": "attr/type" },
        { "name": "attr/uniqueid" },

        { "name": "config/on" },
        { "name": "config/reachable" },
        { "name": "config/tuya_unlock", "public": false, "refresh.interval": 86400, "default": false },

        {
          "name": "config/installation_height_cm",
          "read":  { "fn": "none" },
          "write": { "fn": "tuya", "dpid": 15 },
          "parse": { "fn": "tuya", "dpid": 15, "eval": "Item.val = Attr.val;" },
          "unit": "cm",
          "default": 0
        },
        {
          "name": "config/max_liquid_depth_cm",
          "read":  { "fn": "none" },
          "write": { "fn": "tuya", "dpid": 16 },
          "parse": { "fn": "tuya", "dpid": 16, "eval": "Item.val = Attr.val;" },
          "unit": "cm",
          "default": 0
        },

        { "name": "state/lastupdated" },

        {
          "name": "state/humidity",
          "read":  { "fn": "none" },
          "parse": { "fn": "tuya", "dpid": 22, "eval": "Item.val = Attr.val;" },
          "unit": "%",
          "default": 0
        }
      ]
    }
  ]
}

EDIT end

And yes, I tend to use AI tools when I face difficulties. I know that this is not always welcome in the forum community from what I have read. Hopefully, this does not make you or other readers angry. :wink:

Nope, it’s because Phoscon is not able to display all field, it have more limitation than a classic application, like OpenHAB, Home assistant, NoreRed or others.

You can take a look in Phocon/help/Api information/sensors to see the raw data from the device, you probably will see the percent.

If you want to stay with Phoscon, we can make a “hack” and use a ZHAhumidity to display a level percent instead of the humidity, but it mean this DDF will be only for you, not possible to make it official one day.

Your device is powered ? Because 80% of battery powered device are sleeper.

This is useless, just use

{ "name": "config/tuya_unlock"}

No, it’s not the problem, but you aren’t new on Deconz, you know sometime to add a new device, just need to edit 2 lines with the model id and the manufacture, but IA are not able to read instructions, and an user that read the instruction is faster than an IA to make correct DDF.
Actually there is code in your DDF, I don’t see what is he doing there, and I think you neither So what we need to do with it …

On my side when I use a previous DDF to make a new one (I never create a DDF from scratch), I remove all the code I don’t see the need.

        {
          "name": "state/humidity",
          "read":  { "fn": "none" },
          "parse": { "fn": "tuya", "dpid": 22, "eval": "Item.val = Attr.val;" },
          "default": 0
        }

But I don’t see why this part is not working, you have a “0” value ?
Perhaps the tuya unlocking haven’t worked, try to correct this line and re-include the device (the unlock happen at inclusion and every 24h)

1 Like

Thanks a lot! I am not new on deconz, but hitherto I never dealt with DDF files, so thanks for your patience and also your good advice to challenge what AI tools tell me (well, I try to remember this :wink:). Let me experiment a bit further before I come back here.

By the way, the AI suggests that I create a template sensor to deal with calibration etc. I am not yet sure if/to which extent this makes sense but have to find out.

If this sensor could be supported officially, I would prefer it, as other users could use it out-of-the-box one day. But for now I am also very grateful to get further ideas how to get this working for myself first. Maybe it is nevertheless helpful for one or the other user of this tank level sensor.

And yes, the device is indeed powered (no batteries).

Exactly, for the moment, we can make it working for you using the “hack” ( = using a ZHAhumidity)

By the way, the AI suggests that I create a template sensor to deal with calibration etc. I am not yet sure if/to which extent this makes sense but have to find out.

IDK, the IA know probably better than me how deconz is working.
But just show me your result, it possible to set a min and a max if needed using the dpid 7 and 8.
(you have a “not tested” code on my first DDF )

If you want to test with a ZHAHumidity

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_lvkk0hdg",
  "modelid": "TS0601",
  "vendor": "Tuya",
  "product": "Tuya liquid level sensor",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_HUMIDITY_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0xEF00"
      ],
      "items": [
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
         "name": "config/tuya_unlock"
        },
        {
          "name": "attr/swversion",
          "parse": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0000",
            "at": "0x0001",
            "script": "tuya_swversion.js"
          },
          "read": {
            "fn": "zcl:attr",
            "ep": 1,
            "cl": "0x0000",
            "at": "0x0001"
          }
        },
        {
          "name": "cap/measured_value/max",
          "parse": {
            "fn": "tuya",
            "dpid": 7,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 7,
            "dt": "0x2b",
            "eval": "Item.val;"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "cap/measured_value/min",
          "parse": {
            "fn": "tuya",
            "dpid": 8,
            "eval": "Item.val = Attr.val;"
          },
          "write": {
            "fn": "tuya",
            "dpid": 8,
            "dt": "0x2b",
            "eval": "Item.val;"
          },
          "read": {
            "fn": "none"
          }
        },
        {
          "name": "cap/measured_value/quantity",
          "static": "level"
        },
        {
          "name": "cap/measured_value/substance",
          "static": "percent"
        },
        {
          "name": "cap/measured_value/unit",
          "static": "%"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/measured_value",
          "read": {
            "fn": "none"
          },
          "parse": {
            "dpid": 22,
            "eval": "Item.val = Attr.val;",
            "fn": "tuya"
          },
          "default": 0
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ]
}