Showing posts with label raspberry. Show all posts
Showing posts with label raspberry. Show all posts

Wednesday, September 28, 2022

SYSTEM: Home Assistant Installation | Raspberry Pi

 

HOME ASSISTANT INSTALLATION ON RASPBERRY PI


Another alternative to QNAP is installation on Raspberry. The latest release of this board provides enough RAM and CPU power to run HA smoothly. I got RPi4 with 4GB of memory so it should be enough. In addition I have added 128GB SD card so my storage will be also enough.

Raspberry Pi 4 model B with heat sink

SD Card i use (128GB)

Raspberry Pi 4 with LCD touch display attached. This will be future setup with touch interface.






PREREQUISITIES

  1. Raspberry Pi with proper power supply. For my system I use the one providing 5V with 3A (15W in total);
  2. SD card big enough to hold HA and its system. 32 is the minimum, I use 128GB
  3. Balena software installed from this link (it will write our SD card with Hassio image)

INSTALLATION

Installation procedure is copied from https://www.home-assistant.io/installation/raspberrypi#write-the-image-to-your-boot-media:

WRITE THE IMAGE TO YOUR BOOT MEDIA

  1. Attach the Home Assistant boot media (SD card) to your computer
  2. Download and start Balena Etcher. (You may need to run it with administrator privileges on Windows).
  3. Select “Flash from URL” 

  4. Get the URL for your Raspberry Pi:

Raspberry Pi 4 64-bit: https://github.com/home-assistant/operating-system/releases/download/9.0/haos_rpi4-64-9.0.img.xz

  1. Paste the URL for your Raspberry Pi into Balena Etcher and click “OK” 

  2. Balena Etcher will now download the image, when that is done click “Select target” 

  3. Select the SD card you want to use for your Raspberry Pi 

  4. Click on “Flash!” to start writing the image 

  5. When Balena Etcher is finished writing the image you will get this confirmation 

START UP YOUR RASPBERRY PI

  1. Insert the boot media (SD card) you just created.
  2. Attach an Ethernet cable for network.
  3. Attach the power cable.
  4. In the browser of your Desktop system, within a few minutes you will be able to reach your new Home Assistant on homeassistant.local:8123.
  • If you are running an older Windows version or have a stricter network configuration, you might need to access Home Assistant at homeassistant:8123 or http://X.X.X.X:8123 (replace X.X.X.X with your Raspberry Pi’s IP address).

With the Home Assistant Operating System installed and accessible you can continue with onboarding.



Monday, September 12, 2022

Hardware: Home Assistant host

Let's start - it's time to prepare the system.

Since I will be using smart systems from different suppliers at home, I need an aggregator that will enable communication between different environments. Currently, there are several such systems on the market: Open Hab, Home Assistant, Domoticz (these are just examples). 

I chose the Home Assistant for my Smart Home system - mainly because I already know and used it. In addition, I like the philosophy of Home Assistant and the way and amount of integration with various smart systems. It can work on various hosts - starting from MS Windows, through Docker and ending with VM and Raspberry. For me, it will run on Qnap NAS as a virtual machine.

The basis to run Home Assistant is the equipment on which it will run.

HARDWARE: SERVER

Requirements: good CPU (at least 4 CPUs), a lot of RAM. Necessarily USB ports (but they don't have to be 3.0+). It's good if it has several network cards - thanks to this, you can separate the smart-home traffic from the rest.

The server on which the Home Assistant will work is the heavily tuned QNAP TVS-872XT.

Technical data:

  • CPU: i5 8400T
  • RAM: 64 GB
  • GPU: Quadro K2200
  • Network: 
    • 2x1GbE connected as 2GbE in alb (active load balancing) - I use this card for VPN support
    • 1x5GbE (this is 10GbE connected to the 5Gb port on the switch) - used to transfer data to / from virtual machines
    • 1x10GbE - the main data network.
In this equipment, I replaced the RAM with 2x32GB (I found it on Amazon for ~ 900PLN). When I bought 8 discs, they cost me PLN 230 each. SSD drives (I have a Samsung EVO 980) cost about PLN 200 per piece also on Amazon. I bought the Nvidia card from Allegro for ~ 450 PLN.

Software:
  • OS: QTS Hero v5 with ZFS support
  • Native support for Virtualization Station

Disks:
  1. 8x2TB Seagate Iron Wolf configured in RAID6 - these are disks for storage. Here I keep movies, photos, other household stuff. Virtual machines land here as well.
  2. 2xNVME SSD 500GB - this is a RAID0 array, QTS Hero system and applications are installed on it
  3. 2xSATA SSD 500GB - these are drives for buffering data from the main matrix. Qnap has a pretty cool mechanism for storing your most-used data on fast SSDs.
Pros : quite powerful machine, allows you to run multiple virtual machines. It has two PCIe slots for additional expansion - in my case they are occupied by the NVIDIA K2200 card (used for AI support) and a 10GB + 2xSSD card. Additionally, you can throw 8 SATA disks and 2 NVME disks.

Cons : price. Basic set with i5 + 16GB of frame, without disks, costs about 10,000 PLN. Added to this is the cost of disks, network cards (but not necessary) of memory expansion. The equipment is quite large and heavy and will not fit everywhere. I currently have it (but it barely fits) in a 19 "rack.




Alternatives : 
  • Cheaper NAS models enabling virtual machines to work. It is important that they have at least 8GB of RAM and a decent processor. For the Home Assistant I allocate 6GB RAM and 6 processor cores. I used to have a QNAP (TS-435) with a Celeron and 8GB of RAM on it and it was fairly decent, but I noticed that the system is quite slow. With this configuration, we will not run anything else on the hardware.
  • RaspberryPI - The only reasonable option here is the RPi4 with 8 GB of RAM. This can be a good starter hardware, but requires you to buy an external drive (using an SD card is not a good idea for a Home Assistant);
  • The rest - for example, a VM for Windows is not a good idea because it requires a laptop / PC to be turned on all the time

I will post a description of the NAS configuration by the way - here I have a 10GbE network and a split AP (Asus ZenWifi 6E) and a Mikrotik router,

LINKS AND EXTERNAL RESOURCES

Alternative Resources
I do not throw in links to the promotion (although I recommend it - you can save a lot) because it is constantly changing.

Integracja: Rekuperator Wanas | ModBUS | Zigbee

Ekosystem: Modbus, Zigbee, Wanas, Netatmo, Z-wave Nazwa integracji Home Assistant: Modbus, Zigbee2MQTT Poziom skomplikowania: 3/5 | wymaga ...