Here is a simple flow for showing images. Not so fancy but it gives you the idea:
- The http request works for now but I do not know for how long, you can edit the url as you prefere
- You can send images as buffers via MQTT
- I have added a file node to read and show a local image file
Well, you see the rest, just try it out
[
{
"id": "99ff9ce1be7b0cb5",
"type": "mqtt in",
"z": "f2f18323778993ca",
"name": "Image",
"topic": "motion/#",
"qos": "0",
"datatype": "auto-detect",
"broker": "90b02ee78ae15ec3",
"nl": false,
"rap": false,
"inputs": 0,
"x": 350,
"y": 1120,
"wires": [
[
"63a080c688704ed5"
]
]
},
{
"id": "63a080c688704ed5",
"type": "base64",
"z": "f2f18323778993ca",
"name": "Encode",
"action": "",
"property": "payload",
"x": 510,
"y": 1120,
"wires": [
[
"8cc9831c8070309d"
]
]
},
{
"id": "5149bda46c22f5b0",
"type": "inject",
"z": "f2f18323778993ca",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": "",
"topic": "",
"payload": "data:image/jpg;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7",
"payloadType": "str",
"x": 700,
"y": 1170,
"wires": [
[
"198f7c3982262ac6"
]
]
},
{
"id": "198f7c3982262ac6",
"type": "ui-template",
"z": "f2f18323778993ca",
"group": "e09ee07d132abea6",
"page": "",
"ui": "",
"name": "",
"order": 2,
"width": "0",
"height": "0",
"head": "",
"format": "<!-- https://vuetifyjs.com/en/components/images/#usage -->\n\n<template>\n <div>\n <!-- Image src: {{ info || 'none' }} -->\n <v-img\n v-if=\"msg.payload\"\n :width=\"msg.width || 150\"\n aspect-ratio=\"msg.aspec || 16/9\"\n cover\n :src=\"msg.payload\"\n ></v-img>\n </div>\n</template>\n\n<script>\n export default {\n computed: {\n info: function () {\n if (!this.msg.payload) {\n return ''\n }\n if (this.msg.payload.length > 80) {\n return this.msg.payload.substring(0,77) + \"...\"\n }\n return this.msg.payload\n }\n }\n }\n</script>",
"storeOutMessages": true,
"passthru": true,
"resendOnRefresh": true,
"templateScope": "local",
"className": "",
"x": 890,
"y": 1120,
"wires": [
[]
]
},
{
"id": "8cc9831c8070309d",
"type": "change",
"z": "f2f18323778993ca",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "\"data:image/jpg;base64,\" & payload",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 1120,
"wires": [
[
"198f7c3982262ac6"
]
]
},
{
"id": "fcfa403fb3fce806",
"type": "file in",
"z": "f2f18323778993ca",
"name": "",
"filename": "meter.jpg",
"filenameType": "str",
"format": "",
"chunk": false,
"sendError": false,
"encoding": "none",
"allProps": false,
"x": 350,
"y": 1190,
"wires": [
[
"63a080c688704ed5"
]
]
},
{
"id": "8686f031974e9f12",
"type": "inject",
"z": "f2f18323778993ca",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 190,
"y": 1190,
"wires": [
[
"fcfa403fb3fce806"
]
]
},
{
"id": "baaf2660585b63e6",
"type": "http request",
"z": "f2f18323778993ca",
"name": "",
"method": "GET",
"ret": "bin",
"paytoqs": "ignore",
"url": "https://www.svtstatic.se/image-news/760/cinema/0.45/0.28/c0c81d44e24d9c4eeb96086a835bd305009cd59b6974a655e33724f101ff29b3",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 350,
"y": 1260,
"wires": [
[
"63a080c688704ed5",
"0da183dd1d248de9"
]
]
},
{
"id": "b65fbbb4acf64638",
"type": "inject",
"z": "f2f18323778993ca",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 190,
"y": 1260,
"wires": [
[
"baaf2660585b63e6"
]
]
},
{
"id": "0da183dd1d248de9",
"type": "debug",
"z": "f2f18323778993ca",
"name": "debug 15",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 540,
"y": 1260,
"wires": []
},
{
"id": "90b02ee78ae15ec3",
"type": "mqtt-broker",
"name": "",
"broker": "192.168.0.233",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "e09ee07d132abea6",
"type": "ui-group",
"name": "Group 4",
"page": "f85cf0eee9119058",
"width": "4",
"height": "1",
"order": 1,
"showTitle": false,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "f85cf0eee9119058",
"type": "ui-page",
"name": "Hemma",
"ui": "72c1e5a9ec204878",
"path": "/home",
"icon": "home",
"layout": "grid",
"theme": "0d92c765bfad87e6",
"order": 2,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "72c1e5a9ec204878",
"type": "ui-base",
"name": "My Dashboard",
"path": "/dashboard",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control",
"ui-chart"
],
"showPathInSidebar": false
},
{
"id": "0d92c765bfad87e6",
"type": "ui-theme",
"name": "Basic Blue Theme",
"colors": {
"surface": "#4d58ff",
"primary": "#0094ce",
"bgPage": "#eeeeee",
"groupBg": "#ffffff",
"groupOutline": "#cccccc"
},
"sizes": {
"pagePadding": "12px",
"groupGap": "12px",
"groupBorderRadius": "4px",
"widgetGap": "12px",
"density": "default"
}
},
{
"id": "38d5e333f8aee67c",
"type": "global-config",
"env": [],
"modules": {
"node-red-node-base64": "1.0.0",
"@flowfuse/node-red-dashboard": "1.30.2"
}
}
]