Any AWK experts here? I’m trying to simplify my setup and if I can get this one sensor to work I can get rid of glances. I just want to monitor the usage of a btrfs array.
On my linux host:
$ df -h /mnt/btrfs_raid
Filesystem Size Used Avail Use% Mounted on
/dev/sdf 39T 27T 13T 69% /mnt/btrfs_raid
2024-01-02 16:10:54.973 ERROR (SyncWorker_0) [homeassistant.util.yaml.loader] while scanning a double-quoted scalar
in "configuration.yaml", line 203, column 51. Activating recovery mode
in "/config/configuration.yaml", line 203, column 23
found unknown escape character 'd'
in "/config/configuration.yaml", line 203, column 51
2024-01-02 16:10:54.974 ERROR (MainThread) [homeassistant.bootstrap] Failed to parse configuration.yaml: while scanning a double-quoted scalar
in "configuration.yaml", line 203, column 23
ValueError: Sensor sensor.btrfs_used has device class 'None', state class 'None' unit '%' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: '' (<class 'str'>)
This suggests to me a bug in home assistant?
If I adjust come of the spacing in the command around the pipes I get a different result:
OK so I think I’ve found the issue. Commands are executed within the context of the deployment, for me a docker container, whereas the mount point I’m trying to retrieve data for is on the underlying host hence the mount point can’t be found.
Not sure if there’s a way around this, maybe make the command into a script that’s somehow accessible?