# Zigbee2tasmota variables and ways to extract them from msg.payload

**URL:** <https://discourse.nodered.org/t/zigbee2tasmota-variables-and-ways-to-extract-them-from-msg-payload/38685>\
**Category:** General\
**Created:** [6 January 2021 22:23 UTC](https://discourse.nodered.org/t/zigbee2tasmota-variables-and-ways-to-extract-them-from-msg-payload/38685 "2021-01-06T22:23:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gr1nch](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gr1nch/32/14302_2.png) [@gr1nch](https://discourse.nodered.org/u/gr1nch)\
**Post date:** [6 January 2021 22:23 UTC](https://discourse.nodered.org/t/zigbee2tasmota-variables-and-ways-to-extract-them-from-msg-payload/38685/1 "2021-01-06T22:23:59Z")

</div>

Looking at the list of key/values I'm now able to extract from msg.payload via zigbee2tasmota and MQTT, I thought it might be useful to share them in jsonata format (for extraction) and for others to share theirs as well. The following are from a bunch of sensors: BlitzWolf temp/humidity & water, IKEA tradfri motion, Wiser thermostats and the IKEA tradfri remote control.

```auto
{ "linkQuality": **.LinkQuality,  
    "waterLeak": **.Water,
    "power": **.Power,
    "dimmerUp": **.DimmerUp,
    "dimmerDown": **.DimmerDown,
    "dimmerMove": **.DimmerMove,
    "dimmerStepDown": **.DimmerStepDown,
    "dimmerStop": **.DimmerStop,
    "arrowClick": **.ArrowClick,
    "arrowHold": **.ArrowHold,
    "arrowRelease": **.ArrowRelease,
    "temperature": **.Temperature,
    "humidity": **.Humidity,
    "temperatureRoom": $each($.ZbReceived.*, function($v){$contains($string($v), /^ENV/) ? $number($split($v,",")[2])/100}),
    "humidityRoom": $each($.ZbReceived.*, function($v){$contains($string($v), /^ENV/) ? $number($split($v,",")[3])/100})
 }

```

The clever parts of the jsonata came from this thread [Jsonata test works but doesn’t in the flow](https://discourse.nodered.org/t/jsonata-test-works-but-doesnt-in-the-flow/38555) helped by @UnborN and @E1cid .

---

<div class="post-metadata">

**Author:** ![yogy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yogy/32/32191_2.png) [@yogy](https://discourse.nodered.org/u/yogy)\
**Post date:** [7 January 2021 11:34 UTC](https://discourse.nodered.org/t/zigbee2tasmota-variables-and-ways-to-extract-them-from-msg-payload/38685/2 "2021-01-07T11:34:36Z")

</div>

Do you know how to ask for Zbinfo data from a device with node-red  
I am searching for the correct mqtt/json statement in node-red to acquire ZbInfo from a device.  
I have tried many combinations, but get :  
stat/ZBridge/RESULT = Unrecognized zigbee command: Zbinfo or  
stat/ZBridge/RESULT = {"Command":"Unknown"} or  
stat/ZBridge/RESULT = {"ZbSend":"Unknown device"}  
in Node-red.  
When I use Zbinfo in the console from the device, the response via MQTT in node-red is a complete json from the device with all the attributes

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [7 January 2021 12:26 UTC](https://discourse.nodered.org/t/zigbee2tasmota-variables-and-ways-to-extract-them-from-msg-payload/38685/3 "2021-01-07T12:26:11Z")

</div>

You will need to send it to the cmnd topic, not stat. Unless i am reading it incorrectly.

 ![Screenshot 2021-01-07 at 13.33.43](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0ee56729cc1f65e1413c7fce6eaf710681342853.jpeg)

Note that I have switched the topic prefix. Specify the hex value of the device as payload.  
If you leave the payload empty, you get them all.

---

<div class="post-metadata">

**Author:** ![yogy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yogy/32/32191_2.png) [@yogy](https://discourse.nodered.org/u/yogy)\
**Post date:** [7 January 2021 13:27 UTC](https://discourse.nodered.org/t/zigbee2tasmota-variables-and-ways-to-extract-them-from-msg-payload/38685/4 "2021-01-07T13:27:53Z")

</div>

Thanks,  
I tried so many combinations, most with zbsend in it.  
But I just realizing now that there 2 levels, the Tasmota level and the zigbee level.  
I think I was too busy with the zigbee level while zbinfo is tasmota level.

---

<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:** [8 March 2021 13:27 UTC](https://discourse.nodered.org/t/zigbee2tasmota-variables-and-ways-to-extract-them-from-msg-payload/38685/5 "2021-03-08T13:27:59Z")

</div>

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