# Error in Zigbee2Mqtt Admin flow

**URL:** <https://discourse.nodered.org/t/error-in-zigbee2mqtt-admin-flow/58990>\
**Category:** General\
**Created:** [25 February 2022 18:57 UTC](https://discourse.nodered.org/t/error-in-zigbee2mqtt-admin-flow/58990 "2022-02-25T18:57:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [25 February 2022 18:57 UTC](https://discourse.nodered.org/t/error-in-zigbee2mqtt-admin-flow/58990/1 "2022-02-25T18:57:16Z")

</div>

Good evening,  
I am testing the Zigbee2Mqtt Admin [flow](https://flows.nodered.org/flow/1f1c0dde4ff193e5c14d5b99442a7d00) example.  
It works quite well except for the part of retrieving the icons from the [website](https://www.zigbee2mqtt.io/) zigbee2mqtt.  
The code crashes in the function node

```auto
newPayload = [];
msg.payload.message.forEach(function(entry) {
    if(entry.type != 'Coordinator') {
      newentry = {'title': entry.friendly_name, 
               'description': entry.model + ' (' + entry.ieeeAddr + ')',
               'icon': 'https://www.zigbee2mqtt.io/images/devices/' + entry.model.replace(new RegExp('/', 'g'), '-') + '.jpg'
      };
      newPayload.push(newentry);
    }
});

msg.payload=newPayload;
return msg;

```

Here is the debug result:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/6651a373edb4923c2bc0e9d7120da77ab399c68a.png)

It revolves around this value which is not right, if I understand correctly. payload.message[1].model  
But I don't understand how the syntax works  
`entry.model.replace(new RegExp('/', 'g')`

For verification,I used a Curl https from the image location, it's ok, it's accessible.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/663f10af5c44060960755efa3c08cade975afb72.png)

If you could guide me?

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [25 February 2022 20:37 UTC](https://discourse.nodered.org/t/error-in-zigbee2mqtt-admin-flow/58990/2 "2022-02-25T20:37:55Z")

</div>

Does every object in the array have a `model` , and does the `type` not equal `"Coordinator"` ?

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [25 February 2022 20:48 UTC](https://discourse.nodered.org/t/error-in-zigbee2mqtt-admin-flow/58990/3 "2022-02-25T20:48:37Z")

</div>

Not an answer to your question, but its much easier to use the build in dashboard of Zigbee2mqtt  
You can find it at [http://x.x.x.x:8080](http://x.x.x.x:8080) after you add:

```auto
frontend:
  port: 8080
  host: 0.0.0.0

```

to your **configuration.yaml** of the zigbee2mqtt setup.

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [25 February 2022 21:08 UTC](https://discourse.nodered.org/t/error-in-zigbee2mqtt-admin-flow/58990/4 "2022-02-25T21:08:49Z")

</div>

Yes, except the last one

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/a/ba83cb5b32f3082e5989dfae018498c83c68162c.png)

indeed I see that there is a device not recognized

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/7/270233d5008e96f266fdab443b4f597694b410a2.png)

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [25 February 2022 21:10 UTC](https://discourse.nodered.org/t/error-in-zigbee2mqtt-admin-flow/58990/5 "2022-02-25T21:10:38Z")

</div>

I never thought to activate this dashboard. It's worth a look indeed. If it is easier or simpler

edit: Just started, it seems to me complete indeed. I'm going to go deeper into it 👍

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0c91252861c8212dfd191bab96ebe2c104a4d4c4.png)

---

<div class="post-metadata">

**Author:** ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)\
**Post date:** [25 February 2022 21:41 UTC](https://discourse.nodered.org/t/error-in-zigbee2mqtt-admin-flow/58990/6 "2022-02-25T21:41:28Z")

</div>

Yes, delete the unknown and **Bingo**!!!! Great  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/8/181109c08e8c6157f5863fc2bc816fecd69fb781.png)

**Thanks to both of you**

---

<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:** [11 March 2022 21:41 UTC](https://discourse.nodered.org/t/error-in-zigbee2mqtt-admin-flow/58990/7 "2022-03-11T21:41:36Z")

</div>

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