1、 The installation process of home assistant on raspberry 4 and some troubleshooting methods

Time:2020-10-24

Test platform

Raspberry PI 4 + platform is used in the test, and the official raspbian system is used.

Some pitfalls about the operating system

In the process of operating system selection, raspbian, Ubuntu, hassos and other operating systems have been tried

  1. Ubuntu 19.04, not very easy to use, must be connected outside the wired network, unlimited configuration, desktop system, etc. need to be installed separately, manually replace the source and so on.
  2. Hassos, after installation, you don’t know the user name at all. If you can’t log in, you won’t be able to install it for a long time without network. It’s basically unnecessary.
  3. Raspbian, raspberry system native, with desktop, command line is basically similar to the Ubuntu system. Originally, I thought that testing home assistant might be troublesome, but raspbian was the first to succeed.

Therefore, it is recommended to start with raspberry. Raspberry is definitely the most suitable operating system.

Some possible hardware problems

Raspberry pie is estimated to be stable when connected to the cable. No matter the 2.4G or 5g WiFi connection is used, the signal is not stable. Then, this problem may be magnified on raspberry pie. When downloading software and pip, there will be problems of connecting to the Internet and various errors.

The same cable, no problem. So it’s the most stable way to connect the cable.

How to install home assistant

Don’t listen to what the official website recommends. It’s easy to use raspbian. The specific methods are as follows. Of course, venv method is recommended, although I haven’t realized the advantages yet.

The method of official website is in this link
https://www.home-assistant.io/docs/installation/virtualenv/#step-4-set-up-the-virtualenv

In short, these are just a few

python3 -m venv homeassistant
cd homeassistant
source bin/activate
python3 -m pip install homeassistant

If it runs directly herehassIt will report an error. Generally, you can see such an error:

No module named 'hass_frontend'

Or what some other reports are wrong, the general Internet can not find specific methods. In fact, the solution is very simple, just install the home assistant frontend software package.

python3 -m pip install home-assistant-frontend
hass --open-ui

That’s fine.

Of course, this process requires patience. On the one hand, the Internet speed is slow. On the other hand, the start-up process of has is really slow, especially on raspberry. The only hole left is patience. Although there has been no activity for a long time, you may be able to install it later.

Except, of course, this has_ Frontend also has many other packages, which may not be installed due to network problems. At this time, you have to have patience to read his error log, one by one, the package hit by hand. And there’s a hole here. It’s possible that the version he wants to install is not the latest one. At this time, when pip is installed, you need to use = = to limit the version number.

python3 -m pip install lovelace==0.3.1

(the version number in the example is written in a blind way, which can be filled in according to the actual requirements.)

Postscript

Now some functional home ah, although boasting that they are very smart, but most of them hope to use some of their products to bind users’ consumption habits, so that users can use their own products more. However, if the products of each company can be very large and comprehensive, and solve the actual problems, it will be even. But most of the time, the more intelligent, the more mentally retarded. For example, the voice control originally said I wanted to turn on a flash, and the phone automatically turned on the flash. Then, since I installed the light control of smart home, the same sentence has become that I want to turn on the light in my home??? WTF?

Then, in a magical disconnection process, all the intellectualization in the home, as long as it is controlled by more than two devices, even if they are all under the same gateway, all of them will belch. Back to the era of hand control in an instant, there is no rescue. In other words, the home can not be disconnected in order to ensure intelligent.

On the other hand, I’m a little disgusted with the need for intelligent networking. How about all the intelligent devices in your home? I thought there was nothing to be monitored at home. But it’s not going to work at all when you’re disconnected. What does that mean.

Therefore, we decided to start to develop an alternative intelligent platform! Make your own Veda! (as high as 00). Among them also saw others many experiences, also wanted to buy a second-hand server what. Finally, we found that raspberry Pi is the most affordable. Power saving, cheap, everything.

Open source smart home platform, this article is about homeassistant. In fact, we have tried many other schemes and finally selected this one. First of all, I am a strong believer in Python. In addition, I tried several other platforms before. Either the home assistant interface is not easy to use, or the calling interface is more complex. Finally, the home assistant has been tried out for me, which is quite practical. We should do a series, write down the test process and some methods, or translate some materials. It may not be large and complete, but it should be more practical.