Problem showing payload on template

Hello everybody,
I've a problem with the attached flow. The problem is that the template shows only the value that I inject, but I need to see both at same time.

Where I'm wrong?
Thanks to all

flows.json (5.6 KB)

Use a join node so that all messages arriving at the ui-template contain both msg.payload.alba and msg.payload.tramonto.

Thanks fo your answer, but I did not understand what I must write in change node and in join node.

Can you explain me a little more please?

Thank you

I think this should work.

[{"id":"b9da0b1fa37085a1","type":"file in","z":"1f30610c.47c63f","name":"Legge file \"Orario Alba\"","filename":"/root/scripts/effemeridi/orario_alba","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":570,"y":380,"wires":[["3e89bc77aa801728"]]},{"id":"e4023aaff1b4b453","type":"file in","z":"1f30610c.47c63f","name":"Legge file \"Orario Tramonto\"","filename":"/root/scripts/effemeridi/orario_tramonto","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":580,"y":420,"wires":[["f7c2f8d3dc771bec"]]},{"id":"3e89bc77aa801728","type":"change","z":"1f30610c.47c63f","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"alba","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":380,"wires":[["d71f38e7100bb9d0"]]},{"id":"f7c2f8d3dc771bec","type":"change","z":"1f30610c.47c63f","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"tramonto","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":420,"wires":[["d71f38e7100bb9d0"]]},{"id":"9f173d3cb075fca9","type":"inject","z":"1f30610c.47c63f","name":"Avvia processo","props":[],"repeat":"60","crontab":"","once":true,"onceDelay":"1","topic":"","payloadType":"str","x":340,"y":420,"wires":[["e4023aaff1b4b453"]]},{"id":"1c1e941d50d04e26","type":"inject","z":"1f30610c.47c63f","name":"Avvia processo","props":[],"repeat":"60","crontab":"","once":true,"onceDelay":"1","topic":"","payloadType":"str","x":340,"y":380,"wires":[["b9da0b1fa37085a1"]]},{"id":"8fa322de3ef93fee","type":"ui_template","z":"1f30610c.47c63f","group":"5abbafc9.891a2","name":"Pagina HTML","order":1,"width":6,"height":"2","format":"<!DOCTYPE html>\n\n<html>\n<head>\n<style>\n\n/* SCRITTA ORARIO ALBA */\n.scritta_orario_alba{\n   font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;\n   font-weight: bold;\n   font-size: 22px;\n   color: grey;\n   position: absolute;\n   bottom: 10px;\n   left: 2%;\n}\n\n/* SCRITTA ORARIO TRAMONTO */\n.scritta_orario_tramonto{\n   font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;\n   font-weight: bold;\n   font-size: 22px;\n   color: grey;\n   position: absolute;\n   bottom: 10px;\n   right: 2%;\n}\n\n</style>\n</head>\n\n<body> \n\n<div class=\"scritta_orario_alba\">{{msg.payload.alba}}</div>\n\n<div class=\"scritta_orario_tramonto\">{{msg.payload.tramonto}}</div>\n\n\n</body>\n</html>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1140,"y":400,"wires":[[]]},{"id":"d71f38e7100bb9d0","type":"join","z":"1f30610c.47c63f","name":"","mode":"auto","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":970,"y":400,"wires":[["8fa322de3ef93fee","3729f994433f64c9"]]},{"id":"3729f994433f64c9","type":"debug","z":"1f30610c.47c63f","name":"debug 391","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1130,"y":440,"wires":[]},{"id":"5abbafc9.891a2","type":"ui_group","name":"Prove","tab":"e10fbfb4.4b9ec","order":1,"disp":true,"width":"6","collapse":false},{"id":"e10fbfb4.4b9ec","type":"ui_tab","name":"Prove","icon":"dashboard","order":15,"disabled":false,"hidden":false}]

However I am unsure about your template node, I don't think you need the doctype, head and body tags in a Node-red dashboard template.

Sorry, but doesn't work.
Nothing appaer in Dashboard and the Debug Messages show this

My mistake, not had coffee yet! Setup the join node like this

Correct... No coffee!!! One beer :slight_smile:

I finish a work and I try your last solution
Thanks in advance

YESS !!!!
It works

Thank you very much and if you came in North Italy, you have 2 (not only one) paid beers
Start with this: :beer:

Now I implement your solution in my really DASHBOARD. It is a little bit more complex that the example I've posted, but if it works here, it will works also in my DASHBOARD

Bye bye

1 Like