I want to use HA[1]. And an ad blocker, like Pi-hole (I recently also heard of AdGuard)
The hardware currently available is a NAS (Synology DS224+) with 2 GB RAM. VMs are supported. Officially supported is a RAM upgrade by 4 GB to a total of 6 GB. Some other users successfully installed additional (unofficial) 16 GB RAM—did not work for all users.
Alternatively, I could buy a new NAS (and sell my current one) or buy a Raspberry Pi 4/5 with 2/4/8 GB RAM or buy anything else.
So I have following ideas. Do you have any thoughts or recommendations on them?
I host 2 VMs (HA and Pi-hole) on my NAS. Probably not enough RAM. Cost: 0 €
I buy 4 GB official RAM for my NAS (total for 6 GB). Then (1). Cost: 180 or 220 €
I buy 16 GB third-party RAM (officially not supported RAM-size) for my NAS (total for 18 GB). Then (1), provided everything works. Cost about 150 €
I buy a Raspberry Pi 5 (8 GB, Kit) and a SanDisk Extreme Pro microSD with 32/64/128 GB for HA. Cost: 240/245/253 €
Just for completeness: I buy a Raspberry Pi 4 B (8 GB, Kit) and a SanDisk microSD 16 GB for HA. Cost 205 €
I buy a new NAS (DS925+; 400 € at best), sell my current one (-250 €), buy official 16 GB RAM (800 €), sell the preinstalled RAM (-0 €). Then (1). Cost: 950 €
Actually this would be my second HA. But it is completely separated from the first one. ↩︎
You don’t need to run Pi-Hole as a virtual machine, that’s overkill. Run it as a container, less overhead and easier to maintain. You are a bit short on RAM to run HAOS.
If you are going for a Raspberry I also would invest in some other storage than SD-cards.
Edit: My preferred option is not listed - a Mini-PC with decent RAM and a SSD, running proxmox. On Proxmox you install HAOS as a virtual machine and Pi-hole as a container.
I don’t, there’s several threads about this on the forum probably. I run the Proxmox setup my self though, works great. I have a very old Intel NUC as standby, no issues running HAOS and several other workloads from that.
@mkm - I totally agree with @fleskefjes about SD cards.
I use a RPi 4 with 4gb RAM and HAOS. Wrote some pysctipts to get all sort of electricity data from grid, PV and so on, polling every 15s. This and a few calculated template sensors are by far the biggest contributor to my database writes.
My initial (new) sd card died after 10 weeks from bad sectors. My recommendation: Go for a SSD with DRAM. I found a Samsung EVO 960 Pro in an old PC of mine - and it’s not about speed but reliability. The SSD controller uses internal DRAM to collect all those small i/o and then writes to the disc in bigger chunks. Plus SSD controllers have great algorithms regarding wear levelling. More expensive SD cards have some basic wear levelling, though.
As a small backup…
As you can see from that picture, for me there are 530k state changes per day. And I already excluded all raw sensors (from pyscript) and others from the recorder.
Generally I am happy with my RPi setup. With all my scripts, integrations like AdGuard Home, ocpp, Shelly and more: 1.3GB RAM used, 5-10% CPU. Very stable…
One more thing to add - regardless of what storage you end up with, make 100% certain that you do backups to another media. Since you already have a NAS, you could utilize that.
For what its worth on all given options already. I’ve run HA on Synolgy 920+ for years and in the end with extensive integrations and all , it wasnt strong enough to be performant regardless of the 24gb memory i gave it. So as long as you stay simple with just some devices/integrations, you can run like this without much investments. But you’ll run into performance issues when you get enthousiastic on HA features.
So yes, you can start on VM, just add at least the 4gb, but more if you can. Pihole/adguard: run it in container, lightweight and stable (but be aware if you reboot your NAS, your network is without DNS and you NAS better not use the pihole as DNS server)
Yes. KEEP IT SIMPLE!
You can buy a used Intel NUC i3 or i5 for less than most NAS boxes and all new Raspberry Pi 5’s. And the NUC will outperform the Raspberry in every metric. You can put 16gB of RAM in any NUC and a tB of hard-disk if you want to. Capacity that would be difficult to fill.
Sticking with the KISS principle, install Home Assistant bare metal. No complications and learning curve from using Proxmox, VM’s or other unnecessary tools. It’s easy to migrate Home Assistant to a more complex installation later.
Thank you very much for this information! I really wonder what you did with HA that a 24 GB VM isn’t enough. Like was it because of the VM that 24 GB were not enough (I can not imagine that) or was it because of the integrations and stuff? I would think that HA bare metal on a 24 GB Mini PC would not solve your problem? How did you solve it / What is your setup?
What I am taking from it is that I will not invest 950 € for a better NAS or even 1.750 € for DS925+ and 32 GB RAM.
It wasnt the memory, it was cpu and io limitations. A reboot of the vm was way too slow. Moved now to a different cpu nas and container setup. A restart of ha is within 20 seconds and very happy with it.
Regarding DNS:
If you reboot your nas, your whole network is ’ without internet’ as no name resolution is possible. When your nas tries to boot and wants to lookup adresses, it also cant find and it might get confused. Better config the nas to use your normal gateway for DNS so boot is smooth.
I have an old pi 3b running adguard now, it never goes down unless there is a power outage.
Disagree on that. It strongly depends on the router you have got and the setting options it provides. I have got an AVM Fritzbox.
WAN settings are set by the Internet provider with their DNS server. Better not change that to your local dns server, otherwise it’s like you say…
Better: set up a local dns server only in LAN settings , which is my RPi IP. Without the RPi being online, my Fritzbox falls back to DNS = Gateway = 192.168.1.1 and hence uses the Internet provider DNS. No outage for me just a short inconvenience with all the Ad bloated web sites.
If the router handles all DNS to its IP and automatically determines which DNS to use, then it is seamless like you said. But if you want DHCP to hand out the direct ad blocker IP (to apply device specific rules or something similar) it becomes much harder to enforce with your setup.
I ended up just running OPNsense’s built in Unbound DNS with an extra rdr rule which redirects all devices using any public DNS resolvers to myself. This works great because if the router is running, DNS is as well.