diff --git a/io-package.json b/io-package.json index 2852ef4..9b66152 100755 --- a/io-package.json +++ b/io-package.json @@ -1,7 +1,7 @@ { "common": { "name": "vedirect", - "version": "0.3.1", + "version": "0.3.3", "news": { "0.3.2": { "en": "Message buffer implemented to avoid system overload", diff --git a/main.js b/main.js index 0b9e100..d512ed1 100644 --- a/main.js +++ b/main.js @@ -70,16 +70,21 @@ class Vedirect extends utils.Adapter { const parser = port.pipe(new ReadlineParser({delimiter: '\r\n'})); parser.on('data', (data) => { - + this.log.debug(`[Serial data received] ${data}`) if (!bufferMessage) { + this.log.debug(`Message buffer inactive, processing data`); this.parse_serial(data); if (this.config.messageBuffer > 0) { + this.log.debug(`Activate Message buffer with delay of ${this.config.messageBuffer * 1000}`); bufferMessage = true; if (timeouts['mesageBuffer']) {clearTimeout(timeouts['mesageBuffer']); timeouts['mesageBuffer'] = null;} timeouts['mesageBuffer'] = setTimeout(()=> { bufferMessage = false; + this.log.debug(`Message buffer timeout reached, will process data`); }, this.config.messageBuffer * 1000); } + } else { + this.log.debug(`Message buffer active, message ignored`); } // Indicate connection status @@ -253,7 +258,7 @@ class Vedirect extends utils.Adapter { case 'MON': this.stateSetCreate(res[0], res[0], await this.get_monitor_type(res[1])); break; - + case 'DC_IN_V': this.stateSetCreate(res[0], res[0], Math.floor(res[1]) / 100); break; @@ -265,7 +270,7 @@ class Vedirect extends utils.Adapter { case 'DC_IN_P': this.stateSetCreate(res[0], res[0], Math.floor(res[1])); break; - + default: // Used for all other measure points with no required special handling this.stateSetCreate(res[0], res[0], res[1]); break; diff --git a/package-lock.json b/package-lock.json index 4a8183a..959dfaf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "iobroker.vedirect", - "version": "0.3.2", + "version": "0.3.3", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 200b128..0e341bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.vedirect", - "version": "0.3.2", + "version": "0.3.3", "description": "Read VE.direct data from Victron devices", "author": { "name": "DutchmanNL",