Skip to content

Commit

Permalink
Updated mqtt response to current mqtt package
Browse files Browse the repository at this point in the history
  • Loading branch information
mreschka committed Mar 29, 2020
1 parent 8552ca5 commit e535a1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helios.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ function queueWorker(task, callback) {
task.self.modbusClient.readHoldingRegisters(1, task.heliosVar.modbuslen).then(
function (resp) {
log.debug('Helios get task modbus read for varname ' + task.heliosVar.variable + ' fininshed: ' +
JSON.stringify(resp) + ' payload in ASCII: ' + resp.payload.toString('ascii'));
JSON.stringify(resp) + ' payload in ASCII: ' + resp.response._body.valuesAsBuffer.toString('ascii'));

//V-Teil prüfen, abschneiden und nur Wert weitergeben:
var responseArr = resp.payload.toString('ascii').split("=");
var responseArr = resp.response._body.valuesAsBuffer.toString('ascii').split("=");
if (responseArr.length > 1 && responseArr[0] == task.heliosVar.variable) {
responseArr.shift();

Expand Down

0 comments on commit e535a1c

Please sign in to comment.