Great home automation is invisible to the user, and should never cause catastrophic failure (ie inability to turn on the light). Which means that when your HomeAssistant server is down for whatever reason, the lights should continue to work "as expected".
These are scripts you can insert in the web interface of your Shelly device to achieve this effect. For normal operation, set the shelly to "detatched" mode, and create a HomeAssistant automation to actually respond to switch on/off events. Then add this script in the Shelly's web interface. Make sure to adjust the URI for your homeassistant appropriately.
The script checks the availability your homeassistant URI every 30 seconds to make sure it's up. If it's down, it changes the mode to local "flip" mode, where it cuts power on a switch event. When, on a future check, homeassistant is once again responding, it will automatically return to detached mode.
Variants of this script are floating around the h