Node red and zigbee2mqtt

Hi,
there is someone who use the palette "node-red-contrib-zigbee2mqtt"
without problems?
Because from yesterday I try to update my home automation from deconz to zigbee2mqtt but I have many problems with devices that works fine in deconz and I don't understand if the problem is the palette or just zigbee2mqtt ......

Is there any useful reason for using that node? Node-RED already talks MQTT quite happily. And the map can be seen on the Zigbee2MQTT web page. Personally I don't use that node at all. But I do use Zigbee2MQTT without any problems.

Certainly not, but everything is easy for those who know how to do .....
I know the map of device in Zigbee2MQTT web page, I know mqtt, I'd like to avoid the palette and I have only simple needs:
. how to know the status of switch and how to send on/off command
. how to know the status of door sensor (open/close)
. how to know the status of button (single/double)

Can you give me some suggestions?

Dear TotallyInformation,

in parallel there is a similiar discussion in another recent thread. So, I believe using the pure MQTT node in Node red is what I want. Thus, with the basic aim to develop myself a bit further, I started restructuring all my flows accordingly, however, a bit struggeling to find the most elegant way. I have a basic understanding of the 'MQTT-principles', nevertheless, I would like to ask for your opinion based on a very simple flow.

I would like to replace the contrib node (between button and switch). Or better, I am not sure how a pure MQTT approch should look like. How would you realize that ?

At the moment, my impression is my flow layout in general is much more elegant and simple when using node-red-contrib-zigbee2mqtt; For sure, its absolutely beginner friendly. At this point, a big thank to the developers who have made so much possible for me in such a short time.

Thanks and regards

This is a simple inject button that will turn on an Ikea Zigbee plug:

Connected to Dashboard is not a lot harder:

Light level comes from another sensor. Everthing else comes from/goes to Zigbee2MQTT.




2 Likes

Ok, I go to make some test,
thank you, thank you very much .....

Dear TotallyInformation,

does your mqtt in node (Bulb 2 State) really gives you an output ?? I am just shocked and so curious how this is possible ? For a real long period I am trying to get exactly that (using exactly the same topic)! However, it does not work. Have you any explanations for that ?

Yes, absolutely

image

I can control that both from the Dashboard button and from an inject and all sorts of other things too:

Me again (desperated). You must do something basically different (any additional setting ??). My finding is that the mqtt in node with the topic: zigbee2mqtt/mydevice/state NEVER has an output. Please see my figures below. I am able to turn on/off the light (via inject nodes), however, the debug node shows nothing!! There must be something I am still overlooking. But what ? BTW, I have tested now different devices (lights & plugs)

image

image

image

Install the excellent tool MQTT Explorer and then you will see what topics the data appears on.

1 Like

Try zigbee2mqtt/LEDSTR03 as the MQTT in node topic with a switch node after to select the property you are interested in. for example ...Property msg.payload =contains state

As far as I am aware the device topic returns from a zigbee device are all zigbee2mqtt/FRIENDLY_NAME. The only bit that returns other topics is the bridge. But as Colin says MQTT Explorer will be a great help

What device is it. Perhaps it exposes different topics? I think that the Zigbee2MQTT website tells you what happens.

Here is my Zigbee2MQTT config (with some sensitive bits removed):

homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://localhost
  client_id: zigbee2mqtt_home
  include_device_information: true
  version: 5
serial:
  port: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
advanced:
  network_key:
    - REMOVED
  last_seen: ISO_8601
  elapsed: true
  legacy_api: false
  ikea_ota_use_test_url: true
  log_level: info
experimental:
  output: attribute_and_json
frontend:
  port: 8085
  host: 0.0.0.0
devices:
  '0x804b50fffe3f3b21':
    friendly_name: Ikea_Bulb_01
    retain: true
  # MORE REMOVED

I think that the main thing I changed was to get both the JSON and the individual topics turned on. I think that is the experimental setting.

This is what an Ikea bulb exposes in Zigbee2MQTT:

This is what I get in MQTT:

The Zigbee2MQTT site tells you what is exposed for all supported devices:

Siglis ZFU-1D-CH control via MQTT | Zigbee2MQTT

That did it!! Thanks for the information. Now it works as given in your example. Nevertheless, we should point out for all the others here that this is an experimental feature and is disabled by default. Your examples will not work in a standard environment. Good that you gave us a more detailed insight in your settings. Learned something new.

@ Colin & Buckskin
Thanks for joining the disussion and your approaches. I am basically aware of how to deal with mqtt messages. However, the 'non'-standard topic usage was what has irritated me.

Many thanks to you all!!

Did you look to see what topics it was publishing before you did that?

Reasonable point, to be honest, I'd forgotten until I got to thinking about the differences in our configs.

I seem to remember I did it straight away as I was setting things up and reading the config help. Having used MQTT for so long, it always ends up a requirement to have individual topics as well as sometimes a summary JSON topic. Anything else is a pain to deal with.

I can confirm what TotallyInformation says. I deleted "node-red-contrib-zigbee2mqtt" and work with mqtt and the ZigBee2mqtt web page.

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