Skip to content

Commit

Permalink
Create node_red_flow.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 20, 2024
1 parent 566df2b commit 05b51c4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions config/node_red_flow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// node_red_flow.js
const NodeRED = require("node-red");

// Create a new Node-RED flow
const flow = new NodeRED();

// Add nodes to the flow
flow.addNode({
id: "energy-usage",
type: "mqtt in",
topic: "energy/usage"
});

flow.addNode({
id: "energy-production",
type: "mqtt in",
topic: "energy/production"
});

flow.addNode({
id: "dashboard",
type: "ui dashboard",
nodes: ["energy-usage", "energy-production"]
});

// Deploy the flow
flow.deploy();

0 comments on commit 05b51c4

Please sign in to comment.