I have a problem with my node-red.
Since my SD card crashed I installed the whole PI including node-red again and imported my old flows.
mosquitto service is running
zigbee2mqtt service is running too.
sudo journalctl -u zigbee2mqtt.service -f
.. shows me that my temperature sensors (Aqara) were paired successfully and from time to time I can see a status update of that devices. A debug node behind the bridge node shows me the same messages.
The only thing I cannot see are all the devices in Node-Red and I have no idea why.
The zigbee2mqtt-bridge node is "online" but the device dropdown field stays blank.
localhost,
1883,
base topic: zigbee2mqtt
Devices tab is empty.
Groups tab is empty too and I cannot see any group (that I have created right now)
Since I clicked on "refresh map" at "Map" tab I got every 0.5 secounds this message:
There's something changed in the protocol of zigbee2mqtt.
To get the zigbee2mqqt node working again you much add this to the /opt/zigbee2mqtt/datconfiguration.yaml file of zigbee2mqtt.
Exactly my thinking as well. Tried this node and came to conclusion that pure MQTT is more stable and adds less sources of bugs.
The seldom needed management tasks can be done easily via the built in web-interface of zigbee2mqtt.
However, one must admit that the get node of contrib-zigbee2mqtt is really practical since it can be implemented directly in the flow. Additionally, you can request the actual value (or state) of a specific attribute. This does not work with zigbee2mqtt (via zigbee2mqtt/FRIENDLY_NAME/get), since this automatically gives you the complete payload with all the attributes.
E.g.
leads to
Where I would like to have the pure "OFF" as payload.
Some of my zigbee devices have a LOT of properties so I use a function node to create a msg for each property. This allows me to send the data to various points in my flow(s) (i.e. environment, power use, battery state, OnOff state etc.) either via a link node or an MQTT node.
Thank you Collin and all others,
I read a bit and looked a few tutorials. Worked great. I cannot say if it worked better since I had no problems with zigbee2mqtt nodes at this point but why not use mqtt directly if it is more efficient
So I really wonder if it is possible to request for a specific value at all ?
E.g. in the zigbee2mqtt documentation you will find this for my LED strip (Vendor: Innr, Model: FL 120 C)
state : To control the state publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set with payload {"state": "ON"} , {"state": "OFF"} or {"state": "TOGGLE"} . To read the state send a message to zigbee2mqtt/FRIENDLY_NAME/get with payload {"state": ""}
But, reading individual properties as explained in the example above never works. Whatever payload I set (in the given example {"state": ""}) I always get the full payload with all attributes. Don't get me wrong, I can deal with that. However, I just would like to understand, why reading individual properties is mentioned in the zigbee2mqtt documentation is mentioned then ?
I don't think the device can send anything except the complete state message. I suspect it is just unclear wording in the docs. When it says that get gets the state I think it means that it gets the message containing the state.
I just tried this and so far, as mentioned by cetsa75, all query 'state' have returned the full message. As to why this is mentioned in the docs... good question.
I don't know, but am pretty certain, that the zigbee2mqtt node gets round this by storing the last message and returning the required property on request, so you get the last known value rather than the one at the time of the request