The premise
- Know what it is
Happy planetHome-assistant (HA for short) - One old Android
- Use Docker to install HA and stay away from Python and PIP. All kinds of dependency reporting errors will torture you to the paralysis of Ge You
- Please read the comments with yellow exclamation marks carefully
Background knowledge
As you know/don’t know, there are a few rules of thumb to skip the hotheads.
- Mobile phone installed HA, need to simulate the Linux system
-
IOS does not support HA installation. Shop search iSH Shell emulates Alpine Linux. But believe me, it doesn’t. Because it’s a simple Linux, it doesn’t support Docker for a variety of reasons; Installing HA through Python always relies on reporting errors (red letters like bcrypto). A silo is not good for planning. I had a problem installing HA on my iPhone. It wasn’t just a problem.
-
Android emulates Linux with Termux or Alpine Term, which is not recommended for Alpine Term. It doesn’t matter if Roort is installed or not. Termux emulates Linux, but you will encounter the same dependency error as iOS. Installation of Docker is also always encountered problems, of course, I have seen others using Termux successfully installed on the Internet, and then a bunch of error questions in the comment section did not solve, just consider me a douchebag.
-
Once again, it is recommended to use Docker when HA is installed on mobile phones. With Python you need to install it, so here’s a pit to hit.
To prepare
-
Download the app: Alpine Term
- Baidu web disk downloadExtract the code:
7vba
Thanks for the baidu disk resources shared by this big man on CSDN. This article is very helpful to me. If you are interested in learning more details about the use of AlpineTerm, please check it out.
- Baidu web disk downloadExtract the code:
Ali cloud disk can not support sharing apK file format, compressed into ZIP format can not share, otherwise you can download faster. Probably because of the legal risk, to avoid becoming a platform for downloading illegal apps?
⚠️ Do not delete the APK installation package after the installation is complete. If problems occur later, reinstall the apK installation packageCopy the code
The installation
To install and run Alpine Term, every time you start the app, you have to wait for loading, which lasts from a few minutes to more than ten minutes. If you want to be online for a long time, it is recommended to enable the background running permission of the app. Take my Redmi Note4X for example. Phone Settings – Battery & Performance – Application Configuration – Select Alpine Term- Set background to ‘Unlimited’; At the same time, set Wi-Fi to always be connected when it is in hibernation state. Other brands and models please explore by yourself.
Thanks to the built-in docker integration in Alpine Term, we can install HA directly using Docker without switching sources.
-
First switch to root: run sudo -i and enter alpine, the default password, to save repeating sudo XXX later
-
Run service docker start to start the docker
-
Execute docker pull homeassistant/ home-Assistant to pull the ship’s new version of HA locally.
⚠️1. This process takes a long time and personal network differences suggest 2-3 hours of psychological preparation; ⚠️2. If the timeout error occurs, click the upward arrow button on the top of the keyboard, and run the pull command again, ⚠️3. Error "No space left on device", if you have any other operations, you are advised to delete the app, delete the app data, and reinstall ⚠️4. ⚠️5. After successfully downloading, a long list of sha256:xxxxxxxxxx and Status will be displayed: Downloaded newer Image for homeassistant/home-assistant: XXXXXXXXX ⚠️6. Turn off the VPN! Turn off the VPN! Turn off the VPN!Copy the code
-
Run the mkdir hass command to create an installation directory.
The generated path is /root/hass, because you are already in the root directory after Step 1. Run the ls command to view the created hass folder ⚠️. The directory /root/hass will be used in Step 5Copy the code
-
Docker run -d –name=”hass” -v /root/hass:/config -p 8123:8123 -e TZ=”Asia/Shanghai” homeassistant /home/assistant
⚠️ --name="hass" the purpose of HA is to add a name, docker will be used to start HA. --name="hass" --name="hass" --name="hass" --name="hass" --name="hass" --name="hass" --name="hass" ⚠️ If you encounter a container name conflict, there may be a container with the same name, it is recommended that docker PS check whether it has been installed. If not installed, repeat Step 5. If not, delete the app and start againCopy the code
-
Run docker start hass to start HA. If hass is displayed, HA is successfully started 🍺
⚠️ Disable HA run "docker stop hass"Copy the code
-
Port mapping hostFWd_add TCP ::8123-:8123, which can be understood as breaking the nesting barrier between Alpine Linux and outer Linux, so that other devices in the LAN can access the inner HA
⚠️ Operations and commands: In Alpine Term, swipe from left to right on the screen to bring up a menu. Click QEMU and run hostfwd_add TCP ::8123-:8123Copy the code
-
There are two ways to access The Home Assistant:
- Current mobile browser access 127.0.0.1:8123
- Obtain the IP address of the current mobile phone. For example, if the IP address is 192.168.0.xx, access 192.168.0.xx:8123 from another mobile phone
restart
When the Alpine Term application restarts, the following steps need to be performed again:
- Log in to the Alpine user account with the default password
alpine
- perform
sudo -i
Enter the default passwordalpine
service docker start
Start the dockerdocker start hass
Start the HA- Port mapping
hostfwd_add tcp::8123-:8123
To operate in QEMU, refer to step 7 above
⚠️ You are not advised to add docker/HA containers to autostart. As a result, browsers may fail to access HA
Matters needing attention
- If you encounter a network timeout error, try several times. There is no need to change the source.
- If an HA startup error occurs, execute twice more
- If there are still strange problems after the previous two steps, it is recommended to change the time zone, and then restore the phone to factory Settings and start again to prevent dirty data, to prevent dirty data residue
- HA installed through this tutorial does not include SuperVisor, and HACS is perfectly capable of being replaced
- Android version/APP version/Docker version /HA version, this does not need to pay attention to, as long as you can run Alpine Term, can install HA, what pressure can be. If I had to, I’d run away.
- Changing the time zone (optional)
Run the export TZ=’Asia/Shanghai’, TZ=
command to query the time. You can also change the time in the format of date -s “28 Mar 2022 13:20:00”
I don’t maintain my blog very often, so I don’t respond to it in a timely manner. If there’s anything missing, can WE fill it in later
Related articles
Docker install HASS
www.jianshu.com/p/b70626ac4… Blog.csdn.net/maoxinwen1/…
Port mapping
Qa-docker pull 408 Disable VPN on the LAN
QA – docker failed to register layer no space left www.jianshu.com/p/ac591f49a…