node-red-contrib-load-balance-knapsack
v1.0.0
Published
A Node-RED node that load balances electric consumption based on the knapsack algorithm.
Downloads
7
Maintainers
Readme
node-red-contrib-load-balance-knapsack
A Node-RED node that load balances electric consumption based on the knapsack algorithm.
Description
This node receives MQTT messages with topics representing gadget names and their associated electric consumption values as payloads. When a message with the topic max_load_capacity
is received, the node calculates which gadgets can be turned on without exceeding the provided maximum capacity. The resulting payload will contain an array of gadget names that can be turned on within the max capacity.
Installation
Install directly from your Node-RED's setting palette or:
npm install node-red-contrib-load-balance-knapsack
Usage
- Drag and drop the
load-balance-knapsack
node from the palette to your flow. - Connect MQTT nodes or other input nodes to feed electric consumption data.
- Send a message with the topic
max_load_capacity
to trigger the load-balancing algorithm. - The node will output an array of gadget names that can operate within the given max capacity.
Example Input
{
"topic": "kitchen/mixer",
"payload": 30
}
To trigger the load balancing:
{
"topic": "max_load_capacity",
"payload": 100
}
Issues and Feedback
For any issues or feedback related to this node, please open an issue on the GitHub repository.
Author
Harshad Joshi
GitHub
License
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.