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

Ok, nevermind. Sorry i was too quickly, i used the wrong template node. You said use the blue one lol, instead i used the orange one, my fault . Now it works, thanks :wink:

Here i am again lol.
I’m using a temp/humidity sensor in one, would it somehow be possible to place the temperature with icon (like now) and humidity with icon besides eachother?
Thank you

That’s possible. But it’s a bit more complicated. Every time you want to update the template node, you need send both value’s. The only way that’s possible, is to store these value’s in a global variable (or “flow” variable if it only needs to exists on the current page/flow). On change of one of these values / sensors you need to collect them inside a function node, and make a sub-playload out of it.
Like: msg.temperature and msg.humidity. You can insert these value’s inside the HTML node with: {{msg.temperature}}

But, there is an easier way to create just what you want. Just adjust the template node size half of the container size. This way two template nodes can exist next to each other:
afbeelding

1 Like

Hello everyone. I wanted to ask you if this happens to you.

I have on the main screen the current day and time. Until now, I haven’t had any problems and it was showing me the dates correctly.

Today I have noticed that the month of May appears as “Undefinedo”. I have checked the translation and I see that it is correct, but I don’t know why this “Undefinedo” appears in the month of May.

I leave the flow code in case they can think of where the problem may be.

Thank you very much for your help.

232336

