File size custom component

Sorry, the question was for you. But I read that you already succeeded :yum:

How frequently is this component supposed to update? Mine read the size of the file (correctly) when I first rebooted HA, but it hasn’t updated since…

You can set the scan_interval

What are the units of scan_interval? (minutes? hours?)

Its a time delta, with default unit seconds. Btw how large is the file?

1.5 GB - it’s my home-assistant database file.

I think I see what’s happening. I’m guess the “purge” doesn’t actually shrink the file and the next day’s data is still fitting within the freed up space…so the file size isn’t changing.

Check the bytes attribute

You could try to use the manual recorder.purge from the Services page (http://<host>:8123:/dev-service) and give { "keep_days" : "3", "repack" : "true" } as data and see what happens.

Curious if anyone has this working with a hassos based install?

I have been unable to get the sensor to even show up. With the following in configuration.yaml (actually, sensor: is broken out with a yaml file and an !include, but this is equivalent):

homeassistant:
  whitelist_external_dirs:
    - /config
sensor:
  - platform: filesize
    file_paths:
      - /config/home-assistant_v2.db

I get file permission errors. Same thing happens if I remove the whitelist section.

Hello,

Mine is working. I have hassos in a RPI3.

I used

homeassistant:
  allowlist_external_dirs:
    - /config