This repository contains a Grafana dashboard for visualizing Smart Swimming Pool data. The dashboard provides comprehensive monitoring of your pool's vital statistics including temperatures, pump status, solar heating, and historical trends.
Perfect for: Users who want to visualize pool data over time, track energy usage, and analyze pool performance.
- Pool water temperature \u2014 Current and historical
- Solar collector temperature \u2014 Current and historical
- Temperature difference \u2014 Pool vs Solar for efficiency analysis
- Temperature history \u2014 Time series graphs with customizable time ranges
- Pump status \u2014 Real-time on/off state for pool and solar pumps
- Operation mode \u2014 Current mode (Auto, Manual, Boost, Timer)
- Uptime \u2014 Pool controller uptime monitoring
- Pump runtime \u2014 Daily runtime tracking
- Solar heating status \u2014 On/off state
- Solar runtime \u2014 Daily solar heating runtime
- Efficiency calculation \u2014 Based on temperature differential
- Energy savings \u2014 Estimated savings from solar heating
- Time series graphs \u2014 Historical data with zoom and pan
- Gauges \u2014 Current values at a glance
- Status panels \u2014 Binary states with color coding
- Statistics \u2014 Aggregated data (min, max, avg)
| Component | Version | Notes |
|---|---|---|
| Grafana | v7.0+ | v8.0+ recommended for best experience |
| MQTT Data Source Plugin | Latest | marcusolsson-grafana-mqtt |
| MQTT Broker | Any | Mosquitto, EMQX, etc. |
| Pool Controller | v3.0+ | Running and publishing MQTT data |
-
Download dashboard JSON:
# Clone this repository git clone https://github.com/smart-swimmingpool/grafana-dashboard.git cd grafana-dashboard # Or download directly wget https://raw.githubusercontent.com/smart-swimmingpool/grafana-dashboard/master/dashboard-smart-swimming-pool.json
-
Import into Grafana:
- Open Grafana in your browser
- Go to Dashboards \u2192 Import
- Upload the
dashboard-smart-swimming-pool.jsonfile - Select your MQTT data source
- Click Import
- Open Grafana
- Go to Dashboards \u2192 Import
- Enter dashboard ID:
13374(if published to Grafana.com) - Select your MQTT data source
- Click Load then Import
-
Install MQTT plugin:
# For Grafana CLI grafana-cli plugins install marcusolsson-grafana-mqtt # Or via Grafana UI: Configuration \u2192 Plugins \u2192 Install
-
Configure MQTT data source:
- Go to Configuration \u2192 Data Sources \u2192 Add data source
- Select MQTT
- Configure settings:
- Name:
Smart Swimming Pool MQTT - URL:
mqtt://your-broker-ip:1883 - Client ID:
grafana-smart-pool - Username/Password: (if your broker requires authentication)
- Topic:
smart-swimmingpool/# - QoS:
0or1 - Retain:
true(if your broker supports retained messages)
- Name:
-
Test connection:
- Click Save & Test
- Verify connection is successful
The dashboard supports template variables for easy customization:
| Variable | Description | Default Value |
|---|---|---|
pool_controller_id |
Pool Controller identifier | pool-controller |
time_range |
Default time range | 24h |
To customize:
- Click Dashboard Settings (gear icon)
- Go to Variables tab
- Edit variable definitions as needed
Panels:
- Pool Temperature Gauge \u2014 Current pool water temperature
- Solar Temperature Gauge \u2014 Current solar collector temperature
- Temperature History Graph \u2014 Both temperatures over time
- Temperature Difference \u2014 Solar - Pool (\u00b0C)
MQTT Topics:
homeassistant/sensor/pool-controller/pool-temp/state
homeassistant/sensor/pool-controller/solar-temp/state
Panels:
- Pool Pump Status \u2014 On/Off with color coding
- Solar Pump Status \u2014 On/Off with color coding
- Pump Runtime Today \u2014 Total runtime in hours:minutes
- Pump Runtime History \u2014 Daily runtime over time
MQTT Topics:
homeassistant/switch/pool-controller/pool-pump/state
homeassistant/switch/pool-controller/solar-pump/state
smart-swimmingpool/pool-controller/pump/pool/runtime/today
smart-swimmingpool/pool-controller/pump/solar/runtime/today
Panels:
- Solar Heating Status \u2014 On/Off
- Solar Runtime Today \u2014 Total solar heating runtime
- Solar Heating Efficiency \u2014 Calculated from temperature differential
- Energy Savings Estimate \u2014 Based on runtime and efficiency
MQTT Topics:
homeassistant/switch/pool-controller/solar-pump/state
smart-swimmingpool/pool-controller/solar/runtime/today
Panels:
- Operation Mode \u2014 Current mode (Auto, Manual, Boost, Timer)
- Uptime \u2014 Controller uptime
- System Health \u2014 Memory usage, boot count
- Last Update \u2014 Timestamp of last MQTT message
MQTT Topics:
homeassistant/select/pool-controller/mode/state
smart-swimmingpool/pool-controller/uptime
smart-swimmingpool/pool-controller/system/boot-count
smart-swimmingpool/pool-controller/system/memory-free
# Temperature Sensors
homeassistant/sensor/pool-controller/pool-temp/state
homeassistant/sensor/pool-controller/pool-temp/unit_of_measurement
homeassistant/sensor/pool-controller/pool-temp/device_class
homeassistant/sensor/pool-controller/solar-temp/state
homeassistant/sensor/pool-controller/solar-temp/unit_of_measurement
homeassistant/sensor/pool-controller/solar-temp/device_class
# Switches (Pumps)
homeassistant/switch/pool-controller/pool-pump/state
homeassistant/switch/pool-controller/pool-pump/command
homeassistant/switch/pool-controller/solar-pump/state
homeassistant/switch/pool-controller/solar-pump/command
# Select (Operation Mode)
homeassistant/select/pool-controller/mode/state
homeassistant/select/pool-controller/mode/command
# Number (Temperature Thresholds)
homeassistant/number/pool-controller/pool-target-temp/state
homeassistant/number/pool-controller/pool-target-temp/command
homeassistant/number/pool-controller/solar-min-delta/state
homeassistant/number/pool-controller/solar-min-delta/command
# State
smart-swimmingpool/pool-controller/state
# Temperatures
smart-swimmingpool/pool-controller/temperature/pool
smart-swimmingpool/pool-controller/temperature/solar
# Pump States
smart-swimmingpool/pool-controller/pump/pool/state
smart-swimmingpool/pool-controller/pump/solar/state
# Pump Runtimes
smart-swimmingpool/pool-controller/pump/pool/runtime/today
smart-swimmingpool/pool-controller/pump/solar/runtime/today
# Solar State
smart-swimmingpool/pool-controller/solar/state
smart-swimmingpool/pool-controller/solar/runtime/today
# Mode
smart-swimmingpool/pool-controller/mode
# Uptime
smart-swimmingpool/pool-controller/uptime
# System Health
smart-swimmingpool/pool-controller/system/boot-count
smart-swimmingpool/pool-controller/system/memory-free
smart-swimmingpool/pool-controller/system/heap-fragmentation
Complete Reference: Pool Controller MQTT Configuration
-
Edit dashboard in Grafana:
- Click Edit (pencil icon) on the dashboard
- Click Add Panel
-
Configure panel:
- Title: Descriptive name for your panel
- Data Source: Select your MQTT data source
- Query: Enter MQTT topic (e.g.,
smart-swimmingpool/pool-controller/temperature/pool) - Visualization: Choose appropriate type (Graph, Gauge, Stat, etc.)
-
Format data:
- Unit: \u00b0C, \u00b0F, hours, etc.
- Decimals: Number of decimal places
- Thresholds: Color coding for different value ranges
-
Save panel:
- Click Apply to save the panel
- Click Save Dashboard (disk icon) to save changes
-
Export updated dashboard:
- Click Save Dashboard \u2192 Export \u2192 Save to file
- Update the
dashboard-smart-swimming-pool.jsonfile - Submit a pull request
- Click Edit on the panel you want to modify
- Adjust settings as needed:
- Change query topics
- Modify visualization type
- Update color schemes
- Adjust time ranges
- Click Apply to save changes
- Export and update the JSON file
- Document changes in CHANGELOG.md
For advanced users, you can create multiple dashboards for different purposes:
Suggested dashboard organization:
| Dashboard | Purpose | Key Panels |
|---|---|---|
| Overview | Quick status at a glance | Current temperatures, pump status, mode |
| History | Long-term trends | Temperature history, runtime statistics |
| Efficiency | Solar heating analysis | Efficiency calculations, energy savings |
| System | Controller health | Memory usage, uptime, boot count |
-- MQTT Query for Pool Temperature
SELECT
value AS temperature,
time AS timestamp
FROM mqtt
WHERE
topic = 'homeassistant/sensor/pool-controller/pool-temp/state'
AND $timeFilter
ORDER BY time ASC-- MQTT Query for Daily Pool Pump Runtime
SELECT
value AS runtime_minutes,
time AS timestamp
FROM mqtt
WHERE
topic = 'smart-swimmingpool/pool-controller/pump/pool/runtime/today'
AND $timeFilter
ORDER BY time ASCUse Grafana's Transform feature to calculate efficiency:
- Add both temperature queries
- Click Transform tab
- Add Add field from calculation
- Select Binary operation: Subtraction
- Field A: Solar Temperature
- Field B: Pool Temperature
- Result: Temperature Difference (\u00b0C)
- Keep it simple \u2014 Start with essential panels, add more as needed
- Use consistent colors \u2014 Green for good/on, Red for bad/off, etc.
- Group related panels \u2014 Temperature, Pumps, Solar, System
- Use appropriate time ranges \u2014 24h for daily, 7d for weekly, 30d for monthly
- Add descriptions \u2014 Explain what each panel shows
- Limit data points \u2014 Use
$__intervalfor appropriate resolution - Use retained messages \u2014 Reduces MQTT traffic
- Avoid too many panels \u2014 Each panel adds query load
- Use dashboard links \u2014 Link between related dashboards
- Enable persistence \u2014 Store retained messages across broker restarts
- Set appropriate QoS \u2014 QoS 1 for important data, QoS 0 for high-frequency
- Monitor broker health \u2014 Check memory usage, connection count
- Secure your broker \u2014 Use authentication and TLS for production
| Issue | Possible Cause | Solution |
|---|---|---|
| Dashboard shows "No data" | MQTT data source not configured | Check data source settings |
| Panels show "No data" | Wrong MQTT topic | Verify topic names match Pool Controller |
| Dashboard not updating | MQTT connection lost | Check broker status, network connectivity |
| Slow dashboard loading | Too many panels or data points | Reduce panel count, limit time range |
| Authentication errors | Wrong MQTT credentials | Verify username/password in data source |
| Connection refused | Broker not running or wrong port | Check broker is running, verify port number |
-
Check MQTT data source:
- Go to Configuration \u2192 Data Sources
- Click on your MQTT data source
- Click Test Connection
-
Verify MQTT topics:
- Use MQTT client (e.g., MQTT Explorer) to verify data is being published
- Check topic names match those in dashboard queries
-
Check Grafana logs:
- View browser console (F12) for JavaScript errors
- Check Grafana server logs for backend errors
-
Test with simple query:
- Create a test panel with a simple topic
- Verify data appears before adding complex queries
Set up alerts for abnormal conditions:
-
High pool temperature:
- Trigger when pool temp > 35\u00b0C
- Notification: "Pool temperature is too high!"
-
Pump runtime too long:
- Trigger when daily runtime > 12h
- Notification: "Pool pump has been running too long!"
-
Low temperature difference:
- Trigger when solar - pool < 5\u00b0C
- Notification: "Solar heating may not be effective"
Add annotations for important events:
- Manual mode changes \u2014 Annotate when mode changes to Manual
- Boost mode activation \u2014 Annotate when Boost mode is activated
- Maintenance events \u2014 Annotate pool cleaning, chemical additions
Create links between dashboards:
- Overview \u2192 History \u2014 Link to detailed history dashboard
- Overview \u2192 Efficiency \u2014 Link to efficiency analysis
- History \u2192 Specific Day \u2014 Link to day-specific dashboard
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (e.g.,
feat/add-energy-panel) - Make your changes in Grafana
- Export the dashboard JSON
- Update the JSON file in this repository
- Test your changes thoroughly
- Update documentation if applicable
- Submit a pull request
Before submitting:
- \u2705 Validate JSON:
python -m json.tool dashboard-smart-swimming-pool.json > /dev/null - \u2705 Or use jq:
jq empty dashboard-smart-swimming-pool.json - \u2705 Test import in Grafana
- \u2705 Verify all panels show data
- \u2705 Check for typos and formatting issues
MIT License \u2013 Free to use, modify, and share.
- Discussions: GitHub Discussions
- Website: smart-swimmingpool.com
- Grafana Community: community.grafana.com
Need Help?
- Check this README for common issues
- Search GitHub Discussions
- Open a new issue
| Project | Description |
|---|---|
| Pool Controller | Main control unit with MQTT integration |
| Pool Monitor | Solar-powered wireless temperature display |
| openHAB Config | openHAB configuration files |
| Water Quality Monitor | Water quality monitoring (pH, chlorine) |
| Website | Project documentation website |
- Grafana Documentation \u2014 Official Grafana docs
- Grafana Tutorials \u2014 Learning resources
- Grafana MQTT Plugin \u2014 Plugin source code
- MQTT Protocol \u2014 MQTT specification
- MQTT Explorer \u2014 MQTT client for testing
- Mosquitto \u2014 Popular MQTT broker
- Home Assistant \u2014 Open source home automation
- Home Assistant MQTT Discovery \u2014 Auto-discovery documentation
Made with \u2764\ufe0f by the Smart Swimming Pool community