Routines only when home

So I’ve connected a Hue lightbulb with an indoor motion censor for my hallway.

I’ve set up a routine that makes the lightbulb turn on the night light-scene at sunset (as I like having a light on in the hallway when at home) and light up when the motion censor detechs movement. After one minut the lightbulb goes back to the night light-scene. This works fine.

However, I don’t want the lightbulb to turn on at sunset when I’m not at home. Then, of course, it shouldn’t turn on at all.

I know it is possible to set up a location based routine, which says all lightbulbs should turn off when I leave the house. But what if I leave before sunset? Then it will still turn on, as the sunset-routine triggers after the location base-routine was triggered, right?

Can I solve this somehow? Thanks in advance.

No one who can help or have any suggestions here…?