Aqara W100 sensor/thermostat — temperature and humidity sensor Zigbee Matter Thread

I tested with

sudo docker run \
   --name gladys-z2m-zigbee2mqtt \
   --restart=unless-stopped \
   --network=host \
   --device=/dev/serial/by-id/usb-1a86_TubesZB_971207DO-if00-port0 \
   -v /var/lib/gladysassistant/zigbee2mqtt/z2m:/app/data \
   -v /run/udev:/run/udev:ro \
   -e TZ=Europe/Paris \
   ghcr.io/koenkk/zigbee2mqtt:2.3.0

Still getting the connection error.

I added

--cgroupns=host \

Still the same

--group-add dialout \

Still the same

--privileged \

Still the same

--user 1001:1001 \
--group-add dialout \

Error: EACCES: permission denied, mkdir ‹ /app/data/log/2025-05-19.22-57-37 ›
at Object.mkdirSync (node:fs:1364:26)
at Logger.init (/app/lib/util/logger.ts:75:16)
at new Controller (/app/lib/controller.ts:46:16)
at start (/app/index.js:147:18)

So still no connection to MQTT

I just checked what I set for node-red.
there is

--privileged \
-u root \
--network=host \

I’ll have to try that, since it’s not Gladys that installs zigbee2mqtt, there may be a file permissions incompatibility.

Well, that didn’t work.
I put quotes around the password and the username as mentioned here
MQTT failed to connect: Connection refused: Not authorized · Issue #11148 · Koenkk/zigbee2mqtt · GitHub

In Integration > Configuration > MQTT

The password does not match the one stored in my zigbee2mqtt configuration.yaml file, is that normal?
I tried changing it but still no connection.
I also wonder if I used the correct port

I also notice that in my tests if I rerun

sudo docker run \
   --name gladys-z2m-zigbee2mqtt \
   --restart=unless-stopped \
   --device=/dev/serial/by-id/usb-1a86_TubesZB_971207DO-if00-port0 \
   -p 8080:8080 \
   -v /var/lib/gladysassistant/zigbee2mqtt/z2m:/app/data \
   -v /run/udev:/run/udev:ro \
   -e TZ=Europe/Paris \
   ghcr.io/koenkk/zigbee2mqtt:2.3.0

I got

error: 	z2m: MQTT failed to connect, exiting... ()

And Not

error: 	z2m: MQTT failed to connect, exiting... (Connection refused: Not authorized)

Yes, that’s normal. Gladys launches 2 separate Mosquitto containers, one for the MQTT integration and the other for the Zigbee2mqtt integration; they are not the same broker.

The one for the Zigbee2mqtt integration is available on port 1884.

If you don’t set network=host, it physically can’t work :slight_smile: Gladys must be able to access the mosquitto container.

@pierre-gilles
When you « Enable or disable the service » of « Zigbee2mqtt service configuration »
Does that change the password? I notice it’s not the same as the one I have in production compared to the one I have in my backup. In short, I probably ran all my tests with the wrong password.

This time, with the correct password it worked the second time; the first time I ran into the 600 ms problem.

The NOUS outlets and a NOUS D2Z smart switch also require an update; I saw that you haven’t done it yet and that it works, so I’ll wait. I’ll test with a non-critical outlet.

1 Like

Great, glad it worked :slight_smile: So the Aqara thermostat is properly supported?

For the NOUS plugs, it’s the Child Lock that disappears from Gladys as I posted here.
On my side I haven’t done the update because the Child Lock will only be accessible via the z2m interface.

Some reading on the review of the Aqara W100.

Yes




However, the « authorize pairing » button wouldn’t work;
If I activated it on Gladys it showed « disable » on Zigbee2MQTT.

I haven’t tried to configure the thermostat; for now I have a problem with a solenoid valve
https://www.domadoo.fr/fr/destockage/7212-saswell-electrovanne-et-programmateur-d-arrosage-connecte-zigbee.html
Which wasn’t recognized and I had found an external extension to make it work.
But now in 2.3.0 my file is empty with a .invalid extension at the end.
I haven’t found a modified file for 2.3.0
This valve floods my pellet boiler if the temperature exceeds a certain threshold.
I’ll probably have to replace it; if you know of one that works well, responsive, with no unexpected disconnections, I’m interested.

Ok thanks for the feedback, there are surely adjustments to be made on the Gladys side with this new version of Zigbee2mqtt :slight_smile:

In the meantime use the pairing button in Zigbee2mqtt!

