A MagicMirror² module to connect to a MySQL database, run a select query (one value) and display the result.
Screenshots558532ad-9a8b-4bc0-9e89-3f431279051e-image.png
Downloadhttps://github.com/tabsl/MMM-MySQLData
Config example var config = { modules: [ { module: "MMM-MySQLData", position: "top_center", config: { id: Math.floor(Math.random() * 100), host: "YOUR_HOST", username: "YOUR_USERNAME", password: "YOUR_PASSWORD", database: "YOUR_DATABASE_NAME", port: 3306, values: [ { "id": "power_current", "interval": 60000, "title": "Current power consumption", "praefix": "", "suffix": " w", "query": "SELECT round(data) AS value FROM power_consumption WHERE type = 'current' ORDER BY date DESC LIMIT 1", "styles": { "ok": "< 100", "warn": "> 1000", "alert": ">= 10000" } }, { "id": "power_total", "interval": 720000, "title": "Total power consumption", "praefix": "", "suffix": " kW", "query": "SELECT round(data/1000) AS value FROM power_consumption WHERE type = 'total' ORDER BY date DESC LIMIT 1", } ] } } ] } Changeloghttps://raw.githubusercontent.com/tabsl/MMM-MySQLData/main/CHANGELOG.md