HA (not a NAS install) doesn't allow NAS to hibernate

HA Supervised running in a Virtualbox VM on a Linux PC.

I have a Synology NAS and ever since installing Home Assistant, its disks don’t hibernate. I don’t have the Synology DSM integration configured.

I can stop HA and wait until the disks hibernate. They remain like that until I start HA again then they start spinning about 1-2 minutes later.

I can stop this behaviour by setting a firewall entry on the NAS to block connections from the HA VM IP address.

Is there any way to stop this from the HA end? Why should it be waking up my NAS, is it generally scanning and pinging the network to discover devices, and if so can it be stopped? I know in a lot of cases HA likes to discover things and set them up itself, but actually I have a very simple configuration and just don’t want it doing this sort of thing on its own.

1 Like

Are you using nmap or integration that communicates with NAS?

If so turn that off.
Likely HA is reading/writing to disk or communicating with something that need access hdd for requested data

No, I’m afraid not. I haven’t consciously got anything that would try to contact the NAS, I’ve got zwave, tplink, rest commands, notify, tts, media_player (platform vlc_telnet) - none of them reference the NAS. default_config is there, don’t know if anything in that might do something. NAS’s are capable of being DLNA players, perhaps HA could be scanning for renderers?? Don’t know, just clutching at straws! I’ve got three NAS’s actually, only one with spinning disks so that’s the only one I’ve noticed was not hibernating any more. But I’ve put the firewall rule on all 3 NAS’s and actually I’m convinced their fans are not coming on as often now and the cases aren’t as warm. I do suspect HA is continuously pinging them. Nothing else on the network would be doing this. This particular NAS is my backup server, things only access it overnight in the early hours to backup to.

If there’s nothing obvious then I’ll just leave it as it is, so thanks for the suggestions anyway. When I’ve got some time I’ll do some more exhaustive testing, at least taking the firewall rules off one by one and see if the symptoms come back, and see if I can replicate it all consistently. Could also try a packet-sniffing tool to see what’s happening.

1 Like

Ciao @osiangwynedd, have you maybe found a solution, two years later?
I’ve just upgraded my Synology NAS (DS1522+) to set it up in a 10GbE network, and… wow, it’s far more power hungry than my previous 1019+.
What I see is that, for me too, having my HA (RPi4 installed) integrated with the NAS, the HDDs are always on. I’ve even 2x 512GB SSDs as RW cache.
What I would only need, from the Synology-HA integration, is the possibility to switch it off when not used. But… if this integration keeps everything spindling… amen, I prefer saving some energy and lose any kind of integration with HA.
Are any discoveries on how to hibernate disks?
Many thanks in advance!

@Jlm70 still haven’t found out what’s causing it, although I did unearth a little bit more a couple of weeks ago. As mentioned in the my original comments, a firewall rule on the NAS to block all connections from the Home Assistant IP address works.

But I had to remove the rule on one NAS (the one with spinning disks that I originally noticed the problem with) when I installed the Samba Backup add-on, to automate full backups to a network share, that happened to be this particular NAS. Because if I blocked all the connections at the firewall, the add-on wouldn’t be able to see the NAS. And sure enough, as soon as I removed the firewall rule, the disks never went to sleep and they’re were always spinning.

I had to narrow it down if I wanted to use this add-on, tro try and find out what ports Home Assistant was pinging the NAS with. I think you can probably use a network utility to sniff network packets, but that’s probably a bit too technical for me…

With trial and error, I found that blocking all TCP ports apart from the SMB protocol didn’t work, and that the only thing that worked was to allow the TCP SMB port through (port 445 which is needed for this add-on) and then block all UDP ports.

You have to box-clever with the firewall rules on the NAS because they don’t necessarily allow you to set up exactly what you want to set up in the way that you think you want to declare them, and have to use a combination of allows, denies, and the order in which the rules appear. And different versions of DSM on different NASs (like mine) work in different ways.

On my (ancient) DS209, it was achieved by having the default policy to Allow (if no rules are matched), then a rule to allow TCP port 445 to the Home Assistant IP, then a rule following it to deny All to the Home Assistant IP. The order is important, the Allow goes through first of all then everything else gets denied. There was no way to specify deny UDP only. So I still don’t know what exact port is being used and I’ve blocked all UDP ports globally, so this may cause trouble in the future, but at the moment this is what works for me.

Generally, set up rules to allow all the TCP ports you need then add another rule to deny to all, i.e. everything that’s left.

Bear in mind I’ve got no Synology integration in Home Assistant and there is no reference anywhere in HA to any of the NASs. I think what HA is sending out is global network broadcasts of some description on UDP. I suspect a brand new installation would do the same before anything is set up, there is something inherent in HA’s networking that is doing it.

On my other two NAS’s which don’t have any business with HA, I’ve just got a global rule to deny all.

Hope this helps!

1 Like

Just noticing this now…as my drives are always ready to be accessed…so never going to sleep

Update…there is a setting now to slow down the number.of times HA looks at rhe drives…I have set it to 24 hours…defaults to 15minutes

@DUNKENKBLITHS Can you tell me where that setting is to set the time interval that HA looks at the drives?

1 Like

hope that makes sense…

Thank you, but that looks like it’s in a Synology DSM integration? I’ve got no Synology integrations set up, it’s something inherent in HA itself in my case that is scanning the network and waking up the drives.

I am having this very same issue.

I have Home Assistant running in a Docker container on a Linux machine, I also have a Synology NAS on my LAN.

Even though I have not setup any integration with Synology on Home Assistant, I can see in my integrations that it has picked up that there is a Synology NAS running on the local network.

My Synology NAS will not sleep while Home Assistant is running. I cannot block the IP of the Home Assistant machine on the Synology NAS because that machine also backs up the the NAS daily.

Home Assistant must be interacting the the NAS to know it is there and that is preventing it from hibernating entirely while Home Assistant is running.

I would really like to know how to prevent this behavior.