Well I ordered this one:
https://www.domadoo.fr/fr/peripheriques/5685-woox-controleur-d-arrosage-intelligent-onoff-zigbee-30-8435606701198.html?domid=17

However @pierre-gilles if you could add on Gladys to the left of our name and photo for example a « Store » button with the partner links that redirect to amazon, domadoo your mini PC gladys+.
Because I still had to go digging through the forum to find out which code to add to the domadoo link — that would make it direct.

1 Like

@pierre-gilles I have a big problem.
I blew the fuses so no power for Gladys.
On restart Gladys reinstalled version 1.42.0
and

argh that’s not cool :frowning:
To avoid all these issues, I use Docker Compose and Portainer.
Docker Compose lets me install whatever I want and freeze the versions, and Portainer lets me manage all of that with a nice graphical interface (with access to logs, CPU/RAM/disk stats, etc.).
You create the volume for Portainer once:

docker volume create portainer_data

And the docker run command you run is:

docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

then you can connect at http://your-machine-ip:9000
I created a Stack named gladys-assistant where I put the Docker Compose:

version: "3"

services:
  gladys:
    image: gladysassistant/gladys:v4
    container_name: gladys
    restart: always
    privileged: true
    network_mode: host
    cgroup: host
    logging:
      driver: "json-file"
      options:
        max-size: 10m
    environment:
      NODE_ENV: production
      SQLITE_FILE_PATH: /var/lib/gladysassistant/gladys-production.db
      SERVER_PORT: 80
      TZ: Europe/Paris
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/lib/gladysassistant:/var/lib/gladysassistant
      - /dev:/dev
      - /run/udev:/run/udev:ro

  watchtower:
    image: containrrr/watchtower
    restart: always
    container_name: watchtower
    command: --cleanup --include-restarting
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

and to that you can add your Matterbridge, your dedicated z2m, your MQTT broker, your zwavejs-ui, Node-RED, etc. if, of course, you want to manage it instead of Gladys.

  matterbridge:
    container_name: matterbridge
    image: luligu/matterbridge:latest # Matterbridge image with the latest tag
    network_mode: host # Ensures the Matter mdns works
    restart: always # Ensures the container always restarts automatically
    volumes:
      - "${HOME}/Matterbridge:/root/Matterbridge" # Mounts the Matterbridge plugin directory
      - "${HOME}/.matterbridge:/root/.matterbridge" # Mounts the Matterbridge storage directory

  zigbee2mqtt:
    image: koenkk/zigbee2mqtt:2.2.1
#    image: koenkk/zigbee2mqtt:1.42.0
    container_name: zigbee2mqtt
    restart: unless-stopped
    environment:
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - NODE_ENV=production
      - TZ=Europe/Berlin
    volumes:
      - ./data:/app/data:rw
      - /run/udev:/run/udev:ro
    ports:
      - 12000:12000
    network_mode: host
    devices:
        # Make sure this matched your adapter location
        - /dev/serial/by-id/usb-Txxxxxxxyyyyyyyy:/dev/ttyACM0
# run a rootless container with Docker Compose by adding the following attributes
    # group_add:
    #     - dialout
    # user: 1000:1000

These are examples that must be adjusted to your configuration, notably when creating these directories.

Anyway, that’s what I do and it works pretty well for me; I can « play » with different versions, always backing up first!
With this method I can also create a test Gladys, for example:

version: '3'

services:
  gladys:
#    image: cicoub13/gladys:tuya-rain
    image: gladysassistant/gladys:matter-integration
#    image: sescandell/gladys-test:zjs-battery
#    image: sescandell/gladys-test:pr-zwaveJsMeter
#    image: gladysassistant/gladys:zigbee2mqtt-tuya-me201wz
#    image: gladysassistant/gladys:dashboad-add-other-aggregate-functions
    container_name: gladys-test
    restart: always
    privileged: true
    network_mode: host
    logging:
      driver: "json-file"
      options:
        max-size: 10m
    environment:
      NODE_ENV: production
      SQLITE_FILE_PATH: /var/lib/gladysassistant/gladys-production.db
      SERVER_PORT: 8001
      TZ: Europe/Paris
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./gladysassistant-test:/var/lib/gladysassistant
      - /dev:/dev
      - /run/udev:/run/udev:ro

  mosquitto:
    image: eclipse-mosquitto:2.0.20
    container_name: gladys-test-mqtt
    restart: unless-stopped
