Zigbee2mqtt SNZB-02 Raspberry Pi

Dear Community,

I'm really struggling for a few days to connect a SonOFF temperature sensor with Node-Red without any luck.

  1. I installed zigbee2mqtt to Raspberry Pi accordingly to this website: Linux | Zigbee2MQTT
  2. After configuring the configuration.yaml file and starting the service with commands cd /opt/zigbee2mqtt and npm start I started to see in Raspberry Pi console information sent by the Temperature sensor:

Zigbee2MQTT:info 2022-08-02 11:42:29: MQTT publish: topic 'zigbee2mqtt/Temp', payload '{"battery":100,"humidity":50.9,"linkquality":193,"temperature":26.88,"voltage":3200}'

  1. Going to Node-Red interface I installed several modules and after many trials I found one that might try to connect called node-red-contrib-sonoff-tasmota : Sonoff device

After doing all these steps, the status of the SONOFF block remains on "Connecting"

Could you please let me know if there is any solution to display the temperature values in Node-Red?

PS: I'm a beginner in Node-Red and Zigbee2mqtt

SONOFF
Settings

This is your issue. When using Zigbee2MQTT, you need to use MQTT not another node that connects direct to the SONOFF (or via the Tuya cloud).

Here is an example set of MQTT topics from my own config:
image

Each device defined to zigbee2mqtt should have its own unique topic. You need to add an MQTT-in node to your flow instead of the sonoff node. Set the mqtt node to listen for the specific topic.

Thank you for your reply!

I tried to add an MQTT in block but still doesn't work.

Mqtt block
Mqtt Settings

Port 8085 is almost certainly not the port of your MQTT broker service. I suspect that is the port of your Zigbee2MQTT service.

The MQTT broker is the messaging service that coordinates the MQTT messages. 1883 is the normal port number for MQTT.

You will also want to change the output to parsed json.

I have changed it in the configuration.yaml file in the beginning.

Later Edit: Picture from yaml config file

That is all Zigbee2mqtt config.

Node-red needs to talk to the mqtt broker not to the zigbee2mqtt service. Change the mqtt-in node settings to use port 1883.

Thank you a lot for your help, now it's working!

I was making a big confusion between Zigbee2mqtt service port and MQTT broker port.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.