Skip to content

Commit

Permalink
Add basement humidity
Browse files Browse the repository at this point in the history
  • Loading branch information
KjellRanda committed Aug 5, 2024
1 parent 71feaeb commit dbb1beb
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Gulen/NodeRed/Transform_basemnt_hum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
let dt = new Date(msg.payload.ctime);
let topic = msg.topic;
var os = global.get('os');
var hostname = os.hostname();

node.log("")
node.log(dt + " Host - " + hostname)
node.log("Topic - " + msg.topic)

let val = msg.payload.val;

node.log("Basement huidity=" + val + "%")

msg = {}
msg.payload = [{
"bsmnt_humid": val,
"time": dt.getTime() * 1000000
},
{
"host": hostname,
"topic": topic
}];

return msg;

0 comments on commit dbb1beb

Please sign in to comment.