Zigbee2mqtt: Added Tuya ME201WZ level sensor

The database is stored in the Docker volume that you pass as a parameter to your docker run.

On the site’s command it’s explained just below:

So find the folder you set during your docker run, and empty the contents of that folder.

Then restart Gladys and you should end up on a fresh new instance!

1 Like

Hello,
I bought exactly the same sensor that I should receive this week :slight_smile:
I’d like to help you with the tests; I’d like to be able to install a test instance in parallel with my production (on my mini PC with a Zigbee USB dongle) but I don’t want to break anything.
I thought I had seen a tutorial somewhere but I can’t find it anymore.

Hi @Nagromdark
Can you tell us a bit more about your current setup?
We can then better advise you on how to set up a test Gladys.
FYI I’m picking mine up today :blush:

Hi @mutmut,
I found the tutorial and followed it: Tutoriel: Lancer une image Docker de test
I followed the tutorial and installed the test image by doing this:

sudo docker run -d \
--log-driver json-file \
--log-opt max-size=10m \
--cgroupns=host \
--restart=always \
--privileged \
--network=host \
--name gladys-zigbee2mqtt-tuya-me201wz-test \
-e NODE_ENV=production \
-e SERVER_PORT=8001 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladys-zigbee2mqtt-tuya-me201wz-test:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
gladysassistant/gladys:zigbee2mqtt-tuya-me201wz

I made sure to change the port and the storage space.
The instance is accessible on port 8001, no problem. But where I started having issues was with the MQTT broker and Zigbee2MQTT that I wanted to connect to the test instance. I thought that both Gladys instances could be connected to these containers but when I enable it on one it disconnects the other, it seems..
So for now I’ve stopped the test instance to avoid risking my production :slight_smile:

Here are my containers:

CONTAINER ID   IMAGE                                             COMMAND                  CREATED             STATUS                      PORTS                                         NAMES
caffb1ddd7e6   koenkk/zigbee2mqtt:1.42.0                         "docker-entrypoint.s…"   43 minutes ago      Up 43 minutes                                                             gladys-z2m-zigbee2mqtt
e2b29c057af6   eclipse-mosquitto:2.0.15                          "/docker-entrypoint.…"   44 minutes ago      Up 43 minutes                                                             gladys-z2m-mqtt
f869709d2ec6   eclipse-mosquitto:2.0.15                          "/docker-entrypoint.…"   About an hour ago   Up 48 minutes                                                             eclipse-mosquitto
55728634212e   gladysassistant/gladys:zigbee2mqtt-tuya-me201wz   "docker-entrypoint.s…"   About an hour ago   Exited (0) 45 minutes ago                                                 gladys-zigbee2mqtt-tuya-me201wz-test
22290cf834c4   nodered/node-red:3.1                              "./entrypoint.sh"        2 weeks ago         Up 2 weeks (healthy)        0.0.0.0:1881-\u003e1880/tcp, [::]:1881-\u003e1880/tcp   gladys-node-red
a5e4134c21d6   gladysassistant/gladys:v4                         "docker-entrypoint.s…"   2 weeks ago         Up 2 weeks                                                                gladys
942fa3b70db8   containrrr/watchtower                             "/watchtower --clean…"   3 weeks ago         Up 3 weeks (healthy)        8080/tcp                                      watchtower

And one question in passing: I don’t understand the difference between gladys-z2m-mqtt and eclipse-mosquitto, it’s the same image but with two different names, if someone can enlighten me :wink:
Thanks for your help

First, for your question :

Your container named gladys-z2m-mqtt is your MQTT instance which is based on the eclipse-mosquitto image, so it’s normal that they have the same size.

Regarding your procedure, everything is perfect up until the moment of adding MQTT to your test Gladys.
I think you enabled MQTT like this :


But you need to uncheck the option and enter the parameters which should be these :

To find your MQTT password and username (and maybe the server), I’ll let you see @pierre-gilles’s explanation here

There are 2 containers that use the mosquitto image; that’s normal.
There is an MQTT container for zigbee2mqtt and another MQTT container for the MQTT integration.
These 2 integrations do not use the same container.