[{"id":"a9b22498.87eb98","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"8402276a.e0a6b8","type":"simpletime","z":"a9b22498.87eb98","name":"Tijd","x":390,"y":320,"wires":[["2d8392ad.99ffbe"]]},{"id":"ffe249a4.a4d708","type":"inject","z":"a9b22498.87eb98","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":320,"wires":[["8402276a.e0a6b8"]]},{"id":"2d8392ad.99ffbe","type":"moment","z":"a9b22498.87eb98","name":"","topic":"","input":"payload","inputType":"msg","inTz":"Europe/London","adjAmount":"2","adjType":"hours","adjDir":"add","format":"HH:mm:ss","locale":"es_ES","output":"","outputType":"msg","outTz":"Etc/UTC","x":600,"y":320,"wires":[["1b0ed193.c3b86e","a5a5decd.5a7c6"]]},{"id":"1b0ed193.c3b86e","type":"function","z":"a9b22498.87eb98","name":"Store Time in global variable","func":"var Time=global.get(\"GlobalTime\") || '';\nglobal.set(\"GlobalTime\",msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":900,"y":340,"wires":[[]]},{"id":"d82b7fdd.7423c","type":"ui_template","z":"a9b22498.87eb98","group":"9e908f06.94c48","name":"Tijd / Datum","order":1,"width":10,"height":3,"format":"<p style=\"font-size:45px; text-align: center; font-weight: bold;\">{{msg.time}}</p> \n<p style=\"font-size:15px; text-align: center; font-weight: bold;\"><i style=\"color:#0094CE!important;\" class=\"fa fa-calendar\" aria-hidden=\"true\"></i>&nbsp;&nbsp;{{msg.date}}</p>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":1230,"y":300,"wires":[[]]},{"id":"a5a5decd.5a7c6","type":"function","z":"a9b22498.87eb98","name":"Set icon color and temperature","func":"var Datevar=global.get(\"GlobalDate\") || '';\nmsg = {time:msg.payload, date:Datevar};\nreturn msg;","outputs":1,"noerr":0,"x":910,"y":300,"wires":[["d82b7fdd.7423c"]]},{"id":"e195ed38.554f9","type":"comment","z":"a9b22498.87eb98","name":"Obtenemos el Día y la Hora","info":"","x":640,"y":200,"wires":[]},{"id":"2665fac5.857026","type":"moment","z":"a9b22498.87eb98","name":"","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":"2","adjType":"hours","adjDir":"add","format":"dddd DD MMMM YYYY","locale":"es_ES","output":"","outputType":"msg","outTz":"Etc/UTC","x":600,"y":420,"wires":[["f8d657ff.1a2848"]]},{"id":"213ad1ce.7410ae","type":"function","z":"a9b22498.87eb98","name":"Store date in global variable","func":"var Datevar=global.get(\"GlobalDate\") || '';\nglobal.set(\"GlobalDate\",msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":1020,"y":420,"wires":[[]]},{"id":"f8d657ff.1a2848","type":"function","z":"a9b22498.87eb98","name":"Translate","func":"var mapObj = {\n Monday:\"Lunes\",\n Tuesday:\"Martes\",\n Wednesday:\"Miercoles\",\n Thursday:\"Jueves\",\n Friday:\"Viernes\",\n Saturday:\"Sabado\",\n Sunday:\"Domingo\",\n January:\"Enero\",\n February:\"Febrero\",\n March:\"Marzo\",\n April:\"Abril\",\n May:\"Mayo\",\n June:\"Junio\",\n July:\"Julio\",\n August:\"Agosto\",\n September:\"Septiembre\",\n October:\"Octubre\",\n November:\"Noviembre\",\n December:\"Diciembre\"\n};\nmsg.payload = msg.payload.replace(/Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|January|February|March|April|May|June|July|August|September|October|November|December/gi, function(matched){\n return mapObj[matched];\n});\n\n\nreturn msg;","outputs":1,"noerr":0,"x":800,"y":420,"wires":[["213ad1ce.7410ae"]]},{"id":"cb3b0425.e4a2a8","type":"simpletime","z":"a9b22498.87eb98","name":"Tijd","x":390,"y":420,"wires":[["2665fac5.857026","31ca4d0d.4fa6f2"]]},{"id":"634e7ca1.e31ef4","type":"inject","z":"a9b22498.87eb98","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":420,"wires":[["cb3b0425.e4a2a8"]]},{"id":"d4c4d2f9.8f37e","type":"function","z":"a9b22498.87eb98","name":"Store date in global variable","func":"var Datevar=global.get(\"GlobalDateShort\") || '';\nglobal.set(\"GlobalDateShort\",msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":1020,"y":460,"wires":[[]]},{"id":"31ca4d0d.4fa6f2","type":"moment","z":"a9b22498.87eb98","name":"","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":"2","adjType":"hours","adjDir":"add","format":"DD-MM","locale":"es_ES","output":"","outputType":"msg","outTz":"Etc/UTC","x":600,"y":460,"wires":[["d4c4d2f9.8f37e"]]},{"id":"9e908f06.94c48","type":"ui_group","z":"","name":"Hoy","tab":"41973f9d.b568a","order":2,"disp":true,"width":"10","collapse":false},{"id":"41973f9d.b568a","type":"ui_tab","z":"","name":"Home","icon":"home","order":1}]

Hi all,

I am a complete noob at Node-red and could use a little help with tweaking two graphs on my Homey MQTT Node-red Dashboard. I managed to obtain the temperature and humidity values from my sensors and to display them as lines in two graphs. One graph displays the temperature in 6 rooms and the other the humidity in those 6 rooms. However, I am unable to set the same colour of the lines for the temperature and humidity of the same room in the two graphs. Please see the screenshots of my Node-red flow and the dashboard. Could someone please explain to me how I can get this done? Thanks in advance!

I really am frustrated, sorry fot that i needed to complain after i spent till 4:00 in the morning to get it working without results.

I probably do something wrong but i can’t figure out what.

My setup:

-MQTT Client installed on Homey
-MQTT Hub installad on Homey
-MQTT Broker (Mosquitto) installed on my PC
-Node-Red installed on my PC
-Mqtt Explorer installed on my PC

Things I got working:

The example at the beginning from the start of this topic Reads the values and changes the state of the switch in de ui of node-red when i turn the light on or off pysically

Aantekening 2020-05-13 094607

But like

Checked and double checked everything but it does not function

like adding /set to the end of the topic

and also:

mqtt receive convert (upload://mIAko9VPMArI7ie9rhfuDh0E8A7.png) switch ![switch|462x309,]sendmgtt explorer

Thw weird thing is that if i slide the switch on the node-red dash it switches back to the "false" position instantly... Solved this it was due to the fact that i had a space behind /set → "/set " instead of “/set” but still it does not work from node-red to homey…

Please help…going nuts…

Update

I kept fooling around and changed the topic from homey topic to deviceid and it worked. I think Homey-topic does not work at least with me…

Until 10 days ago, I did not know anything about MQTT or Node RED. For some time, I was looking for a dashboard to get some more overview, because the default Homey app is not very suitable for that purpose. After reading this post from @satoer, I installed the MQTT Client and Hub on Homey and created a MQTT broker and Node Red container on a Synology. This post and the large number of contributions from other forum members were very, very helpful, so a very big thank you, to you all!
The image shows the current state of my dashboard. I am still learning.

Searching for some more knowledge about Node RED, I found this series of lectures: http://noderedguide.com/

3 Likes

Hello @Tangodelta, how did you manage to redirect the Google Nest hub to your Dashboard? As I understand, the Nest hub does have a built-in browser, but does not have an onscreen keyboard?

Awesome job Paul, but…
afbeelding
Seriously!? It was over 30 degrees today :laughing: :rofl: :rofl:

But that’s cold. On Christmas Day supposed to be 40+ degrees. That’s how’s here Down Under :joy::joy:

oh, that is really simple, just put the url link in dashboard, will post a image later…a bit busy working on my roof

Hi,

Can someone help me please?

On my qnap nas I have installed QIot and node-red.
I want to install the MQTT broker and connect it to homey. For that I have installed on Homey the MQTT client and the MQTT hub.

I gave first the broker and the client the ip-adress of the qnap nas with the 1883 port. It could not connect with that. Then I changed the port to the port of the qnap nas with the same result. Then I tried the ip-adress of the homey with both ports. Still no change.

I also tried it with the username and password of the qnap nas and homey. it won’t connect.

What do I have to do to get it working?

The MQTT hub shows all the devices of the homey.

The client and hub isn’t the broker. You also need to install a MQTT broker somewhere. The most easy solution is the MQTT broker app on your Homey, but the best solution is to install this on your NAS. This will save precious Homey RAM. After installing And linking IP Addresses try to connect MQTT explorer.

Sorry, i wasn’t clear enough. I have installed the broker on my qnap nas, but it won’t connect.

Can you connect MQTT Explorer to the Broker?

Are you using an external IP? I had a problem connecting to the broker installed on my Synology. After I’d set the the IP to internal, it worked:

PS
The ‘validate certificate’ works either way, in my setup.

If I install the MQTT broker on my homey and make it active, then I can connect to the broker on homey with the MQTT explorer.

It does not connect to the broker on my qnap nas. Can somebody tell step by step how to install it the right way on my qnap nas? Thanks

I personally use a Synology. Isn’t there a "package centre, or “App-store” on the Qnap? I’ve installed the Mosquitto broker directly from the package centre. I don’t recall even configuring it (Don’t even know how to configure it :joy:) It works better than the Homey version. It seems to re-broadcast sensor data if a Mqtt device asks for it.


I believe you can also install it inside a docker container. (I have no experience with this).

Thanks for your support
I have installed MQTT in a docker now but I don’t get the settings right.

Is there someone with a qnap nas who can help?

Nice examples and explanation here, I learn a lot about MQTT and Node-Red.
Al tinkering, and sometimes with a lot of aggravation if it fails, I get things working
Thank you!

Is it possible that the group layout is being static?
I now notice that as the browser screen widens, the group order also changes.

btw:
It takes about 40 seconds before the ‘Buienradar’ is loaded. Is that normal?

1 Like