Skip to content

Instantly share code, notes, and snippets.

@h3xagn
Last active May 24, 2025 14:52
Show Gist options
  • Select an option

  • Save h3xagn/f07a0d90f5ceee349cb8a973c7497851 to your computer and use it in GitHub Desktop.

Select an option

Save h3xagn/f07a0d90f5ceee349cb8a973c7497851 to your computer and use it in GitHub Desktop.
NodeRed runction to create line protocol message for InfluxDB
let payload = msg.payload;
let timestamp = new Date(payload.timestamp);
timestamp = Math.floor(timestamp.getTime() / 1000);
let lp_msg = {
"payload": "homedb,sensor=lab_indoor_temp value=" + payload.value + " " + timestamp
}
return lp_msg;
@h3xagn
Copy link
Copy Markdown
Author

h3xagn commented May 24, 2025

initial commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment