Petera, I just went a few days of HG api not working. I was able to putty in, I was able to use my file browser in. I could ask it anything. Just ALL API workings stopped. DEad. Makes it totally unusable for a security system when this happens.
I turned my logging off a month ago per your suggestion so I have no clue why the API stopped workkng which everything else seemed to work. Unfortunately I need the API to set my X10 alarm.
A simple reboot of the pi brought the API back and it has been working again (3 days or so). I just have to keep an eye on it to know when it needs a rebolot I guess.
While logging was on, it ran about a year before this...
You're logging enabled is in no way going to help your setup become more stable. In fact in most home automation programs its logging that is usually the culprit owing to delayed writes to the database.
I've no idea why your system appears to be unstable. I'm assuming you install Raspberry Pi OS and HG from official sources. Other than that you may be using old HG programs from the old HG forum that haven't been re edited or recompiled since they were originally written. That's one sure way of crashing your system.
Those programs need to be looked at closely, edited where necessary and recompiled to work on the current version of Mono. No matter how innocent the program looks, if it's error handling is not properly handled as per today's Mono version they crash HG and leave it hanging.
Best to stick with the stock version of HG and create Wizard automation scripts where necessary to avoid this. Some of the JS stuff is way out of date too. Of course you can adapt some of the known working CSharp and JS scripts but best to avoid all that older stuff. It's more trouble than it's worth. That's the trade off for a solid reliable setup.
Check your service daemon and ensure it include the line Restart=always. That ensures HG will restart should it stop for any reason. Keep everything simple.