Boolean stuck on true, toilet occupancy(help)

almost1234:
just normally attached without any resistor. But i don't see that as a problem as the base code i made beforehand

It is a problem as you don't use INPUT_PULLUP, needed to make a button work if connected without resistor.

And of course the button must be connected between the pin and GND, or it still won't do anything useful.