dcmartin / motion-ai

AI assisted motion detection for Home Assistant
http://motion-ai.com/
Apache License 2.0
286 stars 29 forks source link

Utilize Maria-DB for SQL store #11

Closed dcmartin closed 3 years ago

dcmartin commented 3 years ago

Apparently utilizing Maria DB for the SQL store is much faster than the standard SQL3 database.

I tried to setup the homeassistant/recorder.yaml to utilize the MariaDB addon, but it didn't work properly.

I tried to run MariaDB in a container (see sh/mariadb.sh), but HA throws errors trying to use the DB for some updates; IDK.

Any help appreciated.

dcmartin commented 3 years ago

Configuration of Home Assistant through the recorder component has commented-out directive:

#db_url: !secret mariadb-url

The secret mariadb-url is defined using a template:

mysql://homeassistant:${MARIADB_PASSWORD}@${MARIADB_HOST}/homeassistant?charset=utf8mb4

Starting the MariaDB from the standard add-on store repository will provide the required SQL services.

See https://github.com/dcmartin/motion-ai/blob/master/docs/MARIADB.md