Where Is Current Configuration Stored while Home Assistant is Running?

Hey All:

So, I managed to delete all of my .yaml files in my config directory (symlink and a bad delete command). My HA is still running, and in fact all of my automations and such are still working, but my yaml files are gone. I’m sure that on reboot everything is going to puke out.

Where are these things stored while HA is running? Is there any way for me to get the current state of what has been loaded? Even if I have to reconfigure it into new yaml files myself, that is vastly superior to losing everything!

Please help!!!

–edit-- Quick question for the wise: does the check_config script detailed here (https://www.home-assistant.io/docs/configuration/splitting_configuration/) reload those files, or does it access just what is currently in memory? I’m tempted to try it but I don’t want to run the risk that it reloads (or attempts to reload) the files.

I believe all configuration is kept in memory, while HA is running. Some plugins will write back to disk current version of their configuration that is active on shut down (like deconz or z-wave), but not HA itself.
The only thing that comes to my mind is that perhaps you can try to go to lovelace Configure UI option and then open page by page and card by card and just click Save, without making any changes. perhaps this will write at least part of configuration back to file (and recreate it if needed), but I’m not sure… for obvious reason never tested. It could even work for scripts or automation if accessed from editor For sure this won’t recover things like sensors, inputs etc. that can only be configured manually in configuration.yaml…
Hope there is better way!

In the trash bin still or did you empty that as well

It’s definitely not re-writing my config files for me. And some of them Lovelace couldn’t touch anyways (e.g. the automations were all in separate files stored and included by way of include_dir; the GUI refuses to access those files at all).

My hope is that HA caches something human readable somewhere.

There’s no trash bin. HA is on Hassbian; I was accessing it through a symlinked debian client via smbnetfs. Problem is that my $pkill smbnetfs didn’t actually process before I ran $rm -rf on the symlink, expecting only the link itself to be cleared. I don’t think any type of temporary deleted storage applies to that situation.

Lovelace doesn’t touch the configuration yaml files

In .storage folder there is full UI cofiguration stored in lovelace file… though indeed it is JSON. Other way of acessing it is through UI Configuration and then going to Raw config editor… this time it would be presented as yaml. But again only UI, not the entire configuration :frowning:
Fact that automations are not accessible via GUI might mean that editor does not see them, not having proper entries (!include lines) in configuyration.yaml (that does not exist). I have my automations and scripts configured also as include files (but not dirs) and GUI has no problem with accessing them.

It’s quite the conundrum. My Hassbian system continues to run without issue. Automations fire, timers run, all screens work great. I suspect that my custom_components will quit firing, but I won’t know that until January 27 when it should next be expected to update or do anything (they all got burned as well). Honestly, if I hadn’t logged into the device via ssh, I wouldn’t have even known that there was nothing there.

Of course, I’m NOT about to do anything that could even potentially make it look for the files.

I’ve taken the opportunity to rebuild a RPi3 into a Hass.io device (Hassbian is actually running on a RPi2). I’m looking forward to what should be a significant upgrade. It also gave me a chance to re-think my automations - I had 73 before (remember: I can see them all under “States” but I cannot see their contents), and I’ve now cut it down to 17 with only about 5 to recreate. I’ve learned a lot over a few years of using it (and have been walked through some pretty intense templates), so it’s probably all for the better.

Tonight I get to see if those 17 automations work. If so, I’ll finish up my last handful and have a pretty neat system with the newest features (Configurator is way easier to install on Hass.io!). I’ll probably just end up leaving the hassbian system up for a few days but disconnected from the network so that it isn’t trying to automate things (but so that it can get plugged back if my cleanup has gone awry) and once I’ve got most of my toys back will let it die.

It just seems so strange that the program requires the files for startup, can completely ignore them once running, but there is no way to recover the data that is in them once going. It runs so smoothly that I was certain they had to be cached somewhere. Bizarre.

And don’t forget to backup your new system.

mark this blogpost