node-red-contrib-condition-monitoring 0.1.0
Node-RED Nodes for anomaly detection, predictive maintenance, and time series analysis
node-red-contrib-condition-monitoring
A comprehensive Node-RED module for anomaly detection, predictive maintenance, and time series analysis.
๐ง Project Status: BETA (v0.1.0)
โ ๏ธ This is the first public release - currently in beta testing.
- ๐ First Release: All core features are implemented and functional
- ๐งช Beta Phase: Undergoing real-world validation and testing
- ๐ Feedback Welcome: Please report issues and share your experience
- ๐ API May Change: Breaking changes possible before v1.0 stable release
- โ Production Use: Use with caution and proper testing in your environment
- ๐ฏ Goal: Reach v1.0.0 stable after community feedback and validation
โ ๏ธ Important Disclaimer
This software is provided for condition monitoring and predictive maintenance purposes.
- โ NOT a replacement for safety-critical systems
- โ NOT suitable as the sole means of safety decision-making
- โ Should be used as an additional monitoring layer
- โ Always validate results with domain experts
- โ Follow proper safety protocols and regulations for your industry
Use at your own risk. See LICENSE file for full legal terms.
๐ฏ Features
- 10 Anomaly Detection Methods - Z-Score, IQR, Moving Average, Isolation Forest, Threshold, Percentile, EMA, CUSUM, Multi-Value
- 7 Predictive Maintenance Nodes - Trend Prediction (RUL), FFT Analysis, Vibration Features, Health Index, Rate of Change, Peak Detection, Correlation Analysis
- Real-time Processing - Continuous data stream analysis
- Ready-to-Use Examples - 5 complete example flows in
/examplesdirectory - Fully Documented - Built-in help for every node
๐ฆ Installation
npm install node-red-contrib-condition-monitoring
Or install directly from Node-RED:
- Menu โ Manage palette
- Install tab
- Search for
node-red-contrib-condition-monitoring - Click install
๐ Quick Start
With Docker Compose (Recommended)
# Start Node-RED with the module
docker-compose up -d
# Access at http://localhost:1880
Import Example Flows
- Open Node-RED:
http://localhost:1880 - Menu (โฐ) โ Import โ Examples
- Select one of the 4 example flows:
- Example 1: Motor Monitoring (Z-Score, Trend Prediction, Health Index, Correlation)
- Example 2: Bearing Vibration Analysis (FFT, Peak Detection, IQR)
- Example 3: Process Monitoring (Threshold, CUSUM, EMA, Percentile)
- Example 4: ML Anomaly Detection (Isolation Forest)
๐ See /examples/README.md for detailed documentation of all examples.
๐ Available Nodes
Anomaly Detection (10 Nodes)
| Node | Method | Best For | Output |
|---|---|---|---|
| Z-Score | Statistical | General purpose anomalies | 2 outputs (normal/anomaly) |
| IQR | Quartile-based | Robust to outliers | 2 outputs |
| Moving Average | Trend-based | Gradual changes | 2 outputs |
| Isolation Forest | Machine Learning | Complex patterns | 2 outputs |
| Threshold | Min/Max limits | Hard boundaries | 2 outputs |
| Percentile | Rank-based | Dynamic thresholds | 2 outputs |
| EMA | Exponential smoothing | Recent changes | 2 outputs |
| CUSUM | Cumulative sum | Drift detection | 2 outputs |
| Multi-Value Anomaly | Any method | Multiple sensors | 2 outputs |
| Multi-Value Splitter | Utility | Split sensor arrays | 1 output |
Predictive Maintenance (7 Nodes)
| Node | Function | Output | Use Case |
|---|---|---|---|
| Trend Prediction | RUL calculation | Future values, time-to-threshold | "Motor fails in 48h" |
| FFT Analysis | Frequency analysis | Peaks, spectral features | Bearing fault detection |
| Vibration Features | Feature extraction | RMS, Crest Factor, Kurtosis, Skewness | Comprehensive vibration analysis |
| Health Index | Multi-sensor aggregation | 0-100 health score | Overall equipment status |
| Rate of Change | Derivative analysis | Speed of change, acceleration | Rapid temperature rise |
| Peak Detection | Impact detection | Peak events | Bearing impacts, shocks |
| Correlation Anomaly | Sensor relationship | Correlation coefficient | Temp vs Power relationship |
๐ค Which Node Should I Use?
For Anomaly Detection:
Simple Use Cases:
๐ Hard boundaries (min/max)? โ Threshold Anomaly
- Example: Temperature must stay between 20-80ยฐC
๐ Statistical outliers? โ Z-Score or IQR Anomaly
- Z-Score: Best for normally distributed data
- IQR: More robust, works with any distribution
Trend & Drift Detection:
๐ Slow gradual changes? โ CUSUM Anomaly
- Example: Pump flow slowly decreasing over days
๐ Moving baseline? โ Moving Average or EMA Anomaly
- Moving Average: Equal weight to all values in window
- EMA: Recent values weighted more (faster response)
Advanced Cases:
๐ค Complex patterns, no clear rules? โ Isolation Forest
- Machine learning approach, learns automatically
๐ข Extreme values only? โ Percentile Anomaly
- Example: Detect only top 5% and bottom 5%
Multiple Sensors:
- ๐๏ธ Analyze multiple sensors together? โ Multi-Value Anomaly
- ๐ค Split sensor array for separate processing? โ Multi-Value Splitter
For Predictive Maintenance:
Vibration Analysis:
๐ Time-domain features (RMS, Crest Factor, Kurtosis)? โ Vibration Features
- Best for: Bearing condition, overall vibration health
๐ Frequency analysis (FFT, harmonics)? โ FFT Analysis
- Best for: Finding specific fault frequencies (bearing, gear defects)
๐ฅ Count impacts/shocks? โ Peak Detection
- Best for: Impact counting, shock detection
Trend & Prediction:
โฑ๏ธ Predict when threshold will be reached? โ Trend Prediction
- Calculates Remaining Useful Life (RUL)
- Example: "Temperature will exceed 100ยฐC in 48 hours"
๐ Measure rate of degradation? โ Rate of Change
- Detects rapid changes (acceleration)
- Example: "Temperature rising 5ยฐC per hour"
Health Assessment:
๐ฏ Single health score from multiple sensors? โ Health Index
- Combines temperature, vibration, pressure into 0-100% score
๐ Validate sensor relationships? โ Correlation Anomaly
- Example: Check if temperature and power consumption correlate correctly
Quick Decision Tree:
Do you have historical data?
โโ NO โ Start with Threshold or Z-Score
โโ YES โ Continue below
Is it vibration data?
โโ YES โ Vibration Features + FFT Analysis + Peak Detection
โโ NO โ Continue below
Single sensor or multiple?
โโ SINGLE โ Z-Score / Moving Average / CUSUM
โโ MULTIPLE โ Multi-Value Splitter + Individual Analysis โ Health Index
Need to predict failures?
โโ YES โ Trend Prediction + Rate of Change + Health Index
๐ก Usage Examples
Simple Temperature Monitoring
[MQTT Sensor] โ [Z-Score Anomaly] โ [Normal] โ [Dashboard]
โ [Anomaly] โ [Alarm]
Motor Predictive Maintenance
[Sensors] โ [Multi-Value Splitter] โ [Z-Score]
โ [Trend Prediction] โ RUL Display
โ [FFT Analysis] โ Frequency Chart
โ [Health Index] โ Health Dashboard
Bearing Vibration Analysis
[Vibration Sensor] โ [Vibration Features] โ RMS, Crest Factor, Kurtosis
โ [FFT Analysis] โ Frequency Peaks
โ [Peak Detection] โ Impact Counter
โ [IQR Anomaly] โ Outlier Detection
๐ Documentation
Node-Specific Help
Each node has comprehensive built-in documentation:
- Drag node to canvas
- Select it
- Click โน๏ธ in sidebar
- Read detailed docs with examples
Additional Documentation
- examples/README.md - Detailed guide for all 5 example flows
- PAYLOAD_FORMAT.md - Input format specifications
- MULTI_VALUE.md - Working with multiple sensors
- DOCKER.md - Docker deployment guide
๐ง Node Configuration
Example: Z-Score Anomaly
// Input
msg.payload = 42.5;
// Output (Anomaly)
{
"payload": 42.5,
"zScore": 3.2,
"mean": 35.0,
"stdDev": 2.3,
"isAnomaly": true,
"threshold": 3.0
}
Example: Trend Prediction
// Input
msg.payload = 75.2; // Temperature
msg.timestamp = Date.now();
// Output
{
"payload": 75.2,
"trend": "increasing",
"slope": 0.5,
"predictedValues": [76.2, 76.7, 77.2, ...],
"timeToThreshold": 172800000, // 48 hours in ms
"stepsToThreshold": 96
}
Example: FFT Analysis
// Input (continuous stream at 1000 Hz)
msg.payload = 0.45; // Vibration amplitude
// Output
{
"payload": 0.45,
"peaks": [
{ "frequency": 30, "magnitude": 0.5 },
{ "frequency": 157, "magnitude": 0.3 } // Bearing fault!
],
"dominantFrequency": 30,
"features": {
"spectralCentroid": 85.2,
"crestFactor": 3.5, // High = impulsive behavior
"rms": 0.42
}
}
๐ Learning Path
- Start Simple - Import Example 3 (Process Monitoring)
- Learn Basics - Understand threshold and Z-Score detection
- Advanced Methods - Try FFT and Trend Prediction
- Combine Nodes - Build complete predictive maintenance system
๐ญ Real-World Applications
- Manufacturing - Machine health monitoring, quality control
- Energy - Battery degradation, power quality monitoring
- Automotive - Vehicle diagnostics, fleet management
- HVAC - Climate system optimization, energy efficiency
- Water Treatment - Pump monitoring, leak detection
- Aerospace - Engine monitoring, structural health
- Medical - Equipment monitoring, vital sign analysis
๐ฌ Technical Details
Statistical Methods
| Method | Type | Complexity | Speed | Accuracy |
|---|---|---|---|---|
| Threshold | Rule-based | Low | Fast | Medium |
| Z-Score | Statistical | Low | Fast | High |
| IQR | Statistical | Medium | Fast | High |
| Percentile | Statistical | Medium | Fast | High |
| Moving Average | Trend | Low | Fast | Medium |
| EMA | Trend | Low | Fast | Medium |
| CUSUM | Cumulative | Medium | Fast | High |
| Isolation Forest | ML | High | Medium | Very High |
Predictive Maintenance Capabilities
| Feature | Node | Output |
|---|---|---|
| RUL Estimation | Trend Prediction | Time until failure |
| Frequency Analysis | FFT Analysis | Fault frequencies |
| Overall Health | Health Index | 0-100 score |
| Change Speed | Rate of Change | Derivative |
| Impact Events | Peak Detection | Peak count |
| Sensor Validation | Correlation | Relationship strength |
๐ ๏ธ Development
Run with Docker
# Development mode (with hot-reload)
docker-compose -f docker-compose.dev.yml up
# Production mode
docker-compose up
Local Development
# Install dependencies
npm install
# Link to Node-RED
npm link
cd ~/.node-red
npm link node-red-contrib-condition-monitoring
# Restart Node-RED
node-red-restart
๐ Dependencies
Required
- Node-RED >= 1.0.0
- Node.js >= 14.0.0
Optional
ml-isolation-forest- For Isolation Forest node (falls back to Z-Score if not available)simple-statistics- For advanced statistical functions
๐ค Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests if applicable
- Submit a pull request
๐ License
MIT License - see LICENSE file for details.
๐จโ๐ป Author
blanpa
๐ Issues & Support
- Bug Reports: Open an issue on GitHub
- Questions: Check
/examples/README.mdfirst - Feature Requests: Submit via GitHub issues
๐ Roadmap
- Dashboard UI components
- Export/import of trained models
- MQTT examples
- Real-time charting integration
- More ML algorithms (LSTM, Prophet)
- Automated reporting
โญ Show Your Support
If you find this useful, please consider:
- โญ Starring the repository
- ๐ฆ Sharing with others
- ๐ Reporting bugs
- ๐ก Suggesting features
Made with โค๏ธ for the Node-RED community
Get Started: Import an example flow and start monitoring in minutes!