#does zha support postgresql?

1 messages · Page 1 of 1 (latest)

tender hatch
#

hi, is there a way to make homeassistant with zha use postgres for both records and zha? i dont see an option to use postgres for zha. i did fresh install of homeassistant core to my kuberenetes cluster and sqlite is pain to deal with. it runned for a bit and zha sqlite database is now corruped.

hybrid pilot
tender hatch
#

yeah, thanks. i see that option for recorder but how about zha?

oblique geode
#

No. The ZHA integration can only use the sqlite db.

tender hatch
#

oh really...

oblique geode
#

Hmmmm, re-reading the docs, it accepts a database_path parameter in the configuration, so you might be able to use the recorder syntax for postgresql. But, I’ve never seen anyone do something like that.

tender hatch
#

i see that database path i used to set path to sqlite file 😭

oblique geode
#

Looking at the source, it uses zigpy for the database and zigpy uses sqlite. So, I’m pretty sure my statement is accurate.

#

I do find it interesting that your sqlite db corrupted while running under K8. That’s unusual and would lead me to think you have a problem in your cluster as opposed to ZHA having an issue.

tender hatch
#

i run pretty slow storage on synology ds620slim. i have 6x5t smr (SMR!) drives. any kind of write is a pain. i use nfs4 right now to mount HA storage. i have separate postgresql cluster here which has good nvme drives underneath

oblique geode
#

To be fair, running under K8 is still considered “unsupported”. With that said, the sqlite write-ahead functionality should handle even the slowest of storage.

#

And slow storage wouldn’t cause the database to corrupt unless you have some very chatty sensors.

tender hatch
#

yeah, maybe it does not like that it could take tens of seconds to sync that sqlite file and that happens all the time?

#

sqlite is not a resilient solution to store data though

tender hatch
oblique geode