# How to get zigbee2mqtt/get to work?

**URL:** <https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513>\
**Category:** General\
**Tags:** home-assistant\
**Created:** [21 February 2023 14:22 UTC](https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513 "2023-02-21T14:22:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [21 February 2023 14:22 UTC](https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513/1 "2023-02-21T14:22:50Z")

</div>

Anyone know way I dont get any info back here?

```auto
[{"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":""}]

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 February 2023 15:39 UTC](https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513/2 "2023-02-21T15:39:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)\
**Post date:** [21 February 2023 16:11 UTC](https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513/3 "2023-02-21T16:11:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [21 February 2023 16:23 UTC](https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513/4 "2023-02-21T16:23:38Z")

</div>

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

I just look at [Xiaomi DLKZMK11LM control via MQTT | Zigbee2MQTT](https://www.zigbee2mqtt.io/devices/DLKZMK11LM.html)  
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 ?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 February 2023 16:25 UTC](https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513/5 "2023-02-21T16:25:20Z")

</div>

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](https://nodered.org/docs/user-guide/messages)) 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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

Also if you have not already done so, I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). 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.

---

<div class="post-metadata">

**Author:** ![EcarDK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ecardk/32/76058_2.png) [@EcarDK](https://discourse.nodered.org/u/EcarDK)\
**Post date:** [21 February 2023 16:37 UTC](https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513/6 "2023-02-21T16:37:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 February 2023 16:39 UTC](https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513/7 "2023-02-21T16:39:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 April 2023 16:39 UTC](https://discourse.nodered.org/t/how-to-get-zigbee2mqtt-get-to-work/75513/8 "2023-04-22T16:39:35Z")

</div>

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