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

<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:** [October 10, 2020, 12:26pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/635 "2020-10-10T12:26:59Z")

</div>

Thank you for sharing.  
I have added 3496 lines of JSON to a new Node-RED project and everything looks fine.

I’m also notice already a few nice settings you have used and some thing I can learn from.  
Need to install some dependencies to get the graphical dashboard to show up.  
I wil give it a try later.

Thank you very much!

---

<div class="post-metadata">

**Author:** ![rkokkelk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rkokkelk/32/26853_2.png) [@rkokkelk](https://community.homey.app/u/rkokkelk)\
**Post date:** [October 10, 2020, 7:44pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/636 "2020-10-10T19:44:23Z")

</div>

If anyone is running a Node Red dashboard via an Android device, FYI I created a Homey App so you control your device via Homey. For info see [topic](https://community.homey.app/t/app-dashboard-controller/35761).

---

<div class="post-metadata">

**Author:** ![eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@eric](https://community.homey.app/u/eric)\
**Post date:** [October 13, 2020, 3:52pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/637 "2020-10-13T15:52:56Z")

</div>

Maybe you followed the guide in the first post as I did, and I noticed there is a small ‘error’ in the JSON you copy. Check if the topic names are correct after you use find/replace to put in your own names. One entry is different from the rest (if I recall correct it is the name of a light in the MQTT input block) so that one isn’t replaced properly.

---

<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:** [October 14, 2020, 7:06pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/638 "2020-10-14T19:06:15Z")

</div>

You’re welcome! Have fun 😃

---

<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:** [October 15, 2020, 11:28am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/639 "2020-10-15T11:28:58Z")

</div>

Hi @Satoer,

Did you describe anywhere how you mounted the tablet? With hidden cables etc.?  
Or are you aware of a good resource regarding this topic?

Thanks, Roger

---

<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:** [October 15, 2020, 11:29am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/640 "2020-10-15T11:29:56Z")

</div>

Looking great!

---

<div class="post-metadata">

**Author:** ![Carlo\_Hermus](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/carlo_hermus/32/24557_2.png) [@Carlo\_Hermus](https://community.homey.app/u/Carlo_Hermus)\
**Post date:** [October 17, 2020, 4:44pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/641 "2020-10-17T16:44:42Z")

</div>

I just started experimenting with Node-red, I love it. It not only gives you a dashboard but way more control. I am Tuya Converting my plugs and switches(which are capatible) and installed node-red en MQTT broker on my Pi. Working great with MQTT Client and Tasmota MQTT.

Would it not be great to have node-red installed on Homey? So you can have flow only for standard users and flows/node-red for Tinkers and experienced users.

---

<div class="post-metadata">

**Author:** ![maja2020](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/maja2020/32/3549_2.png) [@maja2020](https://community.homey.app/u/maja2020)\
**Post date:** [October 18, 2020, 3:27pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/642 "2020-10-18T15:27:11Z")

</div>

Hi, today I succesfully imported your very nice energy dashboard page. I would like to share the things I had to do to fire it up, for the benefit of other users. I use a plugwise energie monitor and my solarpanel inverter is from Goodwe. I use the homey SolarPanels (Zonnepanelen) app and the Plugwise Smile app.

On import I had to remove the Solar input node and connect the switch outputs for solar panel readings to the two solar panel input functions.

The first run delivered some errors in functions in the debugwindow. Caused by:

- retrieving global variables that do not exist
- Use Mqtt input instead of the solar module in the input functions
- persistent storage json files that cannot be found.

The solution to the first is quite simple. If you add the code `||0` (or zero) to the global.get statements in the variable declarations in the functions, the variables resolve to zero in case the variable does not exist yet. Now the variables resolved to “undefined” which causes the functions to fail.  
The second error was caused by the two solarpanel input functions, I commented out the first line which reads a fancy msg object, the mqtt input from the homey app is just a simple payload string.

I still have to figure out how to create the persistent storage json files.

I also had to set my initial meter readings and the start year of the gasmeter in two functions to initialize current values. And change the input switch functions to listen to my own mqtt server and the right homey topics.

Some fintuning needed, but it works fine. Thanks for sharing.

---

<div class="post-metadata">

**Author:** ![Matej\_Kapusta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matej_kapusta/32/941_2.png) [@Matej\_Kapusta](https://community.homey.app/u/Matej_Kapusta)\
**Post date:** [October 21, 2020, 3:35pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/643 "2020-10-21T15:35:52Z")

</div>

Hi, I would like to create a heating modes for my z-wave radiator valves in my Node red dashboard.  
I have a Eurotronic z-wave valves, which has a 5 MQTT “modes”:  
Heat (in Homey app: Comfortable),  
Energy save heat (in Homey app: Economic),  
FULL POWER (in Homey app: Boost),  
MANUFACTURER SPECIFC (in Homey app: Manual)  
and Off (in Homey app: Off).

How can i create a buttons in red node which set a mode in my valves?  
When i set a valve by Homey app to Comfortable, MQTT Client says:

20201021-17:32:02 SendMessageToTopic called  
20201021-17:32:02 SendMessageToTopic: {“qos”:0,“retain”:“1”,“mqttTopic”:“homie/homey-xxx/bedroomvalve/eurotronic-mode-spirit”,“mqttMessage”:“Heat”}  
20201021-17:32:02 publish\_options: {“qos”:0,“retain”:true}  
20201021-17:32:02 send Heat on topic homie/homey-xxx/bedroomvalve/eurotronic-mode-spirit  
20201021-17:32:02 OnMessage called  
20201021-17:32:02 received ‘Heat’ on ‘homie/homey-xxx/bedroomvalve/eurotronic-mode-spirit’  
20201021-17:32:02 Trigger generic card for homie/homey-xxx/bedroomvalve/eurotronic-mode-spirit  
20201021-17:32:02 send message to listeners via realtime api  
20201021-17:32:02 homie/homey-xxx/bedroomvalve/eurotronic-mode-spirit: Heat

---

<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:** [October 21, 2020, 7:49pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/644 "2020-10-21T19:49:45Z")

</div>

I use some global variables to set device power readings that I can then use in various flows. These global vars may indeed not exist in your environment.

Thanks for sharing your learnings as well about missing variables.

For creating the persistent storage files, I used the help info from the component - all necessary info is there… (node-red-contrib-persist)… The file is created when data is received into the file.

---

<div class="post-metadata">

**Author:** ![Kalle\_Ektorne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kalle_ektorne/32/30331_2.png) [@Kalle\_Ektorne](https://community.homey.app/u/Kalle_Ektorne)\
**Post date:** [October 27, 2020, 5:39am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/645 "2020-10-27T05:39:10Z")

</div>

can you share this dash?

---

<div class="post-metadata">

**Author:** ![Kalle\_Ektorne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kalle_ektorne/32/30331_2.png) [@Kalle\_Ektorne](https://community.homey.app/u/Kalle_Ektorne)\
**Post date:** [October 27, 2020, 5:43am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/646 "2020-10-27T05:43:49Z")

</div>

hi @Satoer i don’t know if I’m stupid but I’m new in this a did everything by the book but still my lights not working? maybe i need a raspberry PI? right now only used a router and Homey.

some solutions? or maybe im out my mind?

a got a respons 2020-10-27 06:34:20[node: Output debug](http://127.0.0.1:1880/#)homie/homey-topic/fönstervardagsrum/onoff : msg.payload : boolean

true

2020-10-27 06:34:20[node: Output debug](http://127.0.0.1:1880/#)homie/homey-topic/fönstervardagsrum/onoff : msg.payload : boolean

true

2020-10-27 06:34:22[node: Output debug](http://127.0.0.1:1880/#)homie/homey-topic/fönstervardagsrum/onoff : msg.payload : boolean

false

2020-10-27 06:34:22[node: Output debug](http://127.0.0.1:1880/#)homie/homey-topic/fönstervardagsrum/onoff : msg.payload : boolean

false

---

<div class="post-metadata">

**Author:** ![Matej\_Kapusta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matej_kapusta/32/941_2.png) [@Matej\_Kapusta](https://community.homey.app/u/Matej_Kapusta)\
**Post date:** [October 27, 2020, 6:41am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/647 "2020-10-27T06:41:15Z")

</div>

Hi guys, help me please. I have a Homey with MQTT and Node-red. I would like to save and stored a graph data to some file or database to preserve graphs after restart of my raspberry pi. Can you help me please how can i do that?

---

<div class="post-metadata">

**Author:** ![M\_a\_r\_c\_o](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/m_a_r_c_o/32/146_2.png) [@M\_a\_r\_c\_o](https://community.homey.app/u/M_a_r_c_o)\
**Post date:** [October 27, 2020, 8:48am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/648 "2020-10-27T08:48:22Z")

</div>

Save info via node-red into an influxdb (running on the same host as node-red).  
And then create a dashboard with information from influxdb

Or use the app influxdb app on the homey to export insight data direcly to influx and then use node-red or grafana to create the dashboards.

---

<div class="post-metadata">

**Author:** ![Matej\_Kapusta](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matej_kapusta/32/941_2.png) [@Matej\_Kapusta](https://community.homey.app/u/Matej_Kapusta)\
**Post date:** [October 28, 2020, 9:04am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/649 "2020-10-28T09:04:09Z")

</div>

Thanks for your help. Grafana looks beautiful but doesn’t work with my iPad mini 1 (2012). ☹

---

<div class="post-metadata">

**Author:** ![Kalle\_Ektorne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kalle_ektorne/32/30331_2.png) [@Kalle\_Ektorne](https://community.homey.app/u/Kalle_Ektorne)\
**Post date:** [October 30, 2020, 7:12am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/650 "2020-10-30T07:12:28Z")

</div>

can you share the sensors flow please

---

<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:** [October 30, 2020, 8:09am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/651 "2020-10-30T08:09:28Z")

</div>

I shared the energy dash on oct 10, or do you mean the other one for lighting and heating?

---

<div class="post-metadata">

**Author:** ![Kalle\_Ektorne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kalle_ektorne/32/30331_2.png) [@Kalle\_Ektorne](https://community.homey.app/u/Kalle_Ektorne)\
**Post date:** [October 30, 2020, 8:22am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/652 "2020-10-30T08:22:12Z")

</div>

I men the buttons with locks 🔒

---

<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:** [October 30, 2020, 10:44am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/653 "2020-10-30T10:44:16Z")

</div>

Here are the buttons I use:

```
[{"id":"36f1f46c.1cb0fc","type":"ui_button","z":"9235bbe0.d90a78","name":"TVLEDStrip","group":"e460e8a.9aac518","order":1,"width":3,"height":1,"passthru":false,"label":"TV Led Strip","tooltip":"","color":"#FFFFFF!important","bgcolor":"{{kleur}}","icon":"fa-power-off","payload":"state","payloadType":"flow","topic":"homie/homeypro/tv-led-strip/onoff/set","x":711,"y":1080,"wires":[["3d0e4074.ce98e"]]},{"id":"e460e8a.9aac518","type":"ui_group","z":"","name":"Verlichting Woonkamer","tab":"231f8919.1c14b6","order":3,"disp":true,"width":"6","collapse":true},{"id":"231f8919.1c14b6","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

They are controlled by this function node:

```
[{"id":"6ad9f6c2.e1b458","type":"function","z":"9235bbe0.d90a78","name":"State2Color","func":"if (msg.payload === \"true\"){\n msg.kleur = \"#FFAA00\";\n flow.set(\"state\", \"false\");\n}\nelse {\n msg.kleur = \"#44AAFF\";\n flow.set(\"state\", \"true\");\n }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":1080,"wires":[["36f1f46c.1cb0fc"]]}]

```

The icon used in the button here is fa-power-off but it can easily be replaced by lock, unlock, or unlock-alt.

Not sure you mean these, but here’s the code anyway.

---

<div class="post-metadata">

**Author:** ![Kalle\_Ektorne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kalle_ektorne/32/30331_2.png) [@Kalle\_Ektorne](https://community.homey.app/u/Kalle_Ektorne)\
**Post date:** [October 30, 2020, 10:57am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/654 "2020-10-30T10:57:51Z")

</div>

Thank you for sharing 🙂

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

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