Install Home Assistant, Mosquitto broker and Node-Red on android

There is config folder. .homeassistant is config folder. I have some files in www folder on termux and hass sees that files just fine.

ok the .homeassistant folder replaces the config folder. now the link to access the www pages is the same as hassio? in my case 192.168.0.252: 8123 / local / casa/ index.html (tileboard)
because it doesn’t work

500 Internal Server Error

Server got itself in trouble

On this address i get example board

http://localhost:8123/local/tileboard/index.html

I’m doing something wrong, but I don’t understand what!
Can you access the www folder directly from the configurator? not me
I copy directly with samba from hassio to hass on termux

Open termux. Go to .homeassistant/www folder. Remove tileboard folder.
rm -rf tileboard
Install git and clone tileboard from github.

git clone https://github.com/resoai/TileBoard.git

Rename TileBoard to tileboard

mv TileBoard tileboard

Go to tileboard folder and rename config-example.js file

mv config.example.js config.js

Then try again.

Hi, if i need to restart homeassistant service i must execute this command:

pm2 restart hass --interpreter=python -- --config /data/data/com.termux/files/home/.homeassistant

Or restart mosquitto and node-red too?
Thanks.

You can just use pm2 restart hass no need for any arguments. Same for node-red or mosquitto.

So to replicate this command on termux

sudo systemctl restart [email protected]

just type

pm2 restart hass

Am i wrong?

Yes thats right. Just try it.

It works!
Thank you.

One more running home assistant with termux, and couldn’t be more satisfied.It’s perfect for a vacation house where there is no WiFi, but 4G still works. Its very stable, the battery works as backup when power is down, and my old Moto G4 with 8 cores runs much faster than the old Pi. The Android phone also works as a hotspot for sonoff, cameras, and also broadcast its phone camera to home assistant.

Next step is to run also object detection with OpenCV - no luck so far.

Thank you @vladosam

:+1: What’s your problem with opencv? I also played with opencv before and i think i managed to make it work. I deleted that long ago but maybe i still remember what i did to fix it. :slight_smile:

OpenCV was installed - I can import cv2 in python. However when I try to use dnn it says “module cv2 has no attribute dnn”.

How did you install opencv?

Hi, after introducing pm2 logs hass

(homeassistant) $ pm2 logs hass
[TAILING] Tailing last 15 lines for [hass] process (change the value with --lines option)
/data/data/com.termux/files/home/.pm2/logs/hass-out.log last 15 lines:
2|hass     | Unable to find configuration. Creating default one in /data/data/com.termux/files/home/.homeassistant

/data/data/com.termux/files/home/.pm2/logs/hass-error.log last 15 lines:
2|hass     | 2020-05-13 18:25:21 INFO (SyncWorker_5) [homeassistant.loader] Loaded binary_sensor from homeassistant.components.binary_sensor
2|hass     | 2020-05-13 18:25:21 INFO (MainThread) [homeassistant.setup] Setting up default_config
2|hass     | 2020-05-13 18:25:21 INFO (MainThread) [homeassistant.setup] Setup of domain default_config took 0.0 seconds.
2|hass     | 2020-05-13 18:25:21 INFO (MainThread) [homeassistant.setup] Setting up binary_sensor
2|hass     | 2020-05-13 18:25:21 INFO (MainThread) [homeassistant.setup] Setup of domain binary_sensor took 0.0 seconds.
2|hass     | 2020-05-13 18:25:21 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.updater
2|hass     | 2020-05-13 18:25:21 INFO (SyncWorker_1) [homeassistant.loader] Loaded cast from homeassistant.components.cast
2|hass     | 2020-05-13 18:25:21 INFO (SyncWorker_4) [homeassistant.loader] Loaded google_translate from homeassistant.components.google_translate
2|hass     | 2020-05-13 18:25:21 INFO (SyncWorker_5) [homeassistant.loader] Loaded spotify from homeassistant.components.spotify
2|hass     | 2020-05-13 18:25:22 INFO (MainThread) [homeassistant.setup] Setting up tts
2|hass     | 2020-05-13 18:25:22 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.1 seconds.
2|hass     | 2020-05-13 18:25:29 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 28.19s
2|hass     | 2020-05-13 18:25:29 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2|hass     | 2020-05-13 18:25:30 INFO (SyncWorker_1) [homeassistant.components.zeroconf] Starting Zeroconf broadcast
2|hass     | 2020-05-13 18:25:30 INFO (MainThread) [homeassistant.core] Timer:starting

and it doesn’t continue working
any solution?

i don’t see from that log why hass fails. Try to run it just with hass to see full log.

Could it be that the problem is in the configurator?

I am following this tutorial https://www.youtube.com/watch?v=0N_587XCWd0&t=149s

After running mosquito, node-red and hass I perform the following steps:

cd /data/data/com.termux/files/home/.homeassistant
curl -LO https://raw.githubusercontent.com/danielperna84/hass-configurator/master/configurator.py
chmod 755 configurator.py
pm2 start /data/data/com.termux/files/home/.homeassistant/configurator.py 
pm2 logs hass

The result is my previous post
What am I doing wrong?

Did you try to run it without configurator?

Trying to figure out what am I missing when trying to autostart HASS after reboot . I have an app to autostart Termux, Termux:Boot installed, ~/.termux/boot/start-sshd script to hold the wakelock and start sshd is in place - this part works fine. I also have edited ~/.bashrc to include pm2 resurrect, but this part won´t work. So after reboot Termux starts, holds wakelock and starts sshd, but no pm2 resurrection takes place, have to log into sshd and only then pm2 resurrects hass.

Does autostart opens termux after reboot?