Iâm currently planning for my mini to arrive. Iâve used your json output above to create a Node-Red json to mqtt converter. I want to use the output with multiple devices via mqtt. If you use Node-Red give this a try.
[
{
"id": "18ee8d84.34c782",
"type": "inject",
"z": "ea3945d9.c8d4a8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 140,
"y": 1280,
"wires": [
[
"c2072069.25f55"
]
]
},
{
"id": "c2072069.25f55",
"type": "http request",
"z": "ea3945d9.c8d4a8",
"name": "",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "htttp://[ip address of the mini]/api/telemetry",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 330,
"y": 1280,
"wires": [
[
"5a65e0b0.3fba7"
]
]
},
{
"id": "5a65e0b0.3fba7",
"type": "function",
"z": "ea3945d9.c8d4a8",
"name": "",
"func": "if (msg.payload.project_name) {\n var mqttTopicPrefix = \"prusa-connect/\"\n var msgs = [];\n\n for (const [key, value] of Object.entries(msg.payload)) {\n msgs.push({topic: mqttTopicPrefix+key, payload: value});\n }\n return [msgs]\n}",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 500,
"y": 1280,
"wires": [
[
"1fa2852d.6479cb"
]
]
},
{
"id": "1fa2852d.6479cb",
"type": "mqtt out",
"z": "ea3945d9.c8d4a8",
"name": "",
"topic": "",
"qos": "",
"retain": "",
"broker": "837c761e.10e788",
"x": 690,
"y": 1280,
"wires": []
},
{
"id": "837c761e.10e788",
"type": "mqtt-broker",
"name": "mosquitto",
"broker": "myMqttBroker",
"port": "1883",
"clientid": "Node-RED",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
}
]