How can I switch to/from dark mode depending on "darkness" instead of sunset?
Basically you (and third party developers) don’t get to automate this since it’s a private API. This article explains the situation in great detail and offers three tools to get you close to customizing it.

https://setapp.com/how-to/use-night-shift-for-mac


First, turn the night shift off under “Schedule” in the night shift menu. This disables it schedule from activating, but doesn’t disable the feature.

I wonder if your setup is the ambient light sensor changing and not the schedule, though.

It will activate when it notices your environment is darker than normal, and disable itself when you’re back to daylight or bright environments.


Keep in mind this option will trigger automatically, which can be frustrating if you’re in a spot where the light fluctuates.

Short of using an automation tool to define your own preferred schedule or just automate toggling this manually, you can use Apple’s implementation or just take breaks and manage your lighting external to the display.
Some excellent automation tools include

https://www.obdev.at/products/launchbar/index.html
https://www.keyboardmaestro.com/main/