-
Notifications
You must be signed in to change notification settings - Fork 0
getting started
This guide walks you through installing and running system2mqtt for the first time.
- Python 3.6+ installed on your system
- A running MQTT broker (e.g. Mosquitto, EMQX, or the broker built into Home Assistant)
- Internet access to install Python dependencies (first run only)
| Feature | Requirement |
|---|---|
| Proxmox monitoring | A Proxmox VE node reachable on your network |
| Disk temperature (Argon ONE) |
smartmontools package installed (apt install smartmontools) |
| macOS CPU temperature |
istats gem (gem install iStats) |
git clone https://github.com/OptimusGREEN/system2mqtt.git
cd system2mqttCopy the example configuration file and edit it:
cp s2m.conf.example s2m.confAt minimum, set COMPUTER_NAME to a unique name for this machine. All other settings have sensible defaults.
COMPUTER_NAME=MyComputerTo connect to an MQTT broker that is not running locally, also set MQTT_HOST:
COMPUTER_NAME=MyComputer
MQTT_HOST=192.168.1.100See the full Configuration Reference for all available options.
Use the run.py watchdog script. It will:
- Automatically create a Python virtual environment in
./venv - Install all required dependencies from
deps.txt - Start
s2m.pyand restart it if it crashes
python3 run.pyTo pass a custom config file path:
python3 run.py /path/to/my/s2m.confTo force-reinstall Python dependencies (e.g. after an update):
python3 run.py --force-reinstallOnce running, you should see log output similar to:
[MyComputer]: [INFO] s2m:42 - 2024-01-01 12:00:00 - Starting System2Mqtt
[MyComputer]: [INFO] s2m:55 - 2024-01-01 12:00:00 - Connecting to MQTT broker at localhost:1883
[MyComputer]: [INFO] s2m:60 - 2024-01-01 12:00:01 - MQTT connected
[MyComputer]: [INFO] s2m:80 - 2024-01-01 12:00:01 - Publishing metrics...
You can verify MQTT messages are arriving using any MQTT client. For example, with mosquitto_sub:
# Subscribe to all system2mqtt topics for your computer
mosquitto_sub -h localhost -t "system2mqtt/MyComputer/#" -vExpected output:
system2mqtt/MyComputer/LWT online
system2mqtt/MyComputer/cpu/usage 12
system2mqtt/MyComputer/memory 45.3
system2mqtt/MyComputer/disks/storage/sda1 67.2
...
You can also run the main script directly, bypassing the watchdog. You must first install dependencies manually:
python3 -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
pip install -r deps.txt
python3 s2m.py # uses s2m.conf in current directory
python3 s2m.py /path/to/s2m.conf- Configuration Reference — explore all available options
- MQTT Topics — understand what gets published and where
- Home Assistant Integration — auto-discover entities in Home Assistant
- Running as a Service — run system2mqtt automatically on boot
- Docker Deployment — run in a container (especially useful for Proxmox)