I am trying to create a command line sensor that will give me the count of backup files in my networked backup directory. Similar to what the google drive backup does.
Using the new network storage integration I have successfully mounted a NAS drive such that all backups are saved to that drive. It works fine and backups are saved on the NAS.
I assumed that this network drive was “mounted” on my home assistant and I could “simply” do a command_line sensor to get the number of files
System->Storage->Network Storage points to hassOffBackups\hassBackups
My command line (as a package file)
command_line:
- sensor:
name: Count backup tar files
command: "ls -l hassOffBackups/hassBackups/*.tar | wc -l"
But this doesn’t work. I only get zero count.
Any ideas. Thanks