Setting up a server in node-red

I wanted to try node-red with my zigbee2mqtt devices, but I don’t know how to configure the server in node-red. I have installed the zigbee2mqtt and mqtt integration in gladys

as I am a « newbie » some help would be very precious

Actually, you need to specify where Node-RED should look to communicate with your MQTT and Z2M installation.
It’s therefore the IP address of the computer (or RPi, or mini-PC, or other) running Gladys that you need to specify.
In the form: 192.168.x.x

For Zigbee2mqtt, I don’t remember how to configure the server because I’m telling you this off the top of my head, there might be a password to retrieve… But I can’t tell you more from my phone!

To configure your server you need to:

name: the name you want to see when you use (Gladys, or whatever you want).

mqtt host: localhost (if it’s on the same machine) or the physical address of your machine (192.168.1.150 for example). The first option, even on the same machine, sometimes doesn’t work. You need to use the address just in case.

Mqtt Username: Gladys (usually).

mqtt password: It’s in the configuration of the virtual mqtt devices in Gladys.

And then you click on add, it should work normally

To listen directly to Zigbee devices, there’s a small thing to change, after creating a new Mqtt server

The port: 1884 (instead of 1883).

And for the password, you need to find it in your configuration folder via ssh. If you haven’t changed anything.

Send this command:

cat /var/lib/gladysassistant/zigbee2mqtt/mqtt/mosquitto.passwd

It should show you a file with the passwords.

If my memory serves me right, you need to retrieve the password that corresponds to the gladys line

Thank you for your answers: I managed to create an MQTT server (in fact, I hadn’t chosen the right MQTT version, 5 in my case).
Now how do I get the list of Zigbee devices?
I changed the port to 1884, but in this case, it shows « MQTT Offline »

Were you able to retrieve the z2m password with the command indicated by @dahut?

Please share screenshots if you can; it will definitely help us answer you more precisely.

I haven’t tried the command (because I don’t know how to do it yet!) but I entered the password I got when I set up the MQTT integration in Gladys (which is visible in integration/MQTT/configuration). Is that the right one?
The MQTT server works fine, but I don’t know how to go further, especially to see the list of connected Zigbee devices.

The module in yellow corresponds to Zigbee2MQTT, and I see that it is not connecting. Maybe the problem is there?

To communicate with virtual devices, the correct password is the one you retrieve from the integration in Gladys

But for zigbee2mqtt, it’s different, as we don’t use the same mqtt server (Mosquito).
Both in the Mqtt server node and with the zigbee2mqtt node.

That’s why the port and password change

If you need help using ssh, don’t hesitate, it may seem complicated but it’s not for simple commands

ok, I’d like you to explain how to send a command via SSH. For your information, I have the mini PC purchased from Gladys, which has Linux installed (without a desktop) as well as Docker and the Gladys instance.

@Chris75, don’t worry, I’ll add the password in the interface, I think it’ll be useful to others too :slight_smile:

It will look like this:

I’ll deploy this later today :slight_smile:

Here’s the quickest solution.

If it’s possible to add the same copy-paste buttons for virtual Mqtt devices, that would be super practical. Especially for the password.

@Chris75 This is available in Gladys Assistant 4.81:

@dahut Yes, that can be added

Small note: these copy-paste buttons will only appear on Gladys Plus, as browsers do not expose the copy-paste functionality for local URLs.

Here you go:

This will be available in the next version of Gladys!