Problem with automation AC off When window is close

It is very difficult to make sense of what you have written. Could you please edit and format your post as explained here.