Help needed with a lighting rule....Please

Hi all im in need of some assistance if anyone can help me please.
I currently have an simple automation running that turns some of my lights on in the kitchen at sunset,the problem i have is, if someone is in the kitchen before sunset and turns the lights on to say 100% then remains in the kitchen after sunset the lights change to the kitchen automation that i've setup which is set at 40% brightness.
what i would like to do is set a rule that says if the lights are on before sunset don't run the rule but i'm got a bit stuck setting this up.
If anyone could guide me in the right direction i'd be greatly appreciated.

Cheers Kev

Can you post a screenshot of your rule or automation?

Without seeing your existing rule it's hard to recommend the best way to set this up. A very simple rule would look something like this.