Nest integration is filling up my storage device with camera images

There are no plans to provide more configuration options.

Ok, no problem, I’ll maintain my custom component as it is really easy to modify it to use the proper /media folder.

Thanks!

Ok, I’ve worked on the implementation.

I’ve modified the media_source.py like this:
media_source.py

    """Create the disk backed EventMediaStore."""
    
    media_path = hass.config.path(MEDIA_PATH)

    if DOMAIN in hass.config.media_dirs:
        media_path = hass.config.media_dirs[DOMAIN]

    _LOGGER.debug(media_path)

if I have in my media_dirs configuration (totally optional) an entry “nest” like this:
configuration.yaml

homeassistant:
  media_dirs:
    local: /media/local
    nest: /media/nest/event_media

then it will select the path entry “nest”. By default, it would use the hardcoded path.

If you’re interested I can do a PR.

2 Likes

Is there some way to setup an automation to regularly delete the Nest Media files? I am running on a Raspberry Pi with somewhat limited storage(120GB SSD) and just don’t want to fill it up with video files. It’s fine if there is not built-in setting to configure but if there was a service to call to delete media I’d be fine setting that up myself to run. Perhaps there is a script I can create and call?

this would be great!

You could also just periodically run a cronjob that deletes files older than x from that folder:

The target storage usage is 125MB so i hope you aren’t actually concerned about filling up the disk? even if its off it should still be well under 1gb

1 Like

@allenporter thanks I didn’t recall seeing that there was already a limit built in. That works for me.

If media_dirs is supposed to be a way that integrations should let users configure storage for their needs, then feel free to contribute this to the actual nest integration.

Just jumping in as i’m seeing a similar issue - one of the suggestions here is to just delete the files, but ‘just deleting’ the files doesn’t remove the object references from HA itself - so what is the solution to purge correctly?

You can delete the internal storage for the references in json if you are feeling lucky. There is not a feature for what you’re looking for. I guess just ignore it since you have it off anyway?

Can you expand on this please?

There is a json file in .storage that references the media files.

Yup, seen that, removed it as a test…it gets re-created with events referenced again after a HA restart.
Is it pulled the event data from Google perhaps?

ok, interesting -
Using the partner connections dashboard, disabling screenshots/clips, turning off HA, removing the “nest.event_media” file from .storage, starting HA again, the media folder within the HA WebGUI still shows the nest object, but with a ‘no items’ status, with the “nest.event_media” file NOT being re-created.
So it must have been pulling from Google?

I never had those snapshots in that nest folder, already have the nest integration active like for 2 years , on last backup I noticed an increase of the backup file… And there were a lot of snapshots now…

Did this behavior changed?

Anyway, as suggested I now disabled:

Based on the events you’ve selected to share from this device, allow nest_api to access camera snapshots

Let’s hope it stops making snaps now

I do not see any media in my Nest media director, even though I believe I set correct permissions.

Any idea why media dir might be empty?

Was this finally implemented?

I just switched to the Google Nest integration from the Nest integration with a recent notification that Nest Dev accounts were going to go away at the end of the year. So, from reading this thread, the integration should ultimately delete these files on its own once it reaches a limit?

Tried disabling the permissions but it didn’t remove old files…

Anyone looking for the files they are here (after logging in to HassOS via SSH)
cd /config/nest/event_media