Hello, I have an old xiaomi android phone. I am think to resue it instead of throwing it away.
I tried to follow the approch Home Assistant Core on Android Tablet
But I found out there is no supervisor, addon or hassio, it is going to be difficult to maintain in the future. (it took me lots of effort to install pynacl and other dependencies )
Then I tried to convert it into a postgresql server, the performance is way beyond my imagine:
Query 2171872 events from mariadb on synology takes 21.033016384 seconds
Query 2175127 events from postgresql on android takes 0.9023583849999994 seconds 21x faster !!
The UI with history graph is loaded significantly faster than before.
Please follow Home Assistant Core on Android Tablet to install LineageOS, termux and ssh.
Install postgres server
Please follow Postgresql - Termux Wiki to install DB server
$PREFIX in my case is /data/data/com.termux/files/
enable remote connection
edit $PREFIX /usr/var/lib/postgresql/pg_hba.conf
add new line
host YOURDB_NAME all your_router_ip/24 trust
edit $PREFIX /usr/var/lib/postgresql/postgresql.conf
add new line in the end
listen_addresses = '*'
optional: migrate from mysql to postgresql
after migration
run
ALTER TABLE "public"."recorder_runs" ALTER COLUMN "closed_incorrect" TYPE BOOLEAN USING closed_incorrect::int::boolean
setup home assistant
follow Recorder - Home Assistant