Here is a “how to” that will help you to reduce the size of your pimatic DB.
pimatic will be faster and your filesystem will thanks you!
Be carrefull make a full backup before following those steps
First thing is to STOP pimatic
cd pimatic_app
./node_modules/pimatic/pimatic.js stop
Next we copy the current database to a backup file (named pimatic-database.sqlite.backup)
cp pimatic-database.sqlite pimatic-database.sqlite.backup
We can now export DB content (data + tables structures) into a file called pimatic-database.sql
sqlite3 pimatic-database.sqlite .dump > pimatic-database.sql
Now we can delete the old huge database
rm pimatic-database.sqlite
Let’s now recreate the DB and reimport the data
sqlite3 pimatic-database.sqlite < pimatic-database.sql
You can now restart pimatic using the DB recreated
./node_modules/pimatic/pimatic.js start