Giter Site home page Giter Site logo

hass's Introduction

#ESPHome

secrets.yaml should look like:

wifi_ssid: "Hymer"
wifi_password: "pwd"

#Host file /data/data/com.termux/files/home/.suroot/.homeassistant/.storage/core.config_entries

#IP Webcam

get apk google play or:
adb shell pm list packages
adb shell pm path com.example.someapp
adb pull /data/app/com.example.someapp-2.apk path/to/desired/destination

adb install-multiple base.apk split_config.arm64_v8a.apk split_config.cs.apk split_config.xxhdpi.apk 

termux-home-assistant-installer

A script to provision Home Assistant Core on an Android / Termux device. This is not officially supported.

Warning: This is pre-release quality, if this breaks your Termux installation, I am not responsible. Please try this on a fresh Termux installation that you're happy to dispose of if required.

Note: This package currently supports aarch64 devices only. If another architecture is important to you, please raise an issue and I will look into supporting.

Quick Installer

curl -sL https://github.com/ondyn/termux-home-assistant-installer/releases/download/1/remote-install.sh | bash

Please be patient, this will take a while depending on your device specifications.

What this script does

  • Updates packages, and installs dependencies
  • Downgrades ffmpeg to 5.1.2-7 for ha-av compatibility
  • Creates a virtualenv in ~/hass. Please ensure this directory does not exist before installing
  • Downgrades python-numpy to 1.23.2
  • Installs Home Assistant Core in your ~/hass directory

Starting hass after installation

  1. Start from your home dir: cd ~
  2. source hass/bin/activate
  3. hass -v
  4. Wait, again, for lazy dependencies to be installed (first boot only)

If you run into an error, please CTRL+C and re-run hass -v. There are some intermittent install issues with file-locking I believe.

Got Root?

Home Assistant on Android / Termux works best when you have a rooted device, and run with sudo.

That said, I've had success installing on a factory spec Samsung S21 FE without root. You will notice some CRITICAL messages in the log output referring to /proc endpoints not being found. These can be ignored for the most part.

Remember that running sudo hass -v and hass -v will result in Home Assistant looking for a configuration file in ~/.suroot/.homeassistant and ~/.homeassistant respectively. This can be confusing when you forget to add sudo, and it looks like your HA has been wiped. I have had success creating a symlink between these directories to keep both inline. Just be aware that if the HA backup process sees a symlink, the tar archive can be difficult to extract / corrupt.

Why is this hard?

The first thing to mention is that Termux isn't Linux. Packages that should just build on Linux fail to build in Termux. One of these packages is numpy, which Home Assistant relies on.

Packages in termux-packages use a very clever cross-compilation system, but the repo only contains the latest version of packages. In order to install outdated specific versions of Termux packages, we need to check out a specific commit, and then build ourselves. The pkg-old.sh utility in this repo queries the git log and parses out the exact commit hash for a specific package version. We can then check this out, and hand over to the Termux docker build process.

I've tried this on ARM64 machines directly, but the best results are using the docker-based cross compilation toolchain on AMD64. Luckily termux-packages handles all of that for us, and we can simply run ./scripts/run-docker.sh ./build-package.sh <package-name>.

Unfortunately it seems that checking out a commit isn't the only thing we need to do in some situations. Some other dependencies source archives become unavailable, so human input is required to build these dependencies at this stage. I'd have liked to have set up a CI job which handles this automatically, but at the moment this isn't possible.

I will be giving some thought into dependency management and contrib/ dpkgs.

hass's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.