Hello everyone,
I am running Home Assistant OS on a mini PC and am trying to set up a command_line
sensor to display the disk usage of a folder. While the command works perfectly in the terminal, the sensor is not created in Home Assistant. Instead, I get the following error:
“This entity is no longer being provided by the command_line integration. If the entity is no longer in use, delete it in settings.”
Here is the sensor definition in my configuration.yaml
:
command_line:
- sensor:
name: Video Folder Size
command: "du -sh /media/video_camera_1"
unit_of_measurement: MB
unique_id: video_folder_size
What I’ve Tested:
Manual test of the command in the terminal:
The command works perfectly in the Home Assistant terminal (SSH Add-on):
du -sh /media/video_camera_1
Output: 1.2M
Checked folder and permissions:
-
The folder /media/video_camera_1 exists.
-
Permissions have been set with chmod 777
ls -ld /media/video_camera_1
Output: drwxrwxrwx.
I fully restarted Home Assistant after making changes.
Questions:
- Are there known limitations when using the command_line integration in HAOS, particularly with commands like du?
- Do such commands require additional configurations to work within the HAOS container?
- Are there alternative ways to monitor the disk usage of a folder in Home Assistant?
Thank you for your support!