Hi All,
I’ve build a “Function Node” that connects to an “All Events Node”. If I deploy Node Red I get an error in de debug log: “TypeError: Cannot read properties of undefined (reading ‘device_id’)”, which refers to the “Funciton Node”.
I can’t seem to figure out why this error is thrown
Code: Function Node
var p1 = msg.payload.event_type;
var p2 = msg.payload.event.device_id;
if (p1 == "zha_event" && p2 == "089da0ea7e55279c0a0fc2cd6a8b4304") {
msg.payload = true;
return [msg, null];
}
Payload:
Error: