Home Assistant with an external Timescale DB

I run Home Assistant as a virtual machine under Proxmox. I already have another instance under Proxmox that runs Postgres. I would like to set up a Timescale DB on the Postgres instance, and have Home Assistant log to that Timecale DB. My goal is long term storage of sensor data, analysis and data mining on top the Timescale DB.

I have found some add-ons that install Timescale DB locally on the Home Assistant instance Timescale DB Addon - @Expaso LTSS - @freol

But it is not clear to me how to achieve this on an external Timescale server.

  • Do I need to create some tables manually? Or can HA create them automatically for Timescale?

  • Can HA be set up to use Timescale instead of the built in SQLite? And can it use Timescale adapted queries for efficiency when fetching time series data?

If anyone has experience with this use-case or tips from knowledge it would be greatly appreciated.

For what it’s worth, I’ve been running Home Assistant with an external PostgreSQL database for a while and everything works great. Check out the configuration for Recorder - Home Assistant . When HA restarts, it will create whatever tables are needed. Note that you’ll lose the local file data unless you create all tables and migrate before starting up with the new database.

I also have the TimescaleDB extensions installed in the database, but since HA creates its own tables, I have not realized the benefit for tools like Grafana. If you have done any work in that area, it would be great to hear your experience!