Thanks for the answer! I didn't know there are already ready-made sensors for such use-cases (though I'm not familiar with Home Assistant itself either, only heard of what it is).
Sorry if it’s off-topic but how does it know if the bathroom window open or not? Did you build some kind of device and connect it to the home assistant?
One thing I immediately miss from Python after using Go is building a dict (e.g. for writing JSON values). I had to type map[string]interface{} so many times =P