# 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:** 37

<div class="post-metadata">

**Author:** ![Khoi\_Ho\_Si](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/khoi_ho_si/32/17289_2.png) [@Khoi\_Ho\_Si](https://community.homey.app/u/Khoi_Ho_Si)\
**Post date:** [March 22, 2021, 3:48pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/741 "2021-03-22T15:48:10Z")

</div>

Is anybody encountering problems with their Node-Red dashboard since the Homey v5 update?

All my dashboard controls are no longer working. I can click on the different switch nodes and the dashboard will change state but it seems that no MQTT signal is being send since the devices are not responding.

Sending MQTT signals from Homey is working, since i can control the Sonoff tasmota via homey. However when i do so, the dashboard is not showing the correct state.

Maybe somebody can put me in the right direction?

---

<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:** [March 24, 2021, 2:32pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/742 "2021-03-24T14:32:49Z")

</div>

Have you tried restarting MQTT Hub and MQTT Client on Homey? Sorted out the same problem for me. (Homey not responding on Node-Red)

---

<div class="post-metadata">

**Author:** ![Khoi\_Ho\_Si](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/khoi_ho_si/32/17289_2.png) [@Khoi\_Ho\_Si](https://community.homey.app/u/Khoi_Ho_Si)\
**Post date:** [March 24, 2021, 5:36pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/743 "2021-03-24T17:36:11Z")

</div>

I rebooted the Client and the Broker. But not the HUB. That did the trick!  
Thank you

---

<div class="post-metadata">

**Author:** ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)\
**Post date:** [March 30, 2021, 7:48pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/745 "2021-03-30T19:48:30Z")

</div>

Past week the MQTT Hub went through some updates.

Most users are upgraded by now, so I would like to know if anyone encountered issues?  
Or maybe you have suggestions for improvements to make your live a little easier?

Thought I should ask here to, most of the heavy users are probably around here somewhere 🙂

---

<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:** [April 1, 2021, 9:47pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/746 "2021-04-01T21:47:42Z")

</div>

![afbeelding](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/6/16a82d7ab5c445974e683690d2a3c5b80721a587.jpeg)  
Wow Harrie, you’ve been buzzy.

To be honest, I don’t notice any difference. But that’s probably a good thing 😄  
Now I think of it, in the past couple of weeks I did had an unresponsive dashboard. I restarted the client and hub and then it worked fine. Don’t know if it’s related to these updates. I didn’t put much thought in it.

Just scrolled trough the [Changelog](https://github.com/harriedegroot/nl.hdg.mqtt/blob/master/CHANGE_LOG.md). I don’t think there’s something I had a problem with. To be honest, most thing are above my MQTT knowledge 😅 Are there things that changed the interaction with Node-red?

Anyhow, big thanks for keeping this project updated/supported! Just bought you a couple of Corona Beers! 🍻

---

<div class="post-metadata">

**Author:** ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)\
**Post date:** [April 1, 2021, 10:16pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/747 "2021-04-01T22:16:32Z")

</div>

The biggest change is probably the upgrade to SDK 3. The app API has been improved by Athom. Combined with v2.4.2 of the MQTT Client (test version) it should be an improvement in connectivity between Hub & Client. The rest is mostly some bug fixes & extended functionality of the MQTT Device.

The MQTT Device is a powerful device operating on mqtt messages. It links Homey capabilities to MQTT topics. E.g. add a button to send an on/off message to some mqtt topic or display an external sensor value within Homey on a virtual device. All fully configurable.

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

---

<div class="post-metadata">

**Author:** ![Khoi\_Ho\_Si](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/khoi_ho_si/32/17289_2.png) [@Khoi\_Ho\_Si](https://community.homey.app/u/Khoi_Ho_Si)\
**Post date:** [April 8, 2021, 1:05pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/748 "2021-04-08T13:05:21Z")

</div>

@HarriedeGroot My dashboard is a bit unresponsive since the update. The lights controls on my dashboard do not show the on/off status when i control them via the homey app. However the light controls on my dashboard are working. It looks like the dash can send the MQTT signals but cannot receive them.

This node was working fine before:

```
   [{"id":"a08b2174.7fb8a","type":"mqtt in","z":"48518d4f.6375e4","name":"Back Door","topic":"homie/homey-topic/backdoor/onoff","qos":"2","datatype":"auto","broker":"d094d3b7.a558a8","x":420,"y":1238,"wires":[["6c50e10d.feaf7"]]},{"id":"6c50e10d.feaf7","type":"function","z":"48518d4f.6375e4","name":"Convert String to Boolean","func":"if(msg.payload === \"true\"){\n msg.payload = true; \n}else{\n msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":1238,"wires":[["4a6e3509.b3aaac"]]},{"id":"4a6e3509.b3aaac","type":"ui_switch","z":"48518d4f.6375e4","name":"Back door light","label":"","tooltip":"","group":"2cc829a5.610f36","order":32,"width":1,"height":1,"passthru":false,"decouple":"false","topic":"homie/homey-topic/backdoor/onoff/set","style":"","onvalue":"true","onvalueType":"bool","onicon":"http://192.168.178.106:1880/images/bulb-on.png","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"http://192.168.178.106:1880/images/bulb-off.png","offcolor":"black","x":940,"y":1238,"wires":[["77a0e409.4af4bc"]]},{"id":"77a0e409.4af4bc","type":"mqtt out","z":"48518d4f.6375e4","name":"MQTT Transmitter","topic":"","qos":"","retain":"","broker":"d094d3b7.a558a8","x":1270,"y":1258,"wires":[]},{"id":"d094d3b7.a558a8","type":"mqtt-broker","name":"Homey MQTT","broker":"192.168.178.83","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"2cc829a5.610f36","type":"ui_group","name":"all","tab":"6766858b.dee74c","order":3,"disp":false,"width":20,"collapse":false},{"id":"6766858b.dee74c","type":"ui_tab","name":"Dash","icon":"home","order":1,"disabled":false,"hidden":false}]
```

---

<div class="post-metadata">

**Author:** ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)\
**Post date:** [April 8, 2021, 1:49pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/749 "2021-04-08T13:49:38Z")

</div>

@Khoi_Ho_Si did you restart the MQTT client & hub apps?

---

<div class="post-metadata">

**Author:** ![Khoi\_Ho\_Si](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/khoi_ho_si/32/17289_2.png) [@Khoi\_Ho\_Si](https://community.homey.app/u/Khoi_Ho_Si)\
**Post date:** [April 8, 2021, 2:06pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/750 "2021-04-08T14:06:41Z")

</div>

@HarriedeGroot Yes i did, several times.  
Does the order matters? I also restarted the MQTT broker, not sure if that was needed.

Maybe worth mentioning: the Fibaro dimmers are working properly the issue only occurs with the Sonoff (with tasmota)

---

<div class="post-metadata">

**Author:** ![willumpie](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/willumpie/32/1115_2.png) [@willumpie](https://community.homey.app/u/willumpie)\
**Post date:** [April 9, 2021, 8:39am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/751 "2021-04-09T08:39:05Z")

</div>

I have a problem that my sensors are not updated, when I look with the mqtt explorer at the broker, updates seems to be received but the same value is received. I restarted the client and hub many times already, all devices are selected from the hub app.  
20210409-08:37:09 received ‘61’ on ‘homie/homey/airco-zolder/se-last-seen-seconds’  
20210409-08:37:09 Trigger generic card for homie/homey/airco-zolder/se-last-seen-seconds  
20210409-08:37:09 send message to listeners via realtime api  
20210409-08:37:09 homie/homey/airco-zolder/se-last-seen-seconds: 61  
20210409-08:37:15 SendMessageToTopic called  
20210409-08:37:15 SendMessageToTopic: {“qos”:0,“retain”:“1”,“mqttTopic”:“homie/homey/pompvloerverwarming/measure-voltage”,“mqttMessage”:230.09}  
20210409-08:37:15 publish\_options: {“qos”:0,“retain”:true}  
20210409-08:37:15 send 230.09 on topic homie/homey/pompvloerverwarming/measure-voltage  
20210409-08:37:15 OnMessage called  
20210409-08:37:15 received ‘230.09’ on ‘homie/homey/pompvloerverwarming/measure-voltage’  
20210409-08:37:15 Trigger generic card for homie/homey/pompvloerverwarming/measure-voltage

edit:  
I think I solved part of the issue my self;

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/7/17517bd3d21d2df55caa700c635508c483601873.png)  
screenshot of mqtt explorer, I was using topics from the deviceid section

---

<div class="post-metadata">

**Author:** ![SvenRhein](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@SvenRhein](https://community.homey.app/u/SvenRhein)\
**Post date:** [April 10, 2021, 11:33am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/752 "2021-04-10T11:33:59Z")

</div>

anybody an idea how to use a mqtt value as a title in a gauge? I have the mqtt value - but how to bring this into a gauge as a title 🙂

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/3/93b28e5a576eec7c15babcbc04bd78a8e73c6e33.png)

---

<div class="post-metadata">

**Author:** ![Eric\_de\_Been](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eric_de_been/32/12421_2.png) [@Eric\_de\_Been](https://community.homey.app/u/Eric_de_Been)\
**Post date:** [April 25, 2021, 7:47am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/753 "2021-04-25T07:47:45Z")

</div>

[{“id”:“8494b422.f82368”,“type”:“ui\_text”,“z”:“954d837b.7141d8”,“group”:“4582325b.247cdc”,“order”:2,“width”:0,“height”:0,“name”:"",“label”:“Dagopbrengst”,“format”:" {{msg.payload}} kW",“layout”:“row-center”,“x”:560,“y”:180,“wires”:},{“id”:“4582325b.247cdc”,“type”:“ui\_group”,“name”:“Solar Power”,“tab”:“a2490d0e.a872b”,“order”:1,“disp”:true,“width”:“6”,“collapse”:true},{“id”:“a2490d0e.a872b”,“type”:“ui\_tab”,“name”:“Homey Dashboard”,“icon”:“dashboard”,“order”:1,“disabled”:false,“hidden”:false}]

---

<div class="post-metadata">

**Author:** ![SvenRhein](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@SvenRhein](https://community.homey.app/u/SvenRhein)\
**Post date:** [April 26, 2021, 7:57am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/754 "2021-04-26T07:57:25Z")

</div>

hi @Eric_de_Been

thx for your response but I am not able to import your flow…

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/9/b9300c1b19619a7dc56401f66c16399e4fe62cbe.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:** [April 27, 2021, 7:51am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/755 "2021-04-27T07:51:09Z")

</div>

The Json formatting was converted with “smart quotes” ( " changed to “ )  
This should work (not tested):  
`[{"id":"8494b422.f82368","type":"ui_text","z":"954d837b.7141d8","group":"4582325b.247cdc","order":2,"width":0,"height":0,"name":"","label":"Dagopbrengst","format":" {{msg.payload}} kW","layout":"row-center","x":560,"y":180,"wires":[]},{"id":"4582325b.247cdc","type":"ui_group","name":"Solar Power","tab":"a2490d0e.a872b","order":1,"disp":true,"width":"6","collapse":true},{"id":"a2490d0e.a872b","type":"ui_tab","name":"Homey Dashboard","icon":"dashboard","order":1,"disabled":false,"hidden":false}]`

---

<div class="post-metadata">

**Author:** ![RogerSt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rogerst/32/12432_2.png) [@RogerSt](https://community.homey.app/u/RogerSt)\
**Post date:** [April 28, 2021, 9:09pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/756 "2021-04-28T21:09:54Z")

</div>

Hi,  
I had the problem that sometimes my Homey would lose the MQTT connection, which is why the dashboard would stop working. This would not be immediately visible, so I created a status indicator.

Just sharing the example here:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/6/86a29af7e703d5a20ca493750d25c757d24209ec.png)

The signal symbol is orange if all is OK, it blinks orange/grey if no mqtt message was received in the past 30 seconds or longer, and turn red if no message was received for more than 2 minutes.

Here’s the flow:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/0/6078a189399b68881e01ccaee073636087151df3.png)

Have fun with the code:

```
[{"id":"9bfbfc38.0bb22","type":"switch","z":"7a3033ea.2f403c","name":"","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"homeypro","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":390,"y":1840,"wires":[["8e52f2a5.94fe8"]]},{"id":"8e52f2a5.94fe8","type":"function","z":"7a3033ea.2f403c","name":"","func":"var nu = Date.now();\n\nglobal.set(\"LaatsteMQTTBerichtOntvangen\",nu);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1840,"wires":[[]]},{"id":"5dc5699.2d93198","type":"inject","z":"7a3033ea.2f403c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":380,"y":1880,"wires":[["3782d33a.022c4c"]]},{"id":"3782d33a.022c4c","type":"function","z":"7a3033ea.2f403c","name":"","func":"\nvar nu= msg.payload;\nvar meesteRecenteBerichtTimestamp = global.get(\"LaatsteMQTTBerichtOntvangen\");\n\nvar millis = nu - meesteRecenteBerichtTimestamp;\n\nverschilInSeconden = Math.floor(millis / 1000);\n\nvar icnColor=\"#888888\";\nvar pl = \"\";\nvar icon=\"\";\n\nif (verschilInSeconden<31)\n{\n icnColor=\"#FFAA00\"; \n icon=\"fa fa-signal\";\n}\nelse if (verschilInSeconden<121)\n{\n if (verschilInSeconden % 2)\n {\n icnColor=\"#FFAA00\"; \n } else\n {\n icnColor=\"#888888\"; \n }\n icon=\"fa fa-signal\";\n}\nelse\n{\n icnColor=\"#FF4444\"; \n icon=\"fa fa-signal\";\n}\npl = \"MQTT data\";\n\nmsg = {payload:pl, Iconcolor:icnColor, IconShape:icon};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":1880,"wires":[["63732e86.2e011"]]},{"id":"63732e86.2e011","type":"ui_template","z":"7a3033ea.2f403c","group":"f0c86728.497088","name":"mqttReceivingIndicator","order":6,"width":5,"height":1,"format":"<span style=\"vertical-align:middle; font-size:25px; color: rgb(255, 255, 255); text-align: left; \" class=\"fr-class-transparency\">\n <i style=\"color:{{msg.Iconcolor}}!important;\" class={{msg.IconShape}} aria-hidden=\"true\"></i>&nbsp;\n <span>{{msg.payload}}</span>\n</span>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":750,"y":1880,"wires":[[]]},{"id":"f0c86728.497088","type":"ui_group","name":"Energie Vandaag","tab":"9184a885.936cb8","order":1,"disp":true,"width":"18","collapse":false},{"id":"9184a885.936cb8","type":"ui_tab","name":"Energie","icon":"dashboard","order":3,"disabled":false,"hidden":false}]
```

---

<div class="post-metadata">

**Author:** ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)\
**Post date:** [April 28, 2021, 9:49pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/757 "2021-04-28T21:49:51Z")

</div>

@RogerSt out of curiosity, do you experience less connection issues with the new version of the MQTT Cliënt (v3.0.0)?

---

<div class="post-metadata">

**Author:** ![RogerSt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rogerst/32/12432_2.png) [@RogerSt](https://community.homey.app/u/RogerSt)\
**Post date:** [April 29, 2021, 6:00am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/758 "2021-04-29T06:00:20Z")

</div>

Hi, I have not encountered an MQTT issue yet, so I cannot tell at this point in time Harrie.  
Sorry, no news…

---

<div class="post-metadata">

**Author:** ![RogerSt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rogerst/32/12432_2.png) [@RogerSt](https://community.homey.app/u/RogerSt)\
**Post date:** [May 7, 2021, 7:42pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/759 "2021-05-07T19:42:03Z")

</div>

No issues so far - stable as h.ll 🙂  
Thanks Harrie, much appreciated!

---

<div class="post-metadata">

**Author:** ![HarriedeGroot](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/harriedegroot/32/56160_2.png) [@HarriedeGroot](https://community.homey.app/u/HarriedeGroot)\
**Post date:** [May 7, 2021, 8:53pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/760 "2021-05-07T20:53:03Z")

</div>

💪 thanks for your feedback!

---

<div class="post-metadata">

**Author:** ![RogerSt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rogerst/32/12432_2.png) [@RogerSt](https://community.homey.app/u/RogerSt)\
**Post date:** [May 13, 2021, 9:08pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/762 "2021-05-13T21:08:22Z")

</div>

Hey all, any cool examples of dashboards to share here?  
Would be good to see the results posted from all information gathered in this topic.  
I know I would appreciate if all of us share cool new things no-one else has posted yet… 😃  
Ohhhhh and of course: thanks! 🕶

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

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