wiki/docs/proxmox/send-cpu-temp-to-ha.md
Sthope ba844e0626
All checks were successful
continuous-integration/drone/push Build is passing
first commit
2022-04-27 11:25:01 +02:00

32 lines
560 B
Markdown

Thanks for [nikito7](https://github.com/nikito7)
```
nano proxmox_sendTemp_2HA
```
```bash
#!/bin/bash
# ___ _ _ _ __
# / __|| |_ | |_ ___ | '_ \ ___
# \__ \| _|| \ / _ \| .__// -_)
# |___/ \__||_||_|\___/|_| \___|
host=MQTT_IP
user=MQTT_USERNAME
pass=MQTT_PASSWORD
proxmox_name=pve1
temp=$(cat /sys/class/thermal/thermal_zone2/temp')
mosquitto_pub -h $host -u $user -P $pass -t proxmox/$proxmox_name/cpu_temp -m $temp
```
```
chmod +x proxmox_sendTemp_2HA;
```
```bash
while proxmox_sendTemp_2HA; do sleep 10; done
```