# Node Red: A widget based dashboard working with Homey trough MQTT

**URL:** <https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798>\
**Category:** Apps\
**Created:** [October 3, 2019, 10:05am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798 "2019-10-03T10:05:10Z")\
**Posts on this page:** 20\
**Page:** 23

<div class="post-metadata">

**Author:** ![DeepBlueNine](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/deepbluenine/32/18637_2.png) [@DeepBlueNine](https://community.homey.app/u/DeepBlueNine)\
**Post date:** [June 28, 2020, 5:13pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/452 "2020-06-28T17:13:53Z")

</div>

Maybe you have misspelled your boolean variable in the node function, can you share your flow or check it ? You can also try to switch the light ON/OFF, but not with the Dashboard, maybe with Homey, and check if you see true/false in the Node-Red debug.

---

<div class="post-metadata">

**Author:** ![Exile82](https://avatars.discourse-cdn.com/v4/letter/e/8491ac/32.png) [@Exile82](https://community.homey.app/u/Exile82)\
**Post date:** [June 28, 2020, 7:52pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/453 "2020-06-28T19:52:28Z")

</div>

Sorry guys, but this is a real noob question. I tried to find my answer somewhere among the the 400+ replies here but I didn’t manage. I just setup Node Red on Docker (Synology) today, created a MQTT broker on the same platform (Mosquitto) and succesfully setup MQTT Hub and Client on Homey.

I tested with Satoer’s flow (MQTT Receiver to output debug), and actually I got a hit right away. But in the debug log it looks like it only displays a certain kind of devices, like temperature sensors and stuff like that. I can’t find any lights or other devices (yes, the MQTT hub broadcasts all devices)

Any ideas what went wrong or how I can troubleshoot?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/b/fb7cae3903b627f4c38cddea0b2ea7d07903f74a.png)

---

<div class="post-metadata">

**Author:** ![Satoer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/satoer/32/38113_2.png) [@Satoer](https://community.homey.app/u/Satoer)\
**Post date:** [June 29, 2020, 5:32pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/454 "2020-06-29T17:32:50Z")

</div>

Switch on and off the lights inside Homey, do you see any debug information?

---

<div class="post-metadata">

**Author:** ![Keverjeroen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/keverjeroen/32/369_2.png) [@Keverjeroen](https://community.homey.app/u/Keverjeroen)\
**Post date:** [June 30, 2020, 3:02pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/455 "2020-06-30T15:02:47Z")

</div>

Still experimenting. The layout is still far from finished, but I have some nice functionality already:

**Some temperatures**. The background colors of the temperatures change acording to the temperature. For the bedroom and outside temp, even the icon changes (empty meter up to full meter).

**Modes.** The buttons work and only the activated mode is blue, te others transparant.

**Locks.** The icons are closed for closed locks and open for open locks. Background color also changes.

**Gas/power.** Used power and gas from today

**Roborock.** State of the vacuum cleaner is stated and i can start/stop it.

Still a lot of work to do. But thanks to this topic it’s getting better bit by bit.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/0/8029172c9b4b873a7ee1a80d3d068b4f1b9ecabd.jpeg)

---

<div class="post-metadata">

**Author:** ![lirand](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/lirand/32/8479_2.png) [@lirand](https://community.homey.app/u/lirand)\
**Post date:** [June 30, 2020, 3:47pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/456 "2020-06-30T15:47:05Z")

</div>

How did you do that the symbols change when the status changes?

---

<div class="post-metadata">

**Author:** ![Satoer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/satoer/32/38113_2.png) [@Satoer](https://community.homey.app/u/Satoer)\
**Post date:** [June 30, 2020, 6:19pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/457 "2020-06-30T18:19:02Z")

</div>

You can change the on and off icon from switch nodes:  
 ![afbeelding](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/b/eb2300534cd924ad407bcd59c41c0ba30b6a65a4.png)

---

<div class="post-metadata">

**Author:** ![Exile82](https://avatars.discourse-cdn.com/v4/letter/e/8491ac/32.png) [@Exile82](https://community.homey.app/u/Exile82)\
**Post date:** [June 30, 2020, 6:53pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/458 "2020-06-30T18:53:08Z")

</div>

Hi Satoer! I got that fixed, sorry for disturbing you! I will try to catch up on every post, this is really interesting!!

---

<div class="post-metadata">

**Author:** ![johannes1702](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@johannes1702](https://community.homey.app/u/johannes1702)\
**Post date:** [June 30, 2020, 7:12pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/459 "2020-06-30T19:12:16Z")

</div>

Hi all,

Such a lengthy but very intersting topic. Started to learn about Node Red and MQTT a few days ago and really love it 🙂

One question: Let’s assume I put a button on a dashboard and want to trigger a flow with this in Homey. Is there any nice way in doing it? Really sorry if I missed it in the long thread.

Johannes

---

<div class="post-metadata">

**Author:** ![Keverjeroen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/keverjeroen/32/369_2.png) [@Keverjeroen](https://community.homey.app/u/Keverjeroen)\
**Post date:** [June 30, 2020, 7:18pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/460 "2020-06-30T19:18:59Z")

</div>

The TEST button with the open lock is a switch. That one works like @Satoer says. But you can’t change the background color of a switch and the font of the text looks a bit diferent. So I use buttons instead of switches now. For example with the “Keukendeur” I use a Function with this code:

```
var color;

if(msg.payload === "true"){
 color = "#FFC815"
 msg.ui_control = {icon:"fa-2x fa-unlock", tooltip:"Deur open"};
}

else{
 color = "rgba(255, 255, 255,.08)"
 msg.ui_control = {icon:"fa-2x fa-lock", tooltip:"Deur dicht"};
}
msg.background = color;
return [msg];

```

Or import this in to node-red:

```
[{"id":"a65e9076.3be4c","type":"mqtt in","z":"7b4023c5.1e24fc","name":"MQTT HA Voordeur","topic":"homie/homey-topic/hal-deur-plus/alarm-contact","qos":"2","datatype":"auto","broker":"649f9a36.29ece4","x":130,"y":1900,"wires":[["d55af3ce.c3078"]]},{"id":"94484bae.f300f8","type":"ui_button","z":"7b4023c5.1e24fc","name":"","group":"ba312333.3bdaf","order":12,"width":0,"height":0,"passthru":false,"label":"HA Voordeur","tooltip":"","color":"","bgcolor":"{{msg.background}}","icon":"{{msg.icon}}","payload":"","payloadType":"str","topic":"","x":730,"y":1900,"wires":[[]]},{"id":"d55af3ce.c3078","type":"function","z":"7b4023c5.1e24fc","name":"Kleur en icoon","func":"var color;\n\nif(msg.payload === \"true\"){\n color = \"#FFC815\"\n msg.ui_control = {icon:\"fa-2x fa-unlock\", tooltip:\"Deur open\"};\n}\n\nelse{\n color = \"rgba(255, 255, 255,.08)\"\n msg.ui_control = {icon:\"fa-2x fa-lock\", tooltip:\"Deur dicht\"};\n}\nmsg.background = color;\nreturn [msg];\n\n\n","outputs":1,"noerr":0,"x":380,"y":1900,"wires":[["94484bae.f300f8"]]},{"id":"649f9a36.29ece4","type":"mqtt-broker","z":"","name":"MQTT server Jeroen","broker":"192.168.178.129","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"ba312333.3bdaf","type":"ui_group","z":"","name":"Group 3","tab":"bf9cdcc.4e7c92","order":3,"disp":false,"width":"3","collapse":false},{"id":"bf9cdcc.4e7c92","type":"ui_tab","z":"","name":"Startscherm","icon":"home","order":1,"disabled":false,"hidden":false}]
```

---

<div class="post-metadata">

**Author:** ![Jan\_Willem\_Visser](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_willem_visser/32/10747_2.png) [@Jan\_Willem\_Visser](https://community.homey.app/u/Jan_Willem_Visser)\
**Post date:** [July 1, 2020, 9:55am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/461 "2020-07-01T09:55:05Z")

</div>

Can you explane to me how to do this? I look around in Node Red but have no idea where to paste the code you have shared.

---

<div class="post-metadata">

**Author:** ![DeepBlueNine](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/deepbluenine/32/18637_2.png) [@DeepBlueNine](https://community.homey.app/u/DeepBlueNine)\
**Post date:** [July 1, 2020, 12:28pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/462 "2020-07-01T12:28:27Z")

</div>

Hi @Jan_Willem_Visser  
It’s explained in the first post of @Satoer, here : [Node Red: A widget based dashboard working with Homey trough MQTT](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798)

---

<div class="post-metadata">

**Author:** ![Satoer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/satoer/32/38113_2.png) [@Satoer](https://community.homey.app/u/Satoer)\
**Post date:** [July 1, 2020, 9:19pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/463 "2020-07-01T21:19:23Z")

</div>

> [@johannes1702](#):
>
> One question: Let’s assume I put a button on a dashboard and want to trigger a flow with this in Homey. Is there any nice way in doing it? Really sorry if I missed it in the long thread.

I don’t think I explained this in the first post. There are several things how you can accomplish this. Create a virtual button that activates the flow. (by MQTT-ing the virtual button). Or start a flow directly with a MQTT Client trigger. You can create any topic you want, and the flow gets triggered if you send a MQTT message to it.  
 ![afbeelding](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/6/46ee811a7d7e07a2f0b8fbe36575047cc2626d0a.png)

---

<div class="post-metadata">

**Author:** ![Joost\_van\_Liempt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joost_van_liempt/32/9927_2.png) [@Joost\_van\_Liempt](https://community.homey.app/u/Joost_van_Liempt)\
**Post date:** [July 2, 2020, 5:54am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/464 "2020-07-02T05:54:35Z")

</div>

Hi Arnold, there is also another option for this static screens.  
I have 2 tablets here, 1 ipad and 1 samsung android.  
They have different screen layouts (4:3 / 16:10)

If you put this code in a header node the screen width is limited to 1000px. But can easily be changed.

```
[{"id":"2db7537e.418f3c","type":"ui_template","z":"9b29517d.8821a","group":"ce3d2b3e.1755e8","name":"Breedte maximaal 1000px","order":4,"width":0,"height":0,"format":"<style>\n .masonry-container {\n max-width: 1000px;\n }\n</style>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"global","x":750,"y":140,"wires":[[]]},{"id":"ce3d2b3e.1755e8","type":"ui_group","z":"","name":"Energie","tab":"a74c5fa4.31437","order":1,"disp":true,"width":"4","collapse":false},{"id":"a74c5fa4.31437","type":"ui_tab","z":"","name":"Overzicht","icon":"fa-home fa-lg","order":1,"disabled":false,"hidden":false,"info":"<title>Thuis</title>"}]

```

This works then of course also on a PC.

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/2/32d4fdef78cfd6817174147f223779e89c65a33c.png)

---

<div class="post-metadata">

**Author:** ![johannes1702](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@johannes1702](https://community.homey.app/u/johannes1702)\
**Post date:** [July 2, 2020, 6:06am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/465 "2020-07-02T06:06:05Z")

</div>

Great - thank you. Again this is the point where we need more than one trigger for a flow in homey. 😩

---

<div class="post-metadata">

**Author:** ![MFM\_Bart](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mfm_bart/32/9492_2.png) [@MFM\_Bart](https://community.homey.app/u/MFM_Bart)\
**Post date:** [July 2, 2020, 12:30pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/466 "2020-07-02T12:30:44Z")

</div>

Hallo,

Can someone tell me what variable I have to use for windspeed in kmh and m/s?  
The variable I use now is does not give the right speed.

var msg = {  
“payload”: {  
“speed”:Math.round(Math.random() \* 60)  
}  
}  
return msg;

---

<div class="post-metadata">

**Author:** ![Arnold\_vd\_Linden](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arnold_vd_linden/32/19336_2.png) [@Arnold\_vd\_Linden](https://community.homey.app/u/Arnold_vd_Linden)\
**Post date:** [July 2, 2020, 2:45pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/467 "2020-07-02T14:45:17Z")

</div>

Thank you.

---

<div class="post-metadata">

**Author:** ![BenjaminH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/benjaminh/32/16386_2.png) [@BenjaminH](https://community.homey.app/u/BenjaminH)\
**Post date:** [July 3, 2020, 9:31am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/468 "2020-07-03T09:31:04Z")

</div>

Hello [Tangodelta](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/202),  
I am interested in displaying the owntracks map on my dashboard. can you detail how you proceeded?  
Thanks

---

<div class="post-metadata">

**Author:** ![Jan\_Willem\_Visser](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_willem_visser/32/10747_2.png) [@Jan\_Willem\_Visser](https://community.homey.app/u/Jan_Willem_Visser)\
**Post date:** [July 3, 2020, 4:01pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/469 "2020-07-03T16:01:58Z")

</div>

Can you tel me where u paste the code? I have no idea whare ik heave to paste te code 🙈

---

<div class="post-metadata">

**Author:** ![Tangodelta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tangodelta/32/9471_2.png) [@Tangodelta](https://community.homey.app/u/Tangodelta)\
**Post date:** [July 3, 2020, 4:40pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/470 "2020-07-03T16:40:16Z")

</div>

Its actually not a Homey thing…

---

<div class="post-metadata">

**Author:** ![Satoer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/satoer/32/38113_2.png) [@Satoer](https://community.homey.app/u/Satoer)\
**Post date:** [July 3, 2020, 9:37pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/471 "2020-07-03T21:37:49Z")

</div>

![afbeelding](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/5/650055c7a2aa5d6be6cf830ba686c4c003eaecfe.png)

[Previous page](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798.md?page=22)

[Next page](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798.md?page=24)
