@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!