I am trying to create a sensor that reports my free space on my frigate storage.
This command works from a command line:
➜ /bin/df -h | /bin/grep ‘/media/frigate’ | /usr/bin/awk ‘NR==1{print $3}’
114.3G
Here is how I define it in my commanline.yaml file (included from configuration.yaml)
- sensor:
name: zeus_frigate_free_space
command: "/bin/df -h | /bin/grep '/media/frigate' | /usr/bin/awk 'NR==1{print $3}'
"
unit_of_measurement: "GB"
The sensor state is always “Unknown”. Am I using the awk command wrong? The output seems to have an extra line before the data.