Zigbee2mqtt: Added Tuya ME201WZ level sensor

Darn, I’m in the process of making a scene to display the remaining water volume and to automate everything, I need to retrieve the installation_height and I’m also looking for the liquid_depth_max.
For now I’m using custom topics.

@Nagromdark @StephaneB did you have any issues when you set the Liquid depth max on Z2M ?
I change the value and about 30s later it copies the value of Installation height back into it.
I can’t get it to keep my changes and I don’t understand why… The problem afterwards is that the percentage is wrong :frowning:

and here’s the result on the dashboard (on the right):


Since I can’t change the max water height in z2m, I’m redoing a full calculation of the remaining % with my manually set max water height value:
![image|282x500, 75%](upload://obwgrRAS

1 Like

Actually, I hadn’t configured a different value for the two. I’m not yet doing a real installation on my tank, it’s planned for tomorrow. So during my tests above a water bucket in my garage, I hadn’t looked at that :wink:

I just ran the test, and no particular issue: in z2m, I set ‹ installation height › to 1.7m and ‹ liquid depth max › to 1.6m, and it stays saved.

That said, I thought I briefly saw an effect like the one you describe when I modified one of the two values by clicking the arrow (between the numeric value and the unit ‹ m ›): the other value was automatically changed. But then I modified the values by typing the numeric value directly, and since then they haven’t moved… Could that be where your issue comes from?

And another note: I find that in z2m the description of ‹ liquid depth max › is incorrect, because it says « Height from sensor to liquid level ». Whereas in fact, it’s more like « Height from tank bottom to maximal liquid level », right? In any case, that’s how I understand it after reading the sensor user manual :

I understand the same as you, Stéphane, regarding the liquid depth max :+1:

Hi @StephaneB, indeed I also have an issue with the value that is being regularly overwritten. I’ve just updated it; I’ll keep an eye on it.
I’ve seen some zigbee2mqtt errors:

2025-05-09 11:05:21 zh:ezsp:ezsp: Frame changeSourceRouteHandler parsing error: RangeError [ERR BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds

2025-05-09 11:05:21 zh: ezsp:ezsp: Unparsed frame 0xc4. Skipped

2025-05-09 11:05:33 zh: ezsp:ezsp: Frame changeSourceRouteHandler parsing error: RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds

2025-05-09 11:05:33 zh:ezsp:ezsp: Unparsed frame 0xc4. Skipped

2025-05-09 11:07:23 zh:ezsp:ezsp: Frame changeSourceRouteHandler parsing error: RangeError [ERR BUFFER_OUT_OF_BOUNDS): Attempt to access memory outside buffer bounds

2025-05-09 11:07:23 zh: ezsprezsp: Unparsed frame 0xc4. Skipped

2025-05-09 11:09:24 zh: ezspiezsp. Frame changeSourceRouteHandler parsing error: RangeError [ERR_BUFFER_OUT_OF BOUNDS]: Attempt to access memory outside buffer bounds

2025-05-09 11:09:24 zh:ezsp:ezsp: Unparsed frame 0xc4. Skipped

I’m in agreement with you @StephaneB
And when you look at the sensor doc you were considering at the beginning (TLC2206), it does say Sensor to full line like the Zigbee2MQTT (z2m) docs:

I don’t know because I tested both and it’s the same. What I can’t explain is that at one point it had taken my changes into account.
What’s crazy is that z2m sends the payload and then it switches back to the original value without error, and I don’t know in which direction (module\u003ez2m or z2m\u003emodule) :

I’m going through this sensor test and the guy also had issues via Zigbee2MQTT (z2m) and explains his configuration.

1 Like

By tinkering via HA (Home Assistant) as shown in the article, I was able to change the numbers and they stay at their values!


For the hardware, I’m

On my side, no problem with this separate setting of ‹ installation height › and ‹ liquid depth max ›, simply in Z2M by modifying the values. I made the adjustment around 17:30, and it’s still correctly configured 2 hours later…

However, I have another issue on my side, I’ll need to bring out the pickaxe and shovel :wink: : Actually, my tank is a small 2m3 model, without an inspection opening and completely buried. So back then (16 years ago), I had just put in a kind of small ‹ chimney › that protrudes above the ground to be able to see inside the tank…

Basically, it’s installed like this:

This chimney is narrow (10cm in diameter, 25cm high) and the level sensor installed at the top doesn’t like it: it probably detects the edge of this chimney, so the reported value is wrong.

So tomorrow, pickaxe and shovel to reach the surface of the tank, and install the sensor directly there :wink:

However, this detection error leads to a strange calculation of the tank filling by the module: I configured 1.82m for the installation height and 1.55 for the liquid depth max. And because my sensor detects the vent pipe, it returns a ‹ liquid depth › value of 1.72m. I therefore deduce that it detects the vent pipe 10cm below the sensor. ok.

However, I expected a percentage calculation based on the liquid depth max of 1.55, which could have shown me a percentage of 111%, or possibly 100% (if the sensor corrects by considering that it cannot exceed the max).

But in fact it gives me a percentage of 94%, therefore calculated relative to the ‹ installation height ›… Strange behavior. Because in that case I don’t see what the liquid depth max is used for.

Unless it is the fact that exceeding this max value triggers an alternative percentage calculation based on the ‹ installation height › (a kind of safety in the module’s software…)

Well in the end, not a big deal for me because my sensor will be installed tomorrow directly on the ‹ ceiling › of the tank, so I’ll have installation height = max liquid depth = 1.55m, so no percentage calculation issue…

I’m often told that home automation is a geek thing, and that I spend my time on my computer configuring ‹ stuff ›…

Well yes, maybe, but not just that… Home automation also involves earthmoving :face_savoring_food:


6 Likes

This new feature is available in Gladys Assistant 4.58: