I have this Filter node that is "filtering" the consumption output from my appliances. It gets the value to filter as a property under payload. And it is configured to distinguish devices by topic.
There's another node/flow that processes devices that publish their consumption on another property.
Every night at 0h, an inject node resets the daily kWh value and resets the filter node to force it to process the first value even if it's the same as the previous.
But every night at 0h I'm getting two exceptions on the log. One for every flow and filter node.
I seems like the node is trying to process the reset message and then fails because it doesn't have the configured property.
23 May 00:00:00 - [error] [rbe:6ccbda17501c01d7] TypeError: Cannot read properties of undefined (reading 'energy_daily_kwh')
at /usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:430:29
at Array.reduce (<anonymous>)
at getObjectProperty (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:429:18)
at Object.getMessageProperty (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:401:12)
at RbeNode._inputCallback (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/function/rbe.js:38:34)
at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
at RbeNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
at RbeNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
at RbeNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:485:10)
at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:831:52)
at processImmediate (node:internal/timers:476:21)
23 May 00:00:00 - [error] [rbe:e01ede74ce12e631] TypeError: Cannot read properties of undefined (reading 'energy_import_kwh')
at /usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:430:29
at Array.reduce (<anonymous>)
at getObjectProperty (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:429:18)
at Object.getMessageProperty (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/util.js:401:12)
at RbeNode._inputCallback (/usr/lib/node_modules/node-red/node_modules/@node-red/nodes/core/function/rbe.js:38:34)
at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:210:26
at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
at RbeNode.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:202:11)
at RbeNode.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:186:25)
at RbeNode.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:485:10)
at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:831:52)
at processImmediate (node:internal/timers:476:21)
Is this normal?
Edit: The switch node before the filter is precisely blocking messages that doesn't have the target property defined.