Created
June 24, 2021 09:39
-
-
Save standaniels/f4f33c83939ad1f5357cb4a472b47653 to your computer and use it in GitHub Desktop.
Add disk usage sensor to Home Assistant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- platform: command_line | |
name: Disk Usage | |
command: >- | |
df -h / | sed 1d | awk '{ print "\{\"size\": \"" $2 "\", \"used\": \"" $3 "\", \"used\%\": " $5+0 "\}" }' | |
unit_of_measurement: "%" | |
json_attributes: | |
- "size" | |
- "used" | |
- "used%" | |
value_template: "{{ state_attr('sensor.disk_usage', 'used%') }}" | |
scan_interval: 300 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment