|
|
1 년 전 | |
|---|---|---|
| .. | ||
| README.md | 1 년 전 | |
| main.go | 1 년 전 | |
A tool that retrieves GPU temperature information from Home Assistant MQTT and writes it to sysfs format files.
/tmp/temp_{DEVICEID} files (sysfs format)go build
./ha-gpu-ccd --mqtt-host <MQTT_BROKER> --mqtt-port <PORT> --mqtt-username <USERNAME> --mqtt-password <PASSWORD>
--mqtt-host: MQTT broker host (default: localhost)--mqtt-port: MQTT broker port (default: 1883)--mqtt-username: MQTT username (optional)--mqtt-password: MQTT password (optional)--temp-dir: Directory to write temperature files (default: /tmp)--device-id: Specific GPU device ID to monitor (leave empty to monitor all devices)# Connect to local MQTT broker, monitor all GPUs
./ha-gpu-ccd
# Connect to remote MQTT broker with authentication
./ha-gpu-ccd --mqtt-host 192.168.1.100 --mqtt-username homeassistant --mqtt-password mypassword
# Monitor only specific GPU device
./ha-gpu-ccd --device-id 00_04_00_0
# Custom temperature file directory
./ha-gpu-ccd --temp-dir /var/lib/gpu-temps
# Combined usage: specific device with authentication
./ha-gpu-ccd --mqtt-host 192.168.1.100 --mqtt-username user --mqtt-password pass --device-id 00_04_00_0
The tool creates a temperature file for each GPU device:
temp_{DEVICEID}/tmp/ directoryExample:
00_04_00_0/tmp/temp_00_04_00_080500The tool supports two subscription modes:
Subscribe topic: homeassistant/sensor/nvml-gpu/#
Filter condition: Only process messages containing _temperature/state
Subscribe topic: homeassistant/sensor/nvml-gpu/{DEVICEID}_temperature/state
Temperature topic format:
homeassistant/sensor/nvml-gpu/{DEVICEID}_temperature/state
Where {DEVICEID} is the device ID generated by the nvml-gpu-ha main program, e.g., 00_04_00_0
The tool outputs the following log messages:
This tool is designed for integration with other systems, such as:
By reading the /tmp/temp_{DEVICEID} files, other programs can obtain real-time GPU temperature information.