Homeassistant stop working after 4 days

This really shouldn’t be necessary. How is your logger configured? Mine looks like

logger:
  default: warning
#    logs:
#      homeassistant.bootstrap: info
#      homeassistant.components.device_tracker: info
#      homeassistant.components.automation: debug
#          homeassistant.loader: info
#          homeassistant.core: info

The default is for warning only. The other commented out sections are useful when debugging, but not used in general.

Edit:
Also, do you restart HA when you delete the files? It has just occurred to me that if you just rm them, HA may be keeping a handle for them and preventing the OS from freeing the disk space, which would lead to your symptoms.

mine looks like:

##########

EXTRAS

##########
logger:
history:
discovery:
sun:
conversation:
logbook:
frontend:

and no, During the 4 days HA never restarted.

can u tell the script for to do that?

Looking at the Logger documentation, it seems that if you have it set up to log everything, which is definitely not what you want.

I would change the logger entry to

logger:
   default: warning

Which will stop the log filling up.

Similarly, to stop the database getting too big I have

recorder:
   purge_days: 3

Which deletes any data older than 3 days. My database is still 62M, but it seems to be stable there.

If you do this, you shouldn’t need to delete the files and restart HA, but if you do, the command to use is

sudo systemctl restart [email protected]

Also remember that the homeassistant user doesn’t normally have sudo privileges, so you need to run this a pi user,

1 Like

I had the same issue as you and thought it was a dodgy version of HASS. I downgraded, same issue. In the end it got to a point where it refused to boot entirely.

In the end I changed to another SD card, installed from scratch and it’s been rock solid. I’m now also a bit more patient when restarting the raspberry pi. Previously I would power it down at the switch constantly (seeking a faster reboot) and I think that was the root cause of issues on my previous SD card.

Let us know how you go.

thank you. i will follow your sugest. if the problem show again then i will buy another card.