Hi, I am currently facing a problem where I do not know how to display a car plate number that has been read by a Plate Recogniser. How do I only display the carplate number shown in this image on the text node?
The documentation contains a wealth of information and explains how to do this and understanding the message structure is at the core of node-red. Suggest to go through the "working with messages" part of the documentation.
In addition, make sure to read the documentation panel within the editor, select the text node and select the documentation panel.
For your text node the value would be {{ msg.payload.results[0].plate }}
Hi, no offence but you seem very new to all this.
I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.
Yes you are right, I am very new to this.
I managed to figure out the problem already.
Thank you guys so much for the help.
And then present the result with ui_template
node with a little bit CSS added ...
[{"id":"4a92d3bd.6496dc","type":"ui_template","z":"11af8890.7bdd97","group":"d8f1e676.bd2948","name":"Plate","order":5,"width":"4","height":"1","format":"<div class='plate'>\n <div class='sign eu'>{{msg.payload.country}}</div>\n <div class='num {{msg.payload.country}}'>{{msg.payload.plate}}</div>\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":750,"y":800,"wires":[[]]},{"id":"8b619b66.d669f8","type":"inject","z":"11af8890.7bdd97","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":390,"y":800,"wires":[["adcf2017.3c754"]]},{"id":"adcf2017.3c754","type":"change","z":"11af8890.7bdd97","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.country","pt":"msg","to":"EST","tot":"str"},{"t":"set","p":"payload.plate","pt":"msg","to":"554 ASD","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":800,"wires":[["4a92d3bd.6496dc"]]},{"id":"560cebaa.4f11d4","type":"ui_template","z":"11af8890.7bdd97","group":"d8f1e676.bd2948","name":"Vehicle registration plate CSS","order":6,"width":0,"height":0,"format":"<style id='VRP'>\n .plate{\n width: 100%;\n height: 80%;\n position: relative;\n margin: auto;\n display: flex;\n box-shadow: 0 0 0 2px black;\n border-radius: 3px;\n font-family:'Arial Narrow';\n }\n .plate .sign.eu{\n background-color: #003399;\n flex-grow: 1;\n border-bottom-left-radius: 3px;\n border-top-left-radius: 3px;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI4MTAiIGhlaWdodD0iNTQwIiB2aWV3Qm94PSIwIDAgODEwIDU0MCI+DQo8ZGVmcz48ZyBpZD0icyI+PGcgaWQ9ImMiPjxwYXRoIGlkPSJ0IiBkPSJNMCwwdjFoMC41eiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCwtMSlyb3RhdGUoMTgpIi8+PHVzZSB4bGluazpocmVmPSIjdCIgdHJhbnNmb3JtPSJzY2FsZSgtMSwxKSIvPjwvZz48ZyBpZD0iYSI+PHVzZSB4bGluazpocmVmPSIjYyIgdHJhbnNmb3JtPSJyb3RhdGUoNzIpIi8+PHVzZSB4bGluazpocmVmPSIjYyIgdHJhbnNmb3JtPSJyb3RhdGUoMTQ0KSIvPjwvZz48dXNlIHhsaW5rOmhyZWY9IiNhIiB0cmFuc2Zvcm09InNjYWxlKC0xLDEpIi8+PC9nPjwvZGVmcz4NCjxyZWN0IGZpbGw9IiMwMzkiIHdpZHRoPSI4MTAiIGhlaWdodD0iNTQwIi8+PGcgZmlsbD0iI2ZjMCIgdHJhbnNmb3JtPSJzY2FsZSgzMCl0cmFuc2xhdGUoMTMuNSw5KSI+PHVzZSB4bGluazpocmVmPSIjcyIgeT0iLTYiLz48dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI2Ii8+PGcgaWQ9ImwiPjx1c2UgeGxpbms6aHJlZj0iI3MiIHg9Ii02Ii8+PHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJyb3RhdGUoMTUwKXRyYW5zbGF0ZSgwLDYpcm90YXRlKDY2KSIvPjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0icm90YXRlKDEyMCl0cmFuc2xhdGUoMCw2KXJvdGF0ZSgyNCkiLz48dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InJvdGF0ZSg2MCl0cmFuc2xhdGUoMCw2KXJvdGF0ZSgxMikiLz48dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InJvdGF0ZSgzMCl0cmFuc2xhdGUoMCw2KXJvdGF0ZSg0MikiLz48L2c+PHVzZSB4bGluazpocmVmPSIjbCIgdHJhbnNmb3JtPSJzY2FsZSgtMSwxKSIvPjwvZz4NCjwvc3ZnPg==);\n background-size: 100% auto;\n background-repeat: no-repeat;\n background-position: center 10%;\n font-size: 8px;\n line-height: 54px;\n text-align: center;\n font-weight: 600;\n color: white;\n }\n .plate .num.EST{\n background-color: #efefe8;\n position: relative;\n flex-grow: 6;\n text-align: center;\n border-top-right-radius: 3px;\n border-bottom-right-radius: 3px;\n color: black;\n font-weight: 700;\n font-size: 30px;\n line-height: 35px;\n word-spacing: 0.5em;\n }\n</style>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"global","x":670,"y":840,"wires":[[]]},{"id":"d8f1e676.bd2948","type":"ui_group","name":"Default","tab":"84350e6b.7f5f3","order":1,"disp":true,"width":"6","collapse":false},{"id":"84350e6b.7f5f3","type":"ui_tab","name":"Away","icon":"dashboard","disabled":false,"hidden":false}]
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.