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

<div class="post-metadata">

**Author:** ![Merpster](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/merpster/32/27588_2.png) [@Merpster](https://community.homey.app/u/Merpster)\
**Post date:** [August 27, 2020, 6:28pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/554 "2020-08-27T18:28:48Z")

</div>

Hi Everybody,

This is the first version of my dashboard. Work still in progress but happy with the result so far.

Setup:

- Homey Pro, MQTT Hub and MQTT client on Homey, MQTT Broker and Node Red on a Raspberry Pi4.
- Used old iPad2 with Kiosk app as screen. All running in an isolated vlan.
- Made iPad bracket myself from wood and aluminum profiles. To avoid battery issues: power is only on for 2 hrs every 8 hrs , controlled by Homey 😀
- Tried to make dashboard so that you can see the status from a distance. Green is “all ok” and red is something to pay attention to. If you want more info you need to look closer;

Still to do:

- Include snapshots or stream of IP camera(‘s). Didn’t figure out how to do this yet;
- Add Heimdall (security stuff , status etc);
- Better alignment of buttons, graphs and text. I need to get better understanding of the use of CSS to avoid waste of white space and ugly text alignment.
- Something clickable with pop-up to save space (e.g. show camera snapshot of frontdoor when clicked on frontdoor movement or more detailed wheather forecast when clicked on small version etc);
- Nicer looking dimmer button (make one button, including slider)
- Make use of dark and light theme. Dark looks better I think but requires some additional styling which I do not know how to do yet;
- Improve stability. After reboot of Homey+apps and/or adding devices things are not always fully synchronized (in Homey and on dashboard). Takes a few on/off cycles to get in sync it seems. Feels like Homey needs to set the status once before I can use the dashboard. In general the whole system feels less robust than before the implementation of MQTT\node red.
- Turn dashboard screen on/off based on motion (but do not have the space to implement the Bluetooth solution Satoer made)
- Whatever can be added and/or improved… 🤓

**General look:**

 ![Dashboard](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/3/33074e8fdf360f174dca7ec419a7b2e4ffbbb1e6.jpeg)

**Dashboard Standard Status:**

 ![Dashboard standard](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/f/cf8643d16d29e2ac83923386d374f45e631e6309.jpeg)

**Dashboard with some activity:**

 ![Dashboard active](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/c/1cb85e22ad4f724f2c158926b0989ba584295c73.jpeg)

---

<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:** [August 29, 2020, 9:09am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/555 "2020-08-29T09:09:09Z")

</div>

> [@Merpster](#):
>
> Include snapshots or stream of IP camera(‘s). Didn’t figure out how to do this yet;

Take a look at this post:

> [@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/206):
>
> You don’t have to refresh the whole page for using buien radar (or any other image that needs updating). Just use a timestamp node that triggers every minute (or 5 minutes or whatever). Connect that to a function node with this: msg.payload = "https://api.buienradar.nl/image/1.0/RadarMapNL?w=720&h=600?"+Math.random(); return msg; The “?”+Math.random(); makes the difference. Everything behind the ? gets ignored, but with the random number behind it, the browser thinks it’s a different image an…

But in my experience this works only in Safari and probably not in a kiosk browser (tested several). Somehow third party apps aren’t allowed to embed passwords in the URL or something.

> [@Merpster](#):
>
> Turn dashboard screen on/off based on motion (but do not have the space to implement the Bluetooth solution Satoer made)

The Bluetooth (esp32) solution does not work for an old iPad2. You need BLE for that and the old iPad 2 does not support that. I soldered wires directly to the magnetic hall sensor to wake the tablet with a wemos D1 / homeyduino. But I do not recommend it. It requires to open the iPad and that’s a real nightmare (I needed to replace the connector socket anyway).

---

<div class="post-metadata">

**Author:** ![Merpster](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/merpster/32/27588_2.png) [@Merpster](https://community.homey.app/u/Merpster)\
**Post date:** [August 29, 2020, 6:18pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/556 "2020-08-29T18:18:51Z")

</div>

Thanks for the info!  
I’m almost there. I hope…

Steps taken:

- Finally found a working url for getting my Dahua cam snapshot: [http://user:password@ipadres](http://user:password@ipadres):port/cgi-bin/snapshot.cgi?
- Entering this url in browser gave a nice snapshot without getting a separate login pop up
- Putting the url via a function node as payload into a template node make a dashboard picture.
- Tested it on my day-to-day iPAD: works fine. Weird enough running the same dashboard on Edge or Chrome on my PC doesn’t work. No snapshot pictures at all. But as long as it works on an iPAD I am happy.
- Created firewall rules to make sure that my (old) dashboard iPAD in the IOT VLAN could talk to the Dahua IP-cam in de camera VLAN.
- Entering the above url in a safari browser session on the (old) dashboard iPAD also gives a nice snapshot (after clicking a warning on malicious websites away). So network/firewalling should be ok now;
- But… no picture in the dashboard on my dashboard iPAD. 🤨

A far as I can see the version of the Kiosk app I use is also the same, so I am a bit lost on what the issue could be. Any suggestions?

Some evidence.

Works on day-to-day iPAD (in Kiosk app!)

![nieuwe ipad werkt](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/5/15a0027fd30fb280f2183dbe54f21ecdaed5213f.jpeg)

But doesn’t work on old Dashboard iPAD (in same Kiosk app)

 ![oude ipad werkt niet](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/3/033d513ba8410e25073c94498db7f78e1fe59d06.jpeg)

and doesn’t work on dashboard in browser:

![Browser werkt niet](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/7/1789e3b8e2e44d62dd46fd13f80baee6d640425d.jpeg)

---

<div class="post-metadata">

**Author:** ![Joenoo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joenoo/32/18671_2.png) [@Joenoo](https://community.homey.app/u/Joenoo)\
**Post date:** [August 31, 2020, 3:22pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/557 "2020-08-31T15:22:24Z")

</div>

Hi @Satoer,

Sorry if this answer was already given, but how did you manage to open an extra panel to choose the light color? I am building a dashoard too but I am running short on space due to the size of my old iPad2. I really like the idea of an extra panel to show more detail or extra options.

I’ve already tried to open a new page, but this works rather slow. Probably also due to the old iPad2.

---

<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:** [September 1, 2020, 8:49am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/558 "2020-09-01T08:49:02Z")

</div>

N00B here. I have a nice CSS for the background mimicking homey. However, every time I use the UI template node, I get a black background colour which I cannot seem to get changed.  
Any help is appreciated. See the screenshot here:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/6/d611d8b328ae876f7574208c51b81e30293f989c.png)  
The source code I tried is this:

```
<p style="text-align: center; background-color: rgba(1,1,1, 0.5);">Woonkamer</p>
<p style="font-size:35px; text-align: left; font-weight: bold; background-color: rgba(1,1,1, 0); " >&nbsp;<i style="color:#0094CE!important;" class="fa fa-thermometer-three-quarters" aria-hidden="true"></i>{{msg.payload}}&deg;</p> 

```

I need transparent background really… Pulling my hair… ☹

---

<div class="post-metadata">

**Author:** ![Joenoo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joenoo/32/18671_2.png) [@Joenoo](https://community.homey.app/u/Joenoo)\
**Post date:** [September 1, 2020, 2:49pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/559 "2020-09-01T14:49:38Z")

</div>

@RogerSt Did you by any chance take a look at the CSS in this post?

> [@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/443):
>
> Here it is, my custom CSS for my Node-Red DashBoard. Whitout the CSS, it’s look like this. Just copy and import it in Node-Red and you get this. The CSS code. [{"id":"d81aa8bc.35b81","type":"ui\_template","z":"d6fa9f2d.3d501","group":"339d0edc.4ffe02","name":"Node-Red Dashboard Custom CSS","order":1,"width":0,"height":0,"format":"\<style\>\nroot, a, button, p, div {\n -webkit-user-select: none !important;\n}\n\nbody {\n bac…

---

<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:** [September 1, 2020, 8:56pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/561 "2020-09-01T20:56:37Z")

</div>

Yup - still struggling. CSS is not my cup of tea I guess…

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

---

<div class="post-metadata">

**Author:** ![Joenoo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/joenoo/32/18671_2.png) [@Joenoo](https://community.homey.app/u/Joenoo)\
**Post date:** [September 2, 2020, 7:01am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/562 "2020-09-02T07:01:49Z")

</div>

CSS n00b here too, but I used the CSS from the post I mentioned before. No probs at all. The transparent background is already in it.

The temps are placed in a UI template node same as you did. Did not use any extra styling:

 ![Firefox_Screenshot_2020-09-02T06-54-07.883Z](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/1/413dadbc78c8e167accfb891c997e3aac5f60252.png)

```
<table border="0" style="width: 100%;">
<tbody>
	<tr>
		<td style="width: 25.0000%;"><span style="vertical-align:middle; font-family: Arial,Helvetica,sans-serif; font-size:15px; color: rgb(255, 255, 255);"><span class="fr-class-transparency">&nbsp;&nbsp;Woonkamer:</span></span>
<span style="vertical-align:middle; font-family: Arial,Helvetica,sans-serif; font-size:20px; color: rgb(255, 255, 255);"><BR>&nbsp;&nbsp;{{msg.payload["homie/homey-topic/thermostat/woonkamer/measure-temperature"]}}&deg;</span>
			<br>
		</td>
		...
	</tr>
</tbody>

```

---

<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:** [September 2, 2020, 12:24pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/563 "2020-09-02T12:24:45Z")

</div>

Would be interested in understanding how to create the large cloud icons depending on weather conditions.  
If you have some time, thanks!

---

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

</div>

Thanks!! @Joenoo, this really helped:

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

Still work in progress but it looks nice enough for me. Now I still need to figure out how to create weather dependent icons like sunshine cloudy, rain etc.

---

<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:** [September 2, 2020, 12:33pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/565 "2020-09-02T12:33:17Z")

</div>

Hi @MFM_Bart, how did you get the week forecast image? Can you please share your URL?

---

<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:** [September 2, 2020, 12:45pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/566 "2020-09-02T12:45:36Z")

</div>

Hi,

import this and you have it.

[{“id”:“772c8687.22f798”,“type”:“inject”,“z”:“a95ec7f3.3a81e8”,“name”:"",“topic”:"",“payload”:"",“payloadType”:“date”,“repeat”:“60”,“crontab”:"",“once”:true,“onceDelay”:0.1,“x”:90,“y”:120,“wires”:[[“84be3435.bf522”,“46890e59.0b9e9”]]},{“id”:“84be3435.bf522”,“type”:“function”,“z”:“a95ec7f3.3a81e8”,“name”:"",“func”:“d = new Date().getTime()\no = “”\nreturn {template:o};”,“outputs”:1,“noerr”:0,“x”:230,“y”:160,“wires”:[[“946cffb5.105f18”]]},{“id”:“946cffb5.105f18”,“type”:“ui\_template”,“z”:“a95ec7f3.3a81e8”,“group”:“4d8e4022.a6059”,“name”:“Buienradar weersvoorspelling “,“order”:2,“width”:“4”,“height”:“4”,“format”:””,“storeOutMessages”:true,“fwdInMessages”:true,“templateScope”:“local”,“x”:450,“y”:180,“wires”:[[“6ffcd8db.c29bd8”]]},{“id”:“6ffcd8db.c29bd8”,“type”:“debug”,“z”:“a95ec7f3.3a81e8”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“x”:650,“y”:180,“wires”:},{“id”:“4d8e4022.a6059”,“type”:“ui\_group”,“z”:"",“name”:“Weer”,“tab”:“e2581a51.3f011”,“order”:1,“disp”:true,“width”:“7”,“collapse”:false},{“id”:“e2581a51.3f011”,“type”:“ui\_tab”,“z”:"",“name”:“Het weer”,“icon”:“dashboard”,“order”:3,“disabled”:false,“hidden”:false}]

---

<div class="post-metadata">

**Author:** ![Jos\_Stultjens](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jos_stultjens/32/12687_2.png) [@Jos\_Stultjens](https://community.homey.app/u/Jos_Stultjens)\
**Post date:** [September 3, 2020, 7:53am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/567 "2020-09-03T07:53:21Z")

</div>

Please also check this page: [https://www.buienradar.nl/overbuienradar/gratis-weerdata](https://www.buienradar.nl/overbuienradar/gratis-weerdata)  
Near the bottom of this webpage you can see which URL you can select. You can select the forecast of a weather station “near” your home.

---

<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:** [September 3, 2020, 2:04pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/568 "2020-09-03T14:04:22Z")

</div>

Hi,  
After replacing all ‘smart quotes’ with ‘dumb quotes’, I still keep 1 error while importing and I have no clue how to solve… ☹ sorry… almost there I know, but still looking for a bit of help…  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/5/85068584c691af665b096c18e7d1fe487ec93d94.png)

---

<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:** [September 8, 2020, 7:19am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/569 "2020-09-08T07:19:08Z")

</div>

Hi Marius,

N00B here - so ignorance warning… only using node red since a week now.

The simplest way I believe at present, is by creating separate tabs and giving each user their own tab.

Or…? Did you find another solution to your enquiry?

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [September 8, 2020, 9:32am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/570 "2020-09-08T09:32:42Z")

</div>

;\nreturn looks strange for me, (not a programmer) try `return`

---

<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:** [September 8, 2020, 11:28am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/571 "2020-09-08T11:28:23Z")

</div>

`\n` is a regular newline. That is not the issue. But thanks for thinking with me!!!

---

<div class="post-metadata">

**Author:** ![Grooviee](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/grooviee/32/1363_2.png) [@Grooviee](https://community.homey.app/u/Grooviee)\
**Post date:** [September 8, 2020, 7:11pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/572 "2020-09-08T19:11:59Z")

</div>

replacing the `o="";` with `o=\"\";` should do the trick

---

<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:** [September 8, 2020, 8:58pm UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/573 "2020-09-08T20:58:11Z")

</div>

excellent!!! Thanks

---

<div class="post-metadata">

**Author:** ![Andre\_Hartman](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andre_hartman/32/20281_2.png) [@Andre\_Hartman](https://community.homey.app/u/Andre_Hartman)\
**Post date:** [September 9, 2020, 9:36am UTC](https://community.homey.app/t/node-red-a-widget-based-dashboard-working-with-homey-trough-mqtt/18798/574 "2020-09-09T09:36:58Z")

</div>

Hello, A fews weeks I had my dashboard working.  
Now the MQTT receiver is nog connecting

 ![Schermafbeelding 2020-09-09 om 11.34.41](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/7/8782fa7e55cdb2c9ce17d664984d75a0abb47566.png)

Again I followed your tutorial. I can’t get it working.

Please advise where to look

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

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