I'd consider working with the Sheriff if you have done nothing wrong and need protection from them. If they have documents or a warrant, they will continue to try and serve them anytime of day, until they get the job done, which is not against the law. It might provide tons of relief to answer the door and see what's it all about rather than making up scenarios in your head not knowing whether its true or not. Always good to handle any situation head on may not be what you had imagined at all. Get out of fantasy land and into real land. Call the Sheriff tomorrow and find out unless you prefer paranoia and speculation, which is what you are asking us lawyers to do with you..play the guessing game. Good Luck.
You can spend a lot of time trying to figure out why the deputies were there, ask for advice on what you think MIGHT be the problem ... or you can be proactive in taking care of your business. Either answer the door and speak with them to find out what is going on (you still don't have to let them in), or call them and ask. You can also get a lawyer to call them. Then deal with the problem, if there is one. Otherwise, keep waiting on them to show up again, not knowing what is going on.
Yes, it is legal for them to bang on your door and windows at 3 a.m. Furthermore, no one in this forum can tell you how many times they will come to your house. And, as for protecting yourself from your unstable ex, consider asking the court for a domestic violence restraining order. (But, just remember that, if you are able to get such an order, that means you cannot contact your ex either, for any reason, including just to ask her to return your belongings.)
Ms. Berjis is licensed to practice law in the State of California. The laws of your jurisdiction may differ and thus this answer is for informational and educational purposes only and is not to be considered as legal advice. Since all facts are not addressed in the question, this answer could change depending on other significant and important facts. This answer in no way constitutes an attorney-client relationship.