Home Assistant Core on Android Tablet

I didn’t configure anything really, I just launched the app with it (you need a full path):
daemonize /data/data/com.termux/files/home/hass/bin/hass

It seems to work so far, I haven’t really wondered more to be honest and I haven’t checked how it launched with the venv, I just did the usual source hass/bin/activate before. Though I assume that if something was not on the venv it would have taken much longer to launch.

I am no able to instal numpy 1.22.2 with python 3.9.7 aarch64 in termux

[Errno 2] No such file or directory: 'aarch64-linux-android-ar'


  error: Command "aarch64-linux-android-ar rcs build/temp.linux-aarch64-3.9/libnpymath.a build/temp.linux-aarch64-3.9/numpy/core/src/npymath/npy_math.o build/temp.linux-aarch64-3.9/build/src.linux-aarch64-3.9/numpy/core/src/npymath/ieee754.o build/temp.linux-aarch64-3.9/build/src.linux-aarch64-3.9/numpy/core/src/npymath/npy_math_complex.o build/temp.linux-aarch64-3.9/numpy/core/src/npymath/halffloat.o" failed with exit status 127
  INFO:
  ########### CLIB COMPILER OPTIMIZATION ###########
  INFO: Platform      :
    Architecture: aarch64
    Compiler    : clang

  CPU baseline  :
    Requested   : 'min'
    Enabled     : NEON NEON_FP16 NEON_VFPV4 ASIMD
    Flags       : none
    Extra checks: none

  CPU dispatch  :
    Requested   : 'max -xop -fma4'
    Enabled     : ASIMDHP ASIMDDP
    Generated   : none
  INFO: CCompilerOpt.cache_flush[817] : write cache to path -> /data/data/com.termux/files/usr/tmp/pip-install-aazs6vru/numpy_0ced138abad94b64af4403d88e3490be/build/temp.linux-aarch64-3.9/ccompiler_opt_cache_clib.py
  ----------------------------------------
  ERROR: Failed building wheel for numpy



Not sure if clang has the issue

WARN: CCompilerOpt.generate_dispatch_header[2289] : dispatch header dir build/src.linux-aarch64-3.9/numpy/distutils/include does not exist, creating it
  INFO: building 'npymath' library
  INFO: compiling C sources
  INFO: C compiler: aarch64-linux-android-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fstack-protector-strong -O3 -fstack-protector-strong -O3 -fPIC -ftrapping-math

Does anyone know the issue ? I am not able to get Hass last version up and running.

Does not work for me.

I can launch home assistant running :

1. source hass/bin/activate
2. daemonize /data/data/com.termux/files/home/hass/bin/hass

but same issue as

1. source hass/bin/activate
2. hass 

On both the process does not run as daemon. When i reboot home assistant from UI, home assistant stops but not restart

Seems that daemonize needs more arguments to work properly

Hi, has anyone been able to install the latest version with termux? what packages have you used (nexus 7) or what version of HASS and packages are correct? i am using LineageOs 18 (Android 11).

try
pkg install binutils
then install numpy again

1 Like

Instead of daemonize use utilites from termux-services.
Install termux-services package:

pkg install termux-services

Edit ~/.termux/boot/start
There is my version:

#!/data/data/com.termux/files/usr/bin/sh

termux-wake-lock

runsvdir $PREFIX/var/service

Create service folder:

mkdir $PREFIX/var/service/hass

Create run file and make it executable:

touch $PREFIX/var/service/hass/run
chmod 700 $PREFIX/var/service/hass/run

Edit newly created run file:

#!/data/data/com.termux/files/usr/bin/sh

source ~/hass/bin/activate
exec /data/data/com.termux/files/home/hass/bin/hass 2>&1

That way you can all your startup scripts convert to services.
For example:

~ $ ls $PREFIX/var/service/
hass  mosquitto  sshd   z2m

If you need, for some reason, stop one of services use:

sv down SERVICE

Disable/enable autorun service:

sv-disable SERVICE
sv-enable SERVICE
2 Likes

Tried what you mentioned but I’m getting “…the SSL module is not available”. Looks like the downgrade to python 3.9 messed up with SSL

I tried installing this for the first time and got this error

Encountered an error while trying to install package
-cffi

I tried installing cffi seperately,with no luck.
I have no experience in python,and would appreciate any help.

For the record, I’ve just updated to 2022.4.1 without issues on upgrade. That said, I got issues with PyNaCl when starting, not finding ld in the path for some reason:
checking for ld used by aarch64-linux-android-clang... no

Actually, after looking into it more, looks like it’s a known issue for clang: [Bug]: clang: ld: command not found · Issue #8191 · termux/termux-packages · GitHub

Installing binutils solves the issue for the time being:
pkg install binutils

1 Like

@Ritual I have not encountered errors related to this package.
Do you have more details about the error, a longer log message perhaps? Also, try to give more details on your configuration (tablet, system, etc)

I was trying to install it on oneplus x.
I wanted to try before i buy a raspberry and install on it.
But with no luck.
I tried it on lineage(Android 11) and rr remix Android 7
I got many different errors on both those roms.
I got the previous error which i posted from the playstore version,which got resolved once i downloaded the apk from github.
I got many errors after that and i tried resolving it for few hours and ultimately gave up.
Thank you tho.

@Gnoupi On which version of python your HASS is working

(hass) ~ $ python --version
Python 3.9.7

Can anyone reply with a sequence of codes which are confirmed working.
Because there are many different sequences in the comment section and the main sequence/versions don’t work for me.
It would really mean a lot.

And please state the os and Android version aswell.

Thank you.

The different sequences are very similar, but the most actual is Home Assistant Core on Android Tablet - #64 by deividAlfa.

Now you don’t necessarily need to install python manually the same way, but most of the dependencies are there. After, it’s a bit of a mess because installing this way is not trivial. You run in a lot of dependency issues, and with the added difficulty of the rare architecture. General packages are rarely built/tested to run on an android tablet. So you have to take it one error at a time, solve it, and solve the next one that arises.

If you are interested in continuing this way, try to post the actual errors you encounter.

Otherwise, if all you want is a quick test until you potentially get a dedicated device like a Raspberry, I would suggest a more straightforward setup, like a docker deployment or a VM. Might take more time to prepare, but at least it will install without issues.

Fair enough, thank you for your reply.
I will try it out within few days and try solving errors. If not, then I’ll try vm or docker.

I have moved from android to postmarketos due to this issues and now i run homeassistant on docker container.

if your device dont support postmarketos or you use it as a daily user phone, you can try this:

Install Docker on Termux (github.com)

I have the ssl problem, can you solve it?

You can get better answers by posting actual details.
Which error, which configuration, what did you do, what did you try to fix the issue, etc…

sorry, I’m having problems with python 3.10.4 so I’ve decided to install version 3.9 and when executing any pip command I get this error

'SSLError(“Can’t connect to HTTPS URL because the SSL module is not available.”

Can you help me? thank you