#    command: mosquitto -c /mosquitto-no-auth.conf
    environment:
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - VERSION=2.0.20
      - DOWNLOAD_SHA256=azszderzbenrac6
      - GPG_KEYS=azszderzbenr
      - LWS_VERSION=4.2.1
      - LWS_SHA256=azszderzbenr
    volumes:
      - ./mqtt-test/config:/mosquitto/config:rw
      - ./mqtt-test/data:/mosquitto/data:rw
      - ./mqtt-test/log:/mosquitto/log:rw
    ports:
      - 1888:1888
    network_mode: host

  matterbridge:
    image: luligu/matterbridge:latest
    container_name: gladys-test-matterbridge
    restart: always
    network_mode: host
    volumes:
      - ./matterbridge-test/Matterbridge:/root/Matterbridge
      - ./matterbridge-test/.matterbridge:/root/.matterbridge

In your case, I think it would be good to manage z2m that way.
However, you’ll need to disable z2m management by Gladys, then set up Portainer, start a Stack (with z2m version 2.3.0 for example) and run it. Then go back into Gladys and add your external z2m docker:


Hope you get everything back.

I’ve done so many reinstalls that it takes me 5 minutes to do a new one,
I have all the commands in a file.

and me 5s :joy:

I need to install Docker somewhere other than /var/lib/gladysassistant/zigbee2mqtt/z2m
Because that didn’t work
I got
error: \tz2m: MQTT failed to connect, exiting... (connect ECONNREFUSED 127.0.0.1:1884)

@mutmut I don’t know why I had only seen the end of your message.
Donc comme cela n’avait pas fonctionné je remis en installation depuis Gladys
I had to enter again where my coordinator and the model were connected; however the port was automatically changed to 12000
I recovered a working Gladys, but zigbee2mqtt was on 12000
in version 1.42.0 I selected connect to an existing installation and entered the IP address for MQTT
stopped the docker, modified the

1 Like

Okay, I started configuring my W100

The goal is to manage the heating of a bathroom electric heater (toaster-style) by the users.

From top to bottom
I created a fictitious MQTT device thermostat which I named:
ref-temperature-sb-chambre-6
The current value is 27° C
Below, the switch NOUS 4-1-20
Which supplies power or not to the electric heater.
Then the signal strength of the NOUS 4-1-20 switch
Then the room temperature recorded by the W100 here 77.2 °F (see explanation here)
Then the humidity value recorded by the W100
The middle Click button of the W100
and finally the signal strength of the W100

I created a scene Temperature Counter Ch6
with the trigger being the press of the + button of the W100
in the settings I chose Plus button pressed

Then I retrieve the reference value of the desired temperature from my fictitious thermostat.

I continue the procedure if the value is less than 35°C

Check that the scene works;
I send myself the retrieved thermostat value via Telegram and wait 1 second before continuing.

I add +1 to my thermostat value

I retrieve the new value of my thermostat

Check that the scene works;
I send myself via Telegram the new value retrieved from the thermostat.

I test it, it doesn’t work.
I change the trigger to a Xiaomi single click button.
That works — the value of my thermostat is incremented by 1: from 27°C it goes to 28°C
I then wanted to make a scene that compares the reference value with the room temperature value and, depending on it, activates or not the switch NOUS 4-1-20.
And try to display the reference temperature value on the W100 like the pool water temperature is displayed in the link shared by @mutmut

A bit of reading on the review of the Aqara W100.

The problem probably comes from the (Click button) of the W100 which returns No value recorded on Gladys.
on zigbee2MQTT we have

Button press Zigbee2MQTT result Button release Zigbee2MQTT result
Button + short press single_plus
Center button short press single_center
Button - short press single_minus
Button + double press double_plus
Center button double press double_center
Button - double press double_minus
Button + long press hold_plus Button + long release release_plus
Center button long press hold_center Center button long release release_center
Button - long press hold_minus Button - long release release_minus

In my opinion that won’t work directly because you can’t send a calculation to a sensor.
I suggest you take a look at @prohand’s tutorial on automating the washing machine.
Actually you’ll need to create 2 features for your thermostat temperature: 1 for getting the temp (sensor), 1 to do the calculations (actuator).
In the tutorial it’s called sender (sensor) and listener (actuator).

EDIT: after rereading your post, it seems to work because you get 28 after the +1.
If you send the value of your button to yourself via Telegram, what number does it send back? (it won’t return the z2m result but a numeric value normally)
If there’s nothing then you should create a new topic to add the specs of the Aqara W100 to Gladys.

Here’s what my scene sends me via Telegram when I click the Xiaomi button

And on the dashboard the value of my virtual thermostat has indeed increased.

When clicking the W100 nothing happens: no Telegram notification, the scene is not triggered.