@pierre-gilles I was able to install the latest version of your build. And I can see the module in the Zigbee integration under added devices, with 6 features:

And when I go to the dashboard and add a « Devices » block, I can choose 4 of these features:

I confirm that the unit in ‹ m › and the names are handled correctly :+1:

The two missing features (‹ Installation height › and ‹ Maximum liquid depth ›) are not a concern, I think, because they are not data that will vary: they are the parameters to configure in zigbee2mqtt to size the tank and for the ‹ Liquid level (percentage) › feature to be calculated by the module.

I think you shouldn’t try to retrieve them from the device definition in Gladys. (I didn’t list them in my initial request.)

3 Likes

Thanks so much @mutmut and @_Will_71, I managed to launch a test instance in parallel on the same PC and I’m using the same zigbee2mqtt and broker as production. It’s perfect — messages are arriving fine in both instances :slight_smile:
I just have to wait for the sensor to test (hopefully tomorrow), but I see that @StephaneB has already done everything ^^
At least now I know how to install a test image, now I just need to set up a dev environment but I’d need another PC ^^

4 Likes

Thanks for testing @StephaneB :slight_smile:

Ok, so I’ll remove them if they’re not useful — better not to clutter if it’s a parameter and not data!

[quote=« Nagromdark, post:28, topic:9495 »]
Great thanks @mutmut and @_Will_71, I managed to run a test instance

1 Like

Hello,

as for me it works well too:

You need to set the maximum liquid height and the sensor’s positioning height in zigbee2mqtt, and that’s it.

I just installed it, but for those wondering this sensor is really very accurate — not bad! We’ll see over the next few days whether the readings are correct

2 Likes

I can’t wait to have it in production :yum: so I can refine my automatic watering scenes (water for a shorter time if the level becomes low) and secure the operation of my lift pump (disable it if the water level becomes critical, to prevent it from losing its prime).

I love all these little scenarios that Gladys lets me create! Thanks @pierre-gilles :+1::+1:

1 Like

It’s coming soon! I’m working on Gladys tomorrow :slight_smile:

2 Likes

I received mine yesterday and what a nightmare for testing :weary:
I took the solar version, I thought it might be coming from that but no.

I tried putting it under a chair to get the distance, without much success because I got negative or positive distances, probably because I didn’t manage to configure the module.
I then tested with a water carafe and that was better but I had a small rather odd difference.
And today I installed it on my tank, the values seem good but you have to be super precise in the setup and therefore understand it well :frowning:

And finally, I have a few issues getting the module to apply my new settings, I don’t know if it’s due to my z2m which is on 2.2.1 or my SLZB-06M antenna which is on ember.
Anyway, I have a bit of investigating to do, sorry for not bringing more positive feedback.

1 Like

Isn’t it a holiday? :wink:

It’s fine, it’s been removed from the PR, I rebuilt a Docker image with the same tag!

I don’t take public holidays, I prefer to work so things move forward! :slight_smile:

1 Like

@mutmut, I have the mains-powered version but I think it’s the same. Be careful, it works with ultrasound from what I understand so you need to position it in the middle of the tank and not near the water inlet. It shouldn’t be close to the walls, you need a fairly large tank otherwise the signal will bounce off the walls. So a glass of water won’t work :blush:

For the configuration you need to measure the maximum height the water can reach and also the height at which your sensor is positioned. For example I have 0.83 and 1.05 for those values and the reported % is correct. If it doesn’t look correct you need to tweak those values until it does

2 Likes

A quick question about the device:
Do ultrasound waves pass through the wall, or does there need to be a hole in the wall where the device is placed?

You need a clear passage (not necessarily a hole) otherwise it gets stuck.

For my part, I had to secure the module inside the cap because there wasn’t enough space above my tank and so I didn’t need to drill :wink: (ok, I still made a 25mm diameter hole to pass the cable and install 4 screws)

Thank you @Nagromdark, that’s also what I do to get the best result. On my side I set 1.02m (module in the cap and not above) and 0.96m for my overflow. However, these are values I took from the outside because I don’t have room above my tank to access it (I only have 5 cm of clearance) and the lengths are not necessarily exact.

@pierre-gilles I’ve tested this new image, and it’s all good for me.

1 Like