2 different databases (Mariadb) 2 recorders?

Hi everyone,
Does anyone knows if its feasible to have “2 recorders” with different databases and keep_days configuration?
I’m switching from the default recorder and want to use MariaDB addon.

I know that we can configure 2 different databases (already done) in the addon but how to manage it in order to have both in configuration with 2 distinct setups?

Thank you in advance.

PS: Want to use the addon instead of external instance.

Use case:

  • 1 database with the majority of data with a 2 days purge.
  • 1 database with energy sensors (at least) with a 730 days purge.

I use postgresql, but I believe similar is possible in mariadb, I created a pair of triggers that copy every add to events and states tables to a pair of archive tables. I copy everything but creating filter logic for the trigger sees like it would be easy. That said storage is pretty cheap. I keep 60 days in main HA tables and have 2+ years of archive. Total size of data is about 525GB.

I’m not sure about your ‘PS: Want to use the addon instead of external instance.’ requirement, I have my HA and postgresql hosted in two docker containers and use Jupyter, Grafana and AppDaemon in three more to analyze and process data.

Finally i have this working…
2 databases via Mariadb add on.

One as usual recorder.
Another one to energy.
Using a script to write to the db and sensors to read!

2 Likes

can you share the script and setup?

2 Likes

Interested in your script as well. I have problem with to big db file and fast growing, but would like to keep data from energy sensors…
thanks

also interested

I want to run multiple recorders

All data in memory purged daily SQLite containing other data for a few weeks and MariaDB with the data I want to keep long term

I’m interested in your setup and script as well. Did you descripted it somewhere?
I want to store my ‘Energy dasboard’ data in a long term db, seperate from the default Sqllite db

very interesting!