Automation trigger on HDD volume

Hello,
I have some automation to store snapshots and it happens I foreget to clean up and have issues with the system due to out of disk space.
I clean the snap archive with a automation manually runned from automation menu but I was thinking a automation to run cleanup if HDD utilization is 90%, but how do I create a trigger for this?

I think that every 24h I run the automation to check HDD space and if above 90% run cleanup script.
Any easy way to do this?

To monitor a volume, you can use System Monitor.
Then you can trigger your automation on the value (numeric state trigger), or at a time (time pattern trigger) and check the value in a condition.

1 Like

Thanks,
I created

sensor:
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
        arg: /config

but how do I find the value of disk_use_percent, I cant see it in developer tools…

Have you restarted HA after adding it to your config file?

Yes I did,
I expect that I should find disk_use_percent in my developer_tools, right?

edit:
Checked the yaml file and I had a misstake that was not detected by the system, now it’s OK!
Thanks all!