Set the smart home control center HASS Server on the old Android device

Set the smart home control center HASS Server on the old Android device

0 comment 150 views

I. Requirements:
1. Android phone has root running andoid 5.0 (according to theory, it is possible for iphone to do it but I should not stop it) 
2. Termux software, keyboard with ctrl (option but should install because it has 4 navigation keys handy for editing the command)

II. Proceed to install. 
1. Install dependencies:

Code:

pkg updates 
pkg upgrade 
pkg install python python-dev nano coreutils ndk-sysroot clang mosquitto nodejs nodejs-dev openssh openssl openssl-dev tsu libuxi libffi-dev 
# upgrade pip (option) 
pip install --upgrade pip 
pip install pycrypto sqlalchemy 
npm i -g node-gyp node-pre-gyp bcryptjs bcrypt 
# assigns root permissions to termux (this is depending on the phone but will usually be in phones running systemless using Magisk) 
exit 
tsudo (exit root permissions)

2. Install HASS, node-red, pm2

Code:

npm i -g --unsafe-perm node-red pm2
# Cài HASS :
pip install homeassistant

3. Launch to create the original config file

Code:

node-red 
# Wait for it to finish, press ctrl + c to interrupt 
mosquitto 
# Wait for it to finish running then press ctrl + c to stop 
hass 
# Wait for it to finish, press ctrl + c to interrupt 
[code]

4. Activate:

[code]

start pm2 mosquitto – -v -c /data/data/com.termux/files/usr/etc/mosquitto/mosquitto.conf pm2 start node-red –node-args = “- max-old- space-size = 128 “- -v pm2 start hass –interpreter = python – –config /data/data/com.termux/files/home/.homeassistant

5. Support commands

Code:

#dump and save config processes running 
pm2 save 
#Show list of processes running 
pm2 list 
# View process hass details running 
pm2 shows hass 
pm2 logs hass 
# Stop process or delete process without using curly braces. 
pm2 stop
pm2 delete 

So you have finished installing HASS server on your old android phone. The rest is config.

Access to HASS Server: 
If you use the phone itself, open the browser and type in http://127.0.0.1:8123 or use the HASS app to type the server address.

If you have already installed version 0.75.3, then reinstall the dependencies in section 1 and upgrade hass.

Code:

pip install --upgrade homeassistant

Related Posts

Leave a Reply

Tips and Tricks

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More