Homeassistant core on Android (Guide Dec'22)

Addons are available on HA OS or Supervised. Neither can be directly installed on Android. Theoretically, having a flashed android kernel, you can install a virtual machine on which you can install HA OS.
But if you need advanced features, then it is better to run the server on a PC virtual machine or Raspberry Pie.

I need only to install an Editor, to edit configuration files. Do you know how can install an editor or how can I edit configuration.yaml? best regards

I don’t know of a way to enable the editor inside HA.
There are several other ways to access the configuration file.

  1. Run the nano ~/. homeassistant/configuration.yaml command in the termux. Then a simple text editor will open on the command line.
  2. Get access from a computer to a smartphone via ssh. Then you can download the file to your computer via sftp (for example, FileZilla), edit it and upload it back to your smartphone.
  3. Install code-server on your termux and edit the file through the page in the browser.

I use these three methods, depending on how big changes I need.

Hi Franken_Stein
Many thanks for your help. Best regards

Hey, tried this a few times, tried others, tried chroot into ubuntu and installing from there and I always get stuck while installing orjson it is just stuck.
Can you help me please? btw I really appreciate this detailed guide.

Try to just wait. The first installation may take a couple of hours.

Idk if it was just because i was installing it that many times but sometimes it gave me an error after a while.

got it working, but I have another question, where can i find the configuration.yaml in this type od installation?
Thanks.

Hello everyone I have toshiba at10-a with android 4.2.1 version. Can I install home asistant core ?

I described the path to the configuration file and how to edit it in this comment:

I’m afraid that this requires Android 7.
You can try installing LineageOS instead of a regular android. (if you install a newer version of android, I do not recommend setting the version higher than 9. Starting with Android 10, Google has tightened security and limited access to the /proc folder. Because of this, the server and some ignores may not work correctly)
Or install a virtual machine with Linux and install a server on it. (But running on a virtual machine will be much slower. I had a difference in server startup speed of 10 minutes instead of 10 seconds)

1 Like

Hi, me too have the same problem, do you find a solution?
Thanks in advance

1 Like

Hi, Right now I`m trying to install haas on my phone, but facing with exect problem. How did you fixed that?

I just waited, I put the installation command and went to help my dad with something I came back after like an hour and it was installed.

I added this automation:

alias: Restart server by socket errors
description: ""
trigger:
  - platform: event
    event_type: system_log_event
condition:
  - condition: template
    value_template: >-
      {{ "BaseSelectorEventLoop._accept_connection" in
      trigger.event.data.message[0] }}
action:
  - service: homeassistant.restart
    data: {}
mode: single

That is, as soon as the server detects such an error message in the log, it restarts.

But for automation to work, you need to enable system log events in the configuration file:

system_log:
  fire_event: true
2 Likes

Hi,

Thanks for steps, it is very nice, I am new to here
I try on this but seems not work anymore, do you think is the new version of hass problem?

ERROR: Could not build wheels for lru-dict, which is required to install pyproject.toml-based projects

Anyone try a clean install and done?

1 Like

lru-dict isn’t compatible with python 11 yet, but I found a fix that was only posted yesterday so it isn’t in the main branch yet. I was able to install with this:

pip install git+https://github.com/amitdev/lru-dict@5013406c409a0a143a315146df388281bfb2172d

Home Assistant 2023.4.1 on an Amazon Fire TV Cube now launches, however the next hurdle is ha-av, which is incompatible with ffmpeg v6 (issue posted here https://github.com/home-assistant/core/issues/90994 )

1 Like

CFLAGS=-Wno-incompatible-pointer-types pip install lru-dict

Found an other solution here

2 Likes

Do not use this - although it compiles, it may segfault. I was the original poster of the above.

A better solution is to use @jambalaya’s fix:


I have managed to get ffmpeg 5.1.2 built and working with ha-av by cloning the termux-package repo at 619095bbd0307851a7767b78e572ae22d8649e0bGitHub - termux/termux-packages at 619095bbd0307851a7767b78e572ae22d8649e0b

  1. Clone:

git clone https://github.com/termux/termux-packages.git

  1. Switch to commit

git checkout 619095bbd0307851a7767b78e572ae22d8649e0b

  1. Install dependencies

pkg i freetype game-music-emu libaom libandroid-glob libass libbluray libbz2 libdav1d libgnutls libiconv liblzma libmp3lame libopus librav1e libsoxr libssh libtheora libvorbis libvpx libvidstab libwebp libx264 libx265 libxml2 libzimg littlecms ocl-icd xvidcore zlib opencl-headers jq

  1. Build

./build-package.sh ffmpeg -s


You may also find ha-av tries to want to build an older numpy==1.23.2 version than the one in the python-numpy package.

To do this, run CFLAGS=-Wno-implicit-function-declaration MATHLIB=m pip install numpy==1.23.2


You may also have problems with pynacl. To build:

pkg i libsodium

SODIUM_INSTALL=system pip install pynacl

3 Likes

same problem in my xiaomi note3 (linux deploy).