ironsheep / RPi-Reporter-MQTT2HA-Daemon

Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring)
GNU General Public License v3.0
442 stars 62 forks source link

used and free diskspace messed up #83

Closed wokkeltje13 closed 1 year ago

wokkeltje13 commented 1 year ago

I just updated to the latest build 1.8.0 and noticed in HA that free and used are switched in the graphs for diskspace image

ironsheep commented 1 year ago

hrmf... I'll have to check if this is a regression. v1.7.3 of the Daemon fixes the values which were wrong. Disk free was actually incorrectly returning the disk used value. Now both values are provided and both should be correct. Likewise, the lovelace rpi monitor card v1.3.4 corrected the card logic to use the now correct sensor name.

v1.8.0 did not make any changes to these values but I will double-check.

Please let me know if this is what you are seeing. You can check your system values with df -H.

ironsheep commented 1 year ago

@wokkeltje13 I checked the script, reporting looks to be correct.

On my test RPi I have 19% used and via MQTT the daemon is reporting "fs_used_prcnt": 19

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        29G  5.0G   22G  19% /

While on a 2nd test RPi I have 13% used and via MQTT the daemon is reporting "fs_used_prcnt": 13 This is all good.

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        59G  7.2G   49G  13% /

Augh! I found the problem. The advertisement is using the wrong variable this will be corrected in the next release.

ironsheep commented 1 year ago

Fixes committed and avail. in v1.8.1 and later.