The automation that turns the boolean on, only runs if the boolean is already on. The automation that turns the boolean off only runs if the booleans is already off, you need to change your conditions round.
Please will you post the correct code? I am really poor in both HASS and english so i will understand better if i can see the code… It seems what you replied is what i put in automation, but surely i am wrong…
I don’t mind correcting code when I get a second (I’m on my phone so formatting it takes ages), but you also need to slow down a bit and try to work it out once in a while, as evidenced by the fact that you did work it out yourself in the end. You’ll learn much more that way