Skip to content

Commit

Permalink
Data to NodeRed dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
KjellRanda committed Sep 9, 2024
1 parent 3bb5d41 commit 23efc47
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Gulen/NodeRed/dehumidifierInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
let retmsg = {};
retmsg.payload = {};

let dps = msg.payload.data.dps;

if (dps[4] === "low") {
retmsg.payload.speed = 1;
} else if (dps[4] === "mid") {
retmsg.payload.speed = 2;
} else if (dps[4] === "high") {
retmsg.payload.speed = 3;
}

if (dps[1] === true) {
retmsg.payload.power = "Powered on";
} else {
retmsg.payload.power = "Powered off";
retmsg.payload.speed = 0;
}

node.log("")
node.log("Dehumidifier status=" + retmsg.payload.power + ". Speed=" + dps[4]);

return retmsg;

0 comments on commit 23efc47

Please sign in to comment.