A comprehensive monitoring solution for RGBWW IoT devices with automatic network discovery, Prometheus metrics collection, and Grafana dashboards.
- π Automatic Device Discovery: Network topology crawling via
/hostsendpoints - π Stable Device IDs: Uses device IDs as primary keys for consistent metrics
- π Prometheus Integration: Collects metrics from device
/infoendpoints - π Grafana Dashboards: Pre-configured dashboards for monitoring and visualization
- π Network Topology Mapping: Discovers entire device networks automatically
- β‘ Automated Scheduling: 30-minute discovery intervals
- π¦ Multiple Deployment Options: Native installation or containerized
cd native-install/
sudo ./install.shcd containerized/
export INITIAL_CONTROLLER_IP=192.168.1.100 # Your IoT device IP
./rgbww-monitor.sh start| Metric | Description | Labels |
|---|---|---|
device_info |
Static device information | deviceid, device_name, current_rom, git_version, ip |
device_uptime_seconds |
Device uptime in seconds | deviceid |
device_heap_free_bytes |
Available heap memory | deviceid |
device_connected |
Connection status (1=online, 0=offline) | deviceid |
- π Device Overview: Complete inventory with status, memory, uptime
- πΊοΈ Network Topology: Geographic and network visualization
- π Historical Trends: Time-series analysis of device metrics
β οΈ Alerting: Built-in alerts for offline devices and low memory
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β IoT Devices β β JSON Exporter β β Prometheus β
β β β β β β
β /info endpoint ββββββ€ Queries devices ββββββ€ Scrapes metrics β
β /config endpointβ β Converts JSON β β Stores data β
β /hosts endpoint β β to metrics β β β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β² β² β²
β β β
ββββββββββββββββββββββββββ΄βββββββββββββββββββββββββ΄βββββββ
Discovery Script (30min timer) β
βΌ
βββββββββββββββββββ
β Grafana β
β Dashboards β
βββββββββββββββββββ
rgbww-monitoring-project/
βββ README.md # This file
βββ LICENSE # MIT License
βββ CHANGELOG.md # Version history
βββ native-install/ # Native system installation
β βββ install.sh # One-command installer
β βββ uninstall.sh # Complete removal
β βββ config/ # Configuration files
β βββ systemd/ # Service definitions
β βββ scripts/ # Management scripts
βββ containerized/ # Docker/Podman deployment
βββ docker-compose.yml # Multi-service orchestration
βββ rgbww-monitor.sh # Container management script
βββ prometheus/ # Custom Prometheus image
βββ json-exporter/ # JSON Exporter image
βββ grafana/ # Grafana with dashboards
- Initial Seed: Starts with one known device IP or network scan
- Topology Crawling: Queries
/hostsendpoint on each discovered device - Multi-Round Discovery: Continues until no new devices are found
- Metadata Collection: Fetches device names from
/configendpoint - Stable Identification: Uses device IDs from
/infoas primary keys
| Endpoint | Purpose | Data Extracted |
|---|---|---|
/info |
Device status | uptime, heap_free, deviceid, current_rom, git_version |
/config |
Device configuration | device_name |
/hosts |
Network topology | IP addresses of connected devices |
For Native Installation:
- Linux system with systemd
- Root access
- Network access to IoT devices
- Dependencies:
curl,jq(auto-installed)
For Containerized:
- Docker or Podman with docker-compose
- Ports 3000, 7979, 9090 available
- Initial controller IP or network range
# Clone the repository
git clone https://github.com/your-username/rgbww-monitoring.git
cd rgbww-monitoring/native-install/
# Run installer
sudo ./install.sh
# Check status
sudo systemctl status json_exporter iot-discovery.timer# Clone and setup
git clone https://github.com/your-username/rgbww-monitoring.git
cd rgbww-monitoring/containerized/
# Configure initial controller
export INITIAL_CONTROLLER_IP=192.168.1.100
# Start stack
./rgbww-monitor.sh start
# Access Grafana: http://localhost:3000 (admin/rgbww123)# Add device manually
sudo /etc/prometheus/manage-iot-devices.sh add 192.168.1.100
# Discover all devices from one known device
sudo /etc/prometheus/manage-iot-devices.sh discover 192.168.1.100
# List all discovered devices
sudo /etc/prometheus/manage-iot-devices.sh list
# Check system status
sudo /etc/prometheus/iot-status.sh# Devices with low memory
device_heap_free_bytes < 10240
# Average uptime by ROM version
avg by (current_rom) (device_uptime_seconds)
# Device connectivity over time
rate(device_connected[5m])
# Count devices by network
count by (ip) (device_info)
No devices discovered:
- Check network connectivity:
curl http://<device-ip>/info - Verify initial controller IP is reachable
- Check discovery logs:
journalctl -u iot-discovery.service
JSON Exporter not working:
- Test configuration:
systemctl status json_exporter - Check device endpoints return valid JSON
- Verify port 7979 is accessible
Grafana dashboards not loading:
- Check Prometheus connection in Grafana data sources
- Verify metrics are being collected:
curl http://localhost:9090/api/v1/query?query=device_info
- Discovery:
journalctl -u iot-discovery.service - JSON Exporter:
journalctl -u json_exporter - Prometheus:
journalctl -u prometheus - Installation:
/tmp/rgbww-install.log
Edit /etc/prometheus/json_exporter.yml to extract additional fields from device endpoints.
- Create dashboard in Grafana
- Export JSON
- Save to
grafana/dashboards/directory - Restart Grafana
# Change discovery frequency
sudo systemctl edit iot-discovery.timer
# Add:
[Timer]
OnCalendar=
OnCalendar=*:0/15 # Every 15 minutes- Change default Grafana password
- Configure HTTPS/TLS certificates
- Set up authentication (LDAP/OAuth)
- Configure firewall rules
- Set up log rotation
- Use external Prometheus storage
- Configure Grafana with external database
- Set up backup automation
- Use load balancer for Grafana
- Set up alerting rules
- Configure notification channels
- Monitor system resource usage
- Set up external health checks
- Fork the repository
- Create feature branch:
git checkout -b feature-name - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit pull request
# Local development
cd native-install/
sudo ./install.sh
# Test changes
sudo /etc/prometheus/manage-iot-devices.sh discover
sudo /etc/prometheus/iot-status.shThis project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Copyleft Notice: This is free software under a copyleft license. Any derivative works must also be released under GPL v3 or later, ensuring that improvements remain free and open source for the community.
- Prometheus community for excellent monitoring tools
- Grafana team for beautiful visualization platform
- JSON Exporter for flexible metric conversion
- RGBWW IoT device developers for providing accessible APIs
- Documentation: See individual README files in each deployment directory
- Issues: Report bugs via GitHub issues
- Discussions: Use GitHub discussions for questions
- Quick Help: Check troubleshooting section above
π Ready to monitor your IoT devices? Choose your deployment method and get started!