How to get zigbee2mqtt/get to work?

Anyone know way I dont get any info back here?

[{"id":"70e1ef1389279691","type":"mqtt in","z":"4f9f6e947cc4c811","name":"","topic":"zigbee2mqtt/Annika Loft Lys/get","qos":"2","datatype":"auto-detect","broker":"6ca581fe08a0ccb3","nl":false,"rap":true,"rh":0,"inputs":0,"x":290,"y":300,"wires":[["2c7f5523e13bbf47"]]},{"id":"2c7f5523e13bbf47","type":"change","z":"4f9f6e947cc4c811","name":"State","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"state\": \"\"\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":300,"wires":[["1b7925eff5685af6"]]},{"id":"1b7925eff5685af6","type":"debug","z":"4f9f6e947cc4c811","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":740,"y":300,"wires":[]},{"id":"6ca581fe08a0ccb3","type":"mqtt-broker","name":"Mqtt Broker","broker":"http://localhost","port":"1883","clientid":"HAClient","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]

Start by connecting the debug node straight to the mqtt node to check if you are getting anything there.

If not then I suggest installing MQTTExplorer which is an excellent tool for monitoring MQTT. Then you can see what topics zigbee2mqtt is publishing on.

I suggest you avoid topics with spaces, it just makes life difficult.

As Colin says check that you are getting an input at the MQTT node because if I connect this to one of my inputs it works

I dont...
if the Topic is zigbee2mqtt/Annika Loft Lys/get

I just look at Xiaomi DLKZMK11LM control via MQTT | Zigbee2MQTT
is say --> To read the current state of this switch publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get with payload {"state": ""}

If i set the Topic to zigbee2mqtt/Annika Loft Lys

I get {"consumption":0,"current":0,"device_temperature":22,"energy":0,"linkquality":196,"power":8.05,"power_outage_count":0,"power_outage_memory":null,"state":"ON","switch_type":null,"update":{"installed_version":-1,"latest_version":-1,"state":null},"update_available":null,"voltage":232.9}

But how to only get the state of - on or of ?

You said you weren't getting anything. So actually you are asking how to get the state out of the object.

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

Also if you have not already done so, I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

Thx Alot

I will se all the Node-RED Essentials. Its a good ideer.

Yes, I get information out of mqtt. And I see the value in the debug node.

like state: "OFF" path is payload.state.

I just dont understand how to get the off/on value out to a change node.

Thx for you help

You will use a Change node to move it from the path you can get from the debug pane, to msg.payload.

What do you want to do with it that needs you to move it?

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