HA is still using old home dir after move to new homedir

After creating a new virtualenv using Python 3 and testing a basic HA instance, I copied the .homeassistant from my Python 3.7 instance to the new homedir of the Python 3.9 instance on the same machine. After that, I changed the homedir of the homeassistant user on my RPI and rebooted HA.

So far, so good. All was working correct.

After adding light groups, I noticed that HA wouldn’t pick up the changes. Weird. After long searches on fora like these, I finally checked my HA instance using lsof. To my surprise, it was using the old .homeassistant zigbee.db database, which would suggest it was also used home-assistant_v2.db in the same location. It did. After changing the old configuration.yaml, the changes kicked in.

My question: There is no single reference to the old homedir in my configuration or in the virtualenv. So how is it HA is using the old config and DB? And - more importantly - how can I persuade HA to use its new config directory? After all, it is already using custom components and the like from the new home dir.

Anyone?

With a venv install, HA uses $HOME/.homeassistant for the config folder by default. If you didn’t change $HOME for that user account, it’s still using the old one.

Hi Tinkerer,

Thanks for pointing that out. I did all that, but forgot to mention. In the meantime I’ve found the culprit: in the /etc/init.d/hass-daemon script created with https://gist.github.com/naholyr/4275302#file-new-service-sh the RUN_AS is used in CONFIG_DIR as well. Consequence is that moving the homedir will not change the location of the config directory in sync.

Not a very thoughtful script.

Corrected (for my local install, that is).

Thanks for your support!

Yeah, the community guide doesn’t do that - but do please feed that back to the author of the one you’d found.