{"id":19103080,"url":"https://github.com/tabsl/mmm-mysqldata","last_synced_at":"2026-03-16T12:01:23.991Z","repository":{"id":215990116,"uuid":"740190163","full_name":"tabsl/MMM-MySQLData","owner":"tabsl","description":"MagicMirror² module to connect to a MySQL database","archived":false,"fork":false,"pushed_at":"2024-05-12T09:45:13.000Z","size":30,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T19:46:31.782Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tabsl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-07T19:27:36.000Z","updated_at":"2024-10-15T17:37:57.000Z","dependencies_parsed_at":"2025-01-03T02:32:57.535Z","dependency_job_id":"3277141b-186a-47c0-946a-e654c0919241","html_url":"https://github.com/tabsl/MMM-MySQLData","commit_stats":null,"previous_names":["tabsl/mmm-mysqldata"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tabsl/MMM-MySQLData","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabsl%2FMMM-MySQLData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabsl%2FMMM-MySQLData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabsl%2FMMM-MySQLData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabsl%2FMMM-MySQLData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tabsl","download_url":"https://codeload.github.com/tabsl/MMM-MySQLData/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabsl%2FMMM-MySQLData/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278557618,"owners_count":26006355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T03:59:32.302Z","updated_at":"2025-10-06T04:25:26.245Z","avatar_url":"https://github.com/tabsl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MMM-MySqlData\n\nA [MagicMirror²](https://magicmirror.builders) module to connect to a MySQL database, run a select query (one value) and display the result.\n\n![Screenshot](screenshot.jpg)\n\n## Installation\n\nRun these commands at the root of your MagicMirror² installation folder.\n\n```shell\ncd modules\ngit clone https://github.com/tabsl/MMM-MySQLData.git\ncd MMM-MySQLData\nnpm install\ncd ../..\n```\n\n## Update\n\nIf you already have a version of MMM-MySQLData, run the following to pick up the latest code ([Changelog](CHANGELOG.md)).\n\n```shell\ncd modules/MMM-MySQLData\ngit pull\nnpm install\n```\n\n## Using the module\n\nEdit your `config/config.js` file and add a new object to the `modules` array like any other module.\n\n```js\nvar config = {\n  modules: [\n    {\n      module: \"MMM-MySQLData\",\n      position: \"top_center\",\n      config: {\n        id: 1,\n        host: \"YOUR_HOST\",\n        username: \"YOUR_USERNAME\",\n        password: \"YOUR_PASSWORD\",\n        database: \"YOUR_DATABASE_NAME\",\n        port: 3306,\n        values: [\n          {\n            \"id\": \"power_current\",\n            \"interval\": 60000,\n            \"title\": \"Current power consumption\",\n            \"praefix\": \"\",\n            \"suffix\": \" w\",\n            \"query\": \"SELECT round(data) AS value FROM power_consumption WHERE type = 'current' ORDER BY date DESC LIMIT 1\",\n            \"styles\": {\n              \"ok\": \"\u003c 100\",\n              \"warn\": \"\u003e 1000\",\n              \"alert\": \"\u003e= 10000\"\n            }\n          },\n          {\n            \"id\": \"power_total\",\n            \"interval\": 720000,\n            \"title\": \"Total power consumption\",\n            \"praefix\": \"\",\n            \"suffix\": \" kW\",\n            \"query\": \"SELECT round(data/1000) AS value FROM power_consumption WHERE type = 'total' ORDER BY date DESC LIMIT 1\",\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\n## Configuration options\n\n| **Option**                  | **Type** | **Required** | **Description**                                                                                                                                                          |\n|-----------------------------|----------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id`                        | string   | yes          | Unique module instance id. Important if you use multiple module instances.                                                                                               |\n| `debug`                     | bool     | no           | Show debug information in log and console                                                                                                                                |\n| `wait`                      | number   | no           | Wait (milliseconds) before module is starting                                                                                                                            |\n| `host`                      | string   | yes          | Database host                                                                                                                                                            |\n| `username`                  | string   | yes          | Database username                                                                                                                                                        |\n| `password`                  | string   | yes          | Database password                                                                                                                                                        |\n| `database`                  | string   | yes          | Database name                                                                                                                                                            |\n| `port`                      | number   | no           | Database port (default: 3306)                                                                                                                                            |\n| `header`                    | string   | no           | Module header                                                                                                                                                            |\n| `values`                    | array    | yes          | Array for each database value to display                                                                                                                                 |\n| `values[n].id`              | string   | yes          | Id (div)                                                                                                                                                                 |\n| `values[n].interval`        | number   | yes          | Update interval (milliseconds)                                                                                                                                           |\n| `values[n].title`           | string   | no           | Value header                                                                                                                                                             |\n| `values[n].praefix`         | string   | no           | Value praefix                                                                                                                                                            |\n| `values[n].suffix`          | string   | no           | Value suffix                                                                                                                                                             |\n| `values[n].query`           | string   | yes          | MySQL query. **As a result, the column `value` must be returned!**                                                                                                       |\n| `values[n].styles`          | array    | no           | Array for css styles                                                                                                                                                     |\n| `values[n].styles[n].key`   | string   | no           | Css class name                                                                                                                                                           |\n| `values[n].styles[n].value` | string   | no           | Operator and compare value (numbers/strings), separated by a space. If true, css class will be added. Possible operators: `==`, `===`, `\u003e`, `\u003c`, `\u003e=`, `\u003c=`, `!=`, `!==` |\n\n## Styling\n\nSee (and edit) `MMM-MySQLData.css` or use `css/custom.css` to change module style settings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabsl%2Fmmm-mysqldata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftabsl%2Fmmm-mysqldata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabsl%2Fmmm-mysqldata/lists"}