Hallo zusammen.
Ich habe ein Problem einen Flow in Node Red ans Laufen zu bringen, vllt kann mir jemand helfen. Bekomme ständig die Meldung : Invalid Message. Alle anderen Flows hih laufen. Debug Node vor dem homee Device gibt die Werte korrekt raus.
Hier ist mal der Code, vllt sieht ja jemand was falsch ist.:
[
{
„id“: „4be977b1fa487438“,
„type“: „inject“,
„z“: „ef5171524b51207d“,
„name“: „alle 2 Min“,
„props“: [
{
„p“: „payload“
}
],
„repeat“: „120“,
„crontab“: „“,
„once“: true,
„onceDelay“: 0.1,
„payload“: „“,
„payloadType“: „str“,
„x“: 150,
„y“: 280,
„wires“: [
[
„d07c7f292a006c25“,
„658c4efab4409307“
]
]
},
{
„id“: „d07c7f292a006c25“,
„type“: „ioBroker get“,
„z“: „ef5171524b51207d“,
„name“: „pt1000Garraum“,
„topic“: „esphome.0.E05A1BE2BC5C.Sensor.1688271064.state“,
„attrname“: „payload“,
„payloadType“: „value“,
„errOnInvalidState“: „nothing“,
„x“: 280,
„y“: 200,
„wires“: [
[
„3eb361bd5db65989“
]
]
},
{
„id“: „658c4efab4409307“,
„type“: „ioBroker get“,
„z“: „ef5171524b51207d“,
„name“: „pt1000Einstechfühler“,
„topic“: „esphome.0.E05A1BE2BC5C.Sensor.1688271067.state“,
„attrname“: „payload“,
„payloadType“: „value“,
„errOnInvalidState“: „nothing“,
„x“: 260,
„y“: 380,
„wires“: [
[
„38381698e8f59226“
]
]
},
{
„id“: „3eb361bd5db65989“,
„type“: „function“,
„z“: „ef5171524b51207d“,
„name“: „Format PT1000 → homee“,
„func“: „let temp = parseFloat(msg.payload);\nmsg.payload = [{ id: 301, value: temp }];\nreturn msg;“,
„outputs“: 1,
„noerr“: 0,
„x“: 450,
„y“: 260,
„wires“: [
[
„combineTemps“
]
]
},
{
„id“: „38381698e8f59226“,
„type“: „function“,
„z“: „ef5171524b51207d“,
„name“: „Format PT100 → homee“,
„func“: „let temp = parseFloat(msg.payload);\nmsg.payload = [{ id: 302, value: temp }];\nreturn msg;“,
„outputs“: 1,
„noerr“: 0,
„x“: 470,
„y“: 320,
„wires“: [
[
„combineTemps“
]
]
},
{
„id“: „combineTemps“,
„type“: „function“,
„z“: „ef5171524b51207d“,
„name“: „Kombiniere und sende“,
„func“: „// Sammle Werte im Flow-Kontext\nlet temps = flow.get(‚temps‘) || {};\n\nlet attrId = msg.payload[0].id;\nlet val = msg.payload[0].value;\n\ntemps[attrId] = val;\nflow.set(‚temps‘, temps);\n\n// Wenn beide Werte vorhanden sind, kombiniere und sende\nif(temps[301] !== undefined && temps[302] !== undefined) {\n msg.payload = [\n { id: 301, value: temps[301] },\n { id: 302, value: temps[302] }\n ];\n flow.set(‚temps‘, {}); // Reset für nächsten Zyklus\n return msg;\n} else {\n return null;\n}“,
„outputs“: 1,
„noerr“: 0,
„x“: 700,
„y“: 280,
„wires“: [
[
„5295640a4d62258d“
]
]
},
{
„id“: „5295640a4d62258d“,
„type“: „homeeDevice“,
„z“: „ef5171524b51207d“,
„virtual-homee“: „“,
„name“: „Grillthermometer“,
„nodeId“: „300“,
„showNodeId“: false,
„profile“: „3009“,
„icon“: „nodeicon_temperature“,
„attributes“: [
{
„type“: 5,
„state“: 1,
„instance“: 0,
„minimum“: -50,
„maximum“: 295,
„current_value“: 0,
„target_value“: 0,
„last_value“: 0,
„name“: „Temperatur 1“,
„unit“: „%C2%B0C“,
„step_value“: 0.5,
„editable“: 0,
„id“: „301“,
„node_id“: „300“
},
{
„type“: 5,
„state“: 1,
„instance“: 1,
„minimum“: -50,
„maximum“: 295,
„current_value“: 0,
„target_value“: 0,
„last_value“: 0,
„name“: „Temperatur 2“,
„unit“: „%C2%B0C“,
„step_value“: 0.5,
„editable“: 0,
„id“: „302“,
„node_id“: „300“
}
],
„statusTemplate“: „“,
„x“: 930,
„y“: 280,
„wires“: [
]
}
]
Gruss Roland