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.



Wednesday, September 21, 2022

SYSTEM: Home Assistant First Run

 HOME ASSISTANT FIRST RUN

As we have HA already up and running it is time to configure it. To start this process we need to get IP address of HA instance. With Qnap we can do it in Virtualization Station



So the IP address for my HA is 192.168.18.139. We can proceed, typing http://192.168.18.139:8123 into web-browser.
Do not worry if you see this message:
It simply means HA is still starting. There is a lot of errands to run inside so it might take a while.


Once done, web gui will ask to create new user. I do recommend to create admin user, for example adm-ha. Try to avoid obvious names like Admin, Administrator.Do not worry about regular users, we will create them later. This specific user will be used only for administrative purposes and won't login on daily basis.

Set some strong password (12 chars, numbers and special chars included).
Next step - set your location, altitude (you can check it in google maps) and local formats:



On next screen you will be asked to share some diagnostic data. As HA is kinda trusted, I usually share some info with them. Check below:


On next screen you will see devices already discovered in your network. Here is example of mine:


At this point you can skip this step, we will dd those later. Now, our firs setup is done. We should see following web-interface:

Do not forget to check next posts - we will start adding integrations!


Tuesday, September 20, 2022

SYSTEM: Home Assistant installation | QNAP

HOME ASSISTANT INSTALLATION ON QNAP


As we have all components ready it is time to install and configure Home Assistant. I am goin gto setup it as virtual machine on my QNAP NAS, so in general, this should work on any VM system. I will describe it later on how to do it on different platforms (I am waiting for my Raspberry Pi4 hardware).

PREREQUISITIES

  1. QNAP NAS set up and Virtualization Station up and running;
  2. Home Assistant VMDK image downloaded from [images] and converted to img file (you can use converter embedded into Virtualization Station). 

STEP 1: creating of the VM

  1. Create folder to store your virtual hard drive and place converted image in it. I use separated resource on my QNAP (/VM) amd for this VM I have created ha folder. The VM share is mounted on my laptop as V: drive.

  2. Navigate to Virtualization Station and press "Create" button
  3. In new window choose settings as below. You need to adapt them depending on your hardware (mostly number of cores and RAM)



  4. Setup VNC password (bottom of the dialog window) and unselect "Restrict VM console access"
  5. VM is ready to create so press "OK".
  6. Once the machine is created, go to its setting and modify:

  7. Go to snapshots and delete (if any):

  8. G oto Storage and set disk size to 150GB and interface to VirtIO

  9. Connect USB devices


  10. Now, the system is ready to start. Press "ON" button to do so.



  11.  You can check IP address of your Home Assistant as shown below.



  12. We will need this IP to access web-interface of Home Assistant. Check my next post soon!

Monday, September 19, 2022

HARDWARE: USB to Serial

HARDWARE: USB TO SERIAL

Some of the hardware I use (and going to use at my Smart Home) require firmware modification. The usual way it OTA (Over-the-air) and can be done in pure software manner, hoever, some require flashing of the firmware.
Most of the equipment has on-board serial (RS-232) connector so I can easily connect to it and flash it's software. To do so I need serial-2-usb dongle as I do not have any serial interface on my laptop.

After short research I decided to go with simple usb2ser interface: USB TO TTL. This allows to use either 3.3V or 5V (be careful, setting this incorrectly can destroy the hardware you are trying to modify). The cost is super low - no more than few euros on Amazon or other portal.
To make my life easier I soldered wires to the pins so I can use them in much more flexible way later.

Another equipment is usb-extension cord and - obviously - soldering station.





LINKS AND EXTERNAL RESOURCES

Friday, September 16, 2022

TIPS AND TRICKS

Here you can fine some hints. How to avoid mistakes and be happy with your smart home system.

16.09.2022

Try not to mix different producers for specific functionality. If you buid lights - stick with specific provider. For example - Philips Hue or Yeelight. Or Innr. Do not mix those as usually they wont cooperate together in a way you'd expect. Plus - you can forget about smooth system, there will be alwys something broken or not working the way you expect. Even if protocols are the same. In my current setup I mix Philips Hue, Innr and Ikea using Zigbee proto. There is always something wrong between Philips Hue gateway and other producer's light. Using one brand will save you time (and unfortunately won't save your money).

Hardware: BLUETOOTH DONGLE

 

HARDWARE: BLUETOOTH HUB


Some of the devices at my home are bluetooth so I also need the bluetooth dongle. As there is no bug deal with it I decided to go with Baseus model mini-bt4, however in few days I replace it with same make, newer model 5.0 (BA-04). Older model (4.0) was working flawlesly so far. Price is really low - around 6€.

The device landed in the USB hub I wrote about in the previous post.

The configuration and integration will be described once we have the system up and running.


Baseus BA-04 


Thursday, September 15, 2022

Hardware: ZIGBEE DONGLE

HARDWARE: ZIGBEE HUB


Another protocol (or basically the standard) that I use in my Smart Home is zigbee. It is widely used, for example, in the Philips Hue ecosystem. I offer, like z-wave, a mesh network (i.e. each device is also a network extender) and quite a good range at 868MHz, 915MHZ and 2.4GHz.

The first idea with this protocol was to plug and integrate all zigbee devices into the Philips Hue gateway that I use. Unfortunately, it was not a good idea - not all devices could be added (e.g. gas sensor) and some, despite adding to the network and proper communication, were not visible (e.g. IKEA remotes). 

To solve this problem, I decided to separate the Hue system from the rest of the zigbee network. I left the lights and remotes and the Philips motion sensor on the Hue bridge (more on this in the post) and the rest: IKEA remotes, Heiman sensors and the rest I connected to a separate zigbee gate.

I found a lot of possibilities on the Internet, but I focused on compatibility with the Home Assistant. After a short research, I decided to use the Dresden Electronics Conbee2 hub.

The choice was based on compatibility with Home Assistant and previous experiences with Dresden Electronik equipment. Additionally - it can work locally and does not need a cloud to operate. The price is quite decent - now you can buy less than 50€.

The device landed in the USB hub I wrote about in the previous post.

The configuration and integration will be described once we have the system up and running.

LINKS AND EXTERNAL RESOURCES

Integracja: Rekuperator Wanas | ModBUS | Zigbee

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