>That law has nothing to do with incriminating yourself (it's more about safety), but even if the law was specifically "so someone can see into your window and identify you if you do something bad", that's still not self-incrimination. Self-incrimination is requiring someone to testify against themselves.
You are requiring someone to take action that will assist in their own prosecution. That is the goal as per your own statements, and is the obvious primary purpose of these laws.
If that is not compelling someone to self-incriminate, what is?
>Basically you're saying that any law is invalid if it makes or ensures that any kind of wrongdoing visible to witnesses. That's absurd.
No, i'm saying that if you make a law whose primary purpose is to assist in the prosection of those who are compelled to follow it, that law is invalid. If you make a law that incidentally requires someone to assist in their own prosecution, then the law may be valid, but the usage of that information in prosecution or investigations is invalid and falls under the fruit of the poisonous tree doctrine.
I see no difference between it and compelling people in court to testify against themselves, because the only difference is where the self-incrimination is happening.