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

Just did… similar error “openssl/opensslv.h file not found”

pkg install openssl-dev

Successfully installed cryptography-2.3.1 homeassistant-0.83.1 !!!
Thanks a lot!

1 Like

It seems that termux is breaking discovery component. Any idea what might be the cause ?

https://github.com/home-assistant/home-assistant/issues/18464#issuecomment-443392272

Did you install hass in venv?

No, I followed your instructions in the first post.
The problem appeared a few months ago after updating termux. Before that it was working fine. I didn’t really care because I didn’t need discovery at that time.

Termux is a rolling release and now on termux python is on 3.7 version. You probably had hass installed on python3.6 before. Try to remove hass and install it in venv.

Want to use the termux-api to include the phones battery temperature in an automation, but find no component for termux-api. Do you have any example of how it could be used in automations?
Thanks

There is no component for termux. But you can use command_line sensor. Add this to your sensor config.

- platform: command_line
    name: "batt_temp"
    command: "termux-battery-status"
    value_template: '{{
value_json.temperature|round(1) }}'

Great.
Thanks!

Hi @vladosam, any idea why on i can not run mosquitto via pm2, it works without using pm2. I tried one dash, two dash and zero dash before the “-v -c”, you can see the logs below

1543708836: mosquitto version 1.5.4 starting
1543708836: Config loaded from /data/data/com.termux/files/usr/etc/mosquitto/mosquitto.conf.
1543708836: Opening ipv6 listen socket on port 1883.
1543708836: Opening ipv4 listen socket on port 1883.
$ pm2 start mosquitto -- -v -c /data/data/com.termux/files/usr/etc/mosquitto/mosquitto.conf
3.2.2
$ pm2 show mosquitto
[PM2][WARN] mosquitto doesn't exist
$ pm2 start mosquitto - -v -c /data/data/com.termux/files/usr/etc/mosquitto/mosquitto.conf
3.2.2
$ pm2 show mosquitto
[PM2][WARN] mosquitto doesn't exist
$ pm2 start mosquitto  -v -c /data/data/com.termux/files/usr/etc/mosquitto/mosquitto.conf
3.2.2
$ pm2 show mosquitto
[PM2][WARN] mosquitto doesn't exist

Please use code highlighting for you commands “big red arrow on top”.
Copy this command and paste it in termux.

pm2 start mosquitto -- -v -c /data/data/com.termux/files/usr/etc/mosquitto/mosquitto.conf

sorry, just fixed the formatting, same error with the command you just post.

    $ pm2 start mosquitto -- -v -c /data/data/com.termux/files/usr/etc/mosquitto/mosquitto.conf
    3.2.2
    $ pm2 show mosquitto
    [PM2][WARN] mosquitto doesn't exist

Ok. Try to install older version on pm2.

pm2 kill
npm remove pm2 -g
npm install [email protected] -g

Then start mosquitto with pm2.

hmm, didnt work either, logs shown below

$ pm2 kill

[PM2] [v] Modules Stopped
[PM2][WARN] No process found
[PM2] [v] All Applications Stopped
[PM2] [v] PM2 Daemon Stopped
$
$ npm remove pm2 -g

removed 313 packages in 19.627s
$
$ npm install [email protected] -g

/data/data/com.termux/files/usr/bin/pm2-docker -> /data/data/com.termux/files/usr/lib/node_modules/pm2/bin/pm2-docker
/data/data/com.termux/files/usr/bin/pm2-dev -> /data/data/com.termux/files/usr/lib/node_modules/pm2/bin/pm2-dev
/data/data/com.termux/files/usr/bin/pm2 -> /data/data/com.termux/files/usr/lib/node_modules/pm2/bin/pm2
/data/data/com.termux/files/usr/bin/pm2-runtime -> /data/data/com.termux/files/usr/lib/node_modules/pm2/bin/pm2-runtime
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/pm2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"android","arch":"arm"})

+ [email protected]
added 220 packages from 204 contributors in 33.694s
$
$ pm2 start mosquitto -- -v -c /data/data/com.termux/files/usr/etc/mosquitto/mosquitto.conf
2.10.4
$ pm2 show mosquitto
[PM2] Spawning PM2 daemon with pm2_home=/data/data/com.termux/files/home/.pm2
[PM2] PM2 Successfully daemonized
[PM2][WARN] mosquitto doesn't exist

Something changed in pm2 but this should work.

pm2 start mosquitto -- -c /data/data/com.termux/files/usr/etc/mosquitto/mosquitto.conf

Thank you. that seems to work. also needed to update the commands for node-red, basically removed "-- -v" from the end

pm2 start node-red --node-args="--max-old-space-size=128" 
1 Like

Yes. -v give pm2 version. It worked before now i don’t know why i put -v in the first place. :slight_smile:

Hi,
Have tried to setup device_trackers, by router, bluetooth and nmap, but they all fails. Best was nmap which at least installed without error. But the setup failed anyway.

Which presence method are you guys using in this environment? Is it any device_tracker component that is likely to function in the phone environment?

Thanks for any advice.

Install nmap in termux then try to setup nmap in hass.