Je constate que le % d'utilisation du HDD externe branché à mon raspberry est faux dans Domoticz, il apparaît à 100% alors qu'il n'est pas plein du tout. Les autres valeurs sont à peu près bonnes.


Une idée ?
Merci.


Code : Tout sélectionner
#!/bin/bash
#path
path="/media/pi/Iomega"
#domoticz
domoticz="192.168.1.34:8080"
used_idx="146"
free_idx="147"
#% used
used=$(df -k $path | tail -1 | awk '{print substr($5, 1, length($5)-1)}')
curl --silent -s -i -H "Accept: application/json" "http://$domoticz/json.htm?type=command¶m=udevice&idx=$used_idx&nvalue=0&svalue=$used"
#free space
free=$(df -k $path | tail -1 | awk '{print $4}')
free=$(awk "BEGIN {printf \"%.1f\",${free}/1024/1024}")
free=$(echo "$free%20Go")
curl --silent -s -i -H "Accept: application/json" "http://$domoticz/json.htm?type=command¶m=udevice&idx=$free_idx&nvalue=0&svalue=$free"
Code : Tout sélectionner
*/10 * * * * /home/pi/domoticz/scripts/rasp_percentage.sh >> /dev/null
