{"id":24206544,"url":"https://github.com/andyg2/ohm-mqtt-poller","last_synced_at":"2026-06-09T10:31:29.730Z","repository":{"id":250391428,"uuid":"834341399","full_name":"andyg2/ohm-mqtt-poller","owner":"andyg2","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-15T07:00:00.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T14:13:20.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andyg2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-07-27T02:02:10.000Z","updated_at":"2024-08-15T07:00:03.000Z","dependencies_parsed_at":"2024-07-27T03:23:37.926Z","dependency_job_id":"36dd60af-ef2b-4e3d-9da9-6cc57d9d99f6","html_url":"https://github.com/andyg2/ohm-mqtt-poller","commit_stats":null,"previous_names":["andyg2/ohm-mqtt-poller"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/andyg2/ohm-mqtt-poller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fohm-mqtt-poller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fohm-mqtt-poller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fohm-mqtt-poller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fohm-mqtt-poller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andyg2","download_url":"https://codeload.github.com/andyg2/ohm-mqtt-poller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fohm-mqtt-poller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34103355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":"2025-01-14T00:34:15.562Z","updated_at":"2026-06-09T10:31:29.714Z","avatar_url":"https://github.com/andyg2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OHM MQTT Poller\n\n## Overview\n\nOHM MQTT Poller is a Python script that polls data from Open Hardware Monitor (OHM) [https://github.com/openhardwaremonitor/openhardwaremonitor.git](https://github.com/openhardwaremonitor/openhardwaremonitor.git) and sends essential hardware information (CPU, Memory, Storage, and GPU metrics) to a Mosquitto MQTT broker. This tool is designed to run as a background process on Windows systems, providing real-time hardware monitoring data that can be consumed by other applications or monitoring systems.\n\n## Features\n\n- Polls data from Open Hardware Monitor at regular intervals\n- Extracts essential hardware metrics:\n  - CPU temperature and utilization\n  - Memory utilization\n  - Storage devices' temperature and utilization\n  - GPU temperature and utilization\n- Sends data to an MQTT broker in a structured JSON format\n- Runs as a background process without a console window\n- Logs activities and errors to a file for easy troubleshooting\n\n## Requirements\n\n- Python 3.6 or higher\n- Open Hardware Monitor running on the local or remote Windows machine\n- Access to an MQTT broker\n\n## Installation\n\n1. Clone this repository or download the source code.\n2. Install the required Python packages:\n\n   ```\n   pip install requests paho-mqtt pyinstaller\n   ```\n3. Create a `config.json` file in the same directory as the script with the following structure:\n\n   ```json\n   {\n     \"serverID\": 123765123,\n     \"ohm\": {\n       \"server\": \"192.168.88.5\",\n       \"port\": 8085\n     },\n     \"mqtt\": {\n       \"server\": \"168.212.226.204\",\n       \"port\": 1883\n     }\n   }\n   ```\n\n   Replace the values with your specific configuration.\n4. Run the credential encoder script to create the `enc.bin` file:\n\n   ```\n   python encode_mqtt_credentials.py\n   ```\n\n   Follow the prompts to enter your MQTT username and password.\n5. (Optional) Create an executable:\n\n   ```\n   pyinstaller --onefile --noconsole ohm_mqtt_poller.py\n   ```\n\n   This will create a standalone executable in the `dist` directory. Move this executable to the same directroy as the config.json and enc.bin.\n\n## Configuration\n\n### Start the Open Hardware Monitor Web Server\n\n![](assets/20240815_145023_ohm-webserver.png)\n\n### config.json\n\n- `serverID`: A unique identifier for the server running this script\n- `polling_seconds`: The number of seconds between sending data\n- `ohm`:\n  - `server`: IP address or hostname of the machine running Open Hardware Monitor\n  - `port`: Port number of the Open Hardware Monitor web server (default is usually 8085)\n- `mqtt`:\n  - `server`: IP address or hostname of your MQTT broker\n  - `port`: Port number of your MQTT broker (default is usually 1883)\n\n### Credentials\n\nMQTT credentials are stored in a base64 encoded format in the `enc.bin` file. Use the `encode_mqtt_credentials.py` script to create or update this file.\n\n**Please note the enc.bin file is not at all secure, it is trivial to extract the credentials from this format**.\n\n## Usage\n\n### Running the Script\n\nYou can run the script directly with Python:\n\n```\npython ohm_mqtt_poller.py\n```\n\nOr, if you've created an executable (step 5 of installation), simply place the executable in the **same directory** as the `config.json` and `enc.bin` files and double-click the executable file or run it from the command line.\n\n### Running at Startup\n\nTo make the script start automatically when Windows boots:\n\n1. Create a shortcut to the executable (or to`pythonw.exe` with the script as an argument).\n2. Press`Win + R`, type`shell:startup`, and press Enter.\n3. Move the shortcut to the Startup folder that opens.\n\n### Logging\n\nThe script logs its activities and any errors to `logs/ohm_mqtt_poller.log`. Check this file for troubleshooting if you encounter any issues.\n\n## Data Format\n\nThe script sends data to the MQTT broker in the following JSON format:\n\n```json\n{\n  \"timestamp\": \"2024-07-27T09:20:00.946719\",\n  \"cpu\": {\n    \"temperature\": 86.5,\n    \"utilization\": 13.1\n  },\n  \"memory\": {\n    \"utilization\": 44.8\n  },\n  \"storage\": [\n    {\n      \"name\": \"Hitachi HUA723020ALA641\",\n      \"temperature\": 42.0,\n      \"utilization\": 82.6\n    },\n    {\n      \"name\": \"Ramsta  SSD S800 1TB\",\n      \"temperature\": 40.0,\n      \"utilization\": 65.0\n    }\n  ],\n  \"gpus\": [\n    {\n      \"temperature\": 47.0,\n      \"utilization\": 28.0\n    }\n  ]\n}\n```\n\n## Contributing\n\nContributions to this project are welcome! Please fork the repository and submit a pull request with your changes.\n\n## License\n\n[MIT License](LICENSE)\n\n## Acknowledgements\n\nThis project uses the following open-source libraries:\n\n- [requests](https://docs.python-requests.org/en/master/)\n- [paho-mqtt](https://pypi.org/project/paho-mqtt/)\n- [PyInstaller](https://www.pyinstaller.org/)\n\nSpecial thanks to the Open Hardware Monitor project for providing the hardware monitoring capabilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyg2%2Fohm-mqtt-poller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyg2%2Fohm-mqtt-poller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyg2%2Fohm-mqtt-poller/lists"}