Nest integration is filling up my storage device with camera images

Ever since integrating Nest into HA, my Nest cameras automatically add media event images into /config/nest/event_media and I cannot figure out how to disable this behavior. Since I’m running my HA instance on a Raspberry Pi for the time being, I don’t want to unnecessarily write a bunch of files to the SD card. I tried disabling Nest cameras in HA to no avail. Even with all my Nest/Google cameras disabled in HA, they still write images to my HA storage device. I remember having to enable devices and services from Google/Nest while setting up my integration, but for the life of me, I cannot find that option when I go back through the Nest integration steps. Maybe that was a one time setup from Nest?

I feel there must be a way to disable media sources through the Media Source integration, but the documentation isn’t really clear how to do that. Any help would be great.

1 Like

Media source doesn’t store video. It allows access to video that was previously stored.

Your storing it using another method I expect. Maybe an automation??

No Automation. It stores images from Nest cameras in its own ‘Nest’ directory in Media Sources. This happened automatically when I setup Nest integration. HA integrated this image service automatically with no obvious solution to disable. :confused:

Nest was added automatically during Nest integration setup:

Thousands of new images from all my Nest camera events despite disabling all Nest camera devices in HA:

1 Like

Recent? Or old? It sounded like you removed the integration.

You disabled the devices in HA but api access still exists and I believe you haven’t removed the integration so the clip storage is still enabled.

I believe you can disable the events in Google cloud console by removing permissions. The HA docs say

This feature is enabled by the following permissions:

* *Based on the events you’ve selected to share from this device, allow Home Assistant to access camera video clips*
* *Based on the events you’ve selected to share from this device, allow Home Assistant to access camera snapshots*
* *Other permissions in the Nest or Google Home apps*.

Recent clips. More images are stored with each new Nest camera event despite disabling the Nest camera devices in HA.

Update: I decided to remove Nest from HA and re-integrate it again. This brought up the camera permissions I remembered seeing the during my first Nest integration setup.

I have unchecked every camera option it would allow on this screen. After standing in front of the Nest doorbell camera, I have not seen any new image clips added to HA. I feel confident this solved my original problem. It’s still unfortunate to not have any obvious method of disabling those events without blowing away my original Nest setup. Hopefully an option can be added later.

Thanks for the help!

allow Next Home Assistant…snapshots

That is the permission causing the saved files.
Some integrations have a reload or configure option. if thats available for Nest that may allow access to these. Also I believe they are available through Nest somewhere

Hi, See the first link in the nest integration troubleshooting which takes you to the permissions. No need to delete the integration, but you do need to restart the integration.

3 Likes

Yes, this is exactly what I was looking for! Next time I should simply RTFM :upside_down_face:. Google Partner Connections more specifically, is where one can make these needed Nest changes. Thank you!

But why is this saved in /config/nest ? That path is part of Home Assistant Configuration and will be backed up. No way to exclude that, without excluding the configuration also.

1 Like

Hi @allenporter, I struggle a bit with the media filling up the storage space. I do want to have access to camera snapshots for use in automations, so turning off permissions does not work for my use case. Would it be possible to only store the last image snapshot, or turn off storage of different event types? I.e. only store doorbell press image, and not all images coming from all events such as Sound, Motion, etc. I also recognize that the integration stores an image from absolutely all events, including events which are not set up for giving notifications in the app and events outside the zones defined for notifications. This makes it fill up storage very quickly, and if it was a way to limit to storing images only from those events and zones that are defined to give a notification in the app that could also help a lot on this issue. Finally, storing the media in /config makes it also consume space in backups which is not ideal.

The defaults were chosen for a desire to limit the numerous possible configuration options, though ensuring you still had control to turn off the behavior if it’s not working for you. I am hearing you want more configuration options in between the all or nothing, but that isn’t planned at the moment. Happy to discuss ideas for improvements to default options.

I agree it would be nice to have device specific event type toggles as the extra option to offer, however device specific config options is not something supported by home assistant at the moment. I will add support if that becomes available in the future.

On storage under /config can you sym link it somewhere else? I haven’t tried this, but thought it was something I could offer.

Yes I have tried to symlink it. But the problem is, that supervisor’s backup is including the symlink, so that does not help at all.

Ok, thanks :+1:

I mentioned I am open to discussing other options for a directory that can be used by default, but haven’t heard any feasible yet.

In the bug you mentioned /media but my impression is that is not a path integrations can just use like this, right? Am I missing something obvious here? You said the decision makes no sense but i don’t see how its possible to just use this without additional user configuration. The alternative is to require more configuration options which was a non-goal: the choice to turn off instead.

I agree that these shouldn’t be backed up, though I think it requires new backup to let us exclude it by default, which I previously asked the supervisor folks about in another issue.

@scaarup there was recently introduced a backup platform to control backup, to allow ability to pause certain operations. I may see what it would take to exclude certain files from backup as a feature for the backup platform.

Just curious what automations you can perform from the Snapshot jpg?
I personally mounted the smb share and deleted the files directly. I am using a VM on my NAS so space isn’t so much of a concern but I don’t see a need for them.

Hello @allenporter

(and first of all, thanks for your work on this integration!)

I don’t really know what I’m doing (I mean it), but I’ve created a custom component for the Nest integration and I’ve modified the media_source.py file, changing MEDIA_PATH to this:

MEDIA_PATH = f"/media/{DOMAIN}/event_media"

I moved the files from config/nest to media/nest, restarted Home-Assistant and to my own surprise it worked :smiley:

According to the documentation, depending on the installation the default local media path should be set to a different value:

So I guess there should be a variable that is storing this default value, maybe hass.config.media.media_dirs[something] that I found in the media_source component, but localizing it is beyond my abilities (remember, mostly I don’t really know what I’m doing :sweat_smile: )

That would turn the path setting to something like this:

# Path under config directory
MEDIA_PATH = f"{DOMAIN}/event_media"

[...]

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

I would assume that relying on the default local media folder would make sense, no? Of course, maybe having the Nest folder appearing in the Local Media folder is not something entirely desirable and maybe that’s what you’re wanting to avoid?

Anyway, that’s as far I was able to go. Hope that can be of some help!

Cheers!

It would be great to propose a standard for home assistant media storage and if that exists would be happy to move nest to use it.

@allenporter, maybe we could think about something that would allow changing the path if we want.

My line of thought: in my configuration.yaml I could have this:

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

Then we could do something like this in media_source.py.

# Path under config director
if exists self.hass.config.media_dirs[{DOMAIN}] then
	MEDIA_PATH = f"{self.hass.config.media_dirs[{DOMAIN}]}/event_media"
else
	MEDIA_PATH = f"{DOMAIN}/event_media"

Really sorry, I don’t know how we should actually code such a test… but that’s the idea.

What do you think?

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!

1 Like