Home Assistant Core on Android Tablet

@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

i have the same problem could you solve it

Google seems to point at updating your packages in termux (assuming thatā€™s what you use):

Try a little pkg upgrade?

yes but command ā€œpkg updateā€ update python 3.9 to python 3.10 and the problems return

yes but it doesnā€™t work, Iā€™m trying to install home ass on android with termux and it seems that the python version is the problem, I have searched and tried many solutions on google but they donā€™t work, sorry Iā€™m a newbie, thanks .

Try to prevent to upgrade python or problematic packages with apt-mark hold <package-name>

After a tablet reboot I started having the SSL problem as well, so I just went on to follow my own advice and upgraded everything, which resulted in having python 3.10 (and apparently losing majority of my preinstalled packages).

(hass) ~ $ python --version
Python 3.10.4

Iā€™ve encountered several errors and managed to work through them. Some known already:

  • lack of timezone info (pip install tzdata)
  • inability to build cryptography (installing the rust and cargo dependencies and setting the CARGO_BUILD_TARGET variable fixed that)

In new stuff, I got issues with numpy, which apparently currently does not recognize the proper math library on Termux. Itā€™s identified already, and there is a workaround: [Bug]: Unable to install python module numpy in termux Ā· Issue #10808 Ā· termux/termux-packages Ā· GitHub

MATHLIB=m pip install numpy

So after that, I have Home Assistant 2022.5.5 running, seems to be ok so far. So it looks like we can make it work on 3.10, at least with the services Iā€™m using.

2 Likes

Is root compulsory to run this on android device or can it be installed on more recent and up to date android devices.

For example, you can easily sideload F-Droid to an NVIDIA Shield TV Pro, install termux and go from there using a keyboard remote or the shield TV remote app on your phone, resolving errors as listed throughout the thread. I did get it to the point of manually starting hass and then went on a long holiday before finishing off the project. Needless to say I forgot where I got to and will probably have to start again, but does starting the daemon on reboot require root ?

Simple Termux here, no particular elevated access.
I use termux-boot to launch the script on startup (pretty much same as in the first post under ā€œStartup at Rebootā€).

Thanks, worth pursuing then

I followed the guide to have it working on my Samsung S9.
For each new service, i currently have to observe the hass output to see which python packages it is trying to install and then install them manually because hass is failing to install them as it is trying to put them in the wrong location on disk. This is an example error when trying to add Google Nest:
2022-07-07 01:17:02 ERROR (SyncWorker_3) [homeassistant.util.package] Unable to install package python-nest==4.2.0: ERROR: Could not install packages due to an OSError: [Errno 30] Read-only file system: ā€˜/lib/python3.10ā€™
Anyone know how to solve?

ok so solved this issue by using a virtualenv for installing homeassistant into. If I install it in the base env, I get the above errors.

1 Like