When adding a Debug node to the Node-red workflow with aeufy-security node, the workflow will generate debug messages like "Non-parsable parameter" messages and "JSON" errors, even when the output the eufy-security node is not connected to a debug node.
// remove `RED.log`, and allow the EufySecurity object to use the default dummy log.
this.driver = await EufySecurity.initialize(driverConnectionConfig);
Make the initialiser use (or not use) the RED.log object as an option in the Properties page (a checkbox) of the eufy-security node.
Create a custom log object and initialise with that instead. The eufy-security node could then have a second output nodule for log messages passed onto a standard debug node (that you can then switch on an off at will at runtime).
Issue
When adding a Debug node to the Node-red workflow with a
eufy-security
node, the workflow will generate debug messages like "Non-parsable parameter" messages and "JSON" errors, even when the output theeufy-security
node is not connected to adebug
node.This is due to https://github.com/recallfx/node-red-contrib-eufy-security/blob/cc38cf23a3891925fefaa19f2a4a6d838f721630/eufy-security/01-eufy-security.js#L90 setting the global log to the underlying 'eufy-security-client' object being initialized with the
RED.log
object.The errors generated are known, and common - as decribed in issue https://github.com/bropat/eufy-security-client/issues/344
This is not predictable, nor fixable in the dependent
eufy-security-client
object, and thus will flood any/all debug objects used in node-red flows.Workaround
The quickest way to fix this is to change the initialization line from:
to
(This then calls the underlying initialiser https://github.com/bropat/eufy-security-client/blob/2c376bc8889b1f92961289b96a7bc667deda8609/src/eufysecurity.ts#L84-L88 )
Not ideal as this will make issues invisible.
Possible "proper" fixes
RED.log
object as an option in the Properties page (a checkbox) of theeufy-security
node.eufy-security
node could then have a second output nodule for log messages passed onto a standarddebug
node (that you can then switch on an off at will at runtime).