I think the title of this actually is a bit misleading - detecting sunset.
imho:
sunset is a time event.
luminance is a light brightness event. (or lux or whatever you call it in your world)
it feels to me you really want to detect 'luminance' or lux. Lux is a highly varying value - it can change literally depending on where your standing. If you're trying to get to some level of super high accuracy, then you'll need a lux measurement sensor at the point(s) of interpretation.
In reality, lux is really more of a range or a +- from a value. So setting an event driven rule with a lux reading for lat/long seems to be actually more than adequate using something like a PWS or OWM lux value. It can really depend on how often you're pulling the update from the source and updating your dashboard - very similar to a Temp or Humidity reading from a multi-sensor.
yea cloudy reasons is why i wanted lux sensor. Because at many times the indoor lights turned on when outside was still quite bright, and other times the lights came on too late because outside was cloudy (and hence low light). In this scenario had to manually trigger the lights.
That's why i wanted a sensor solution that polls often.
Yes itās a lux sensor, but unlike a properly positioned weather station, itās probably not going to be sitting on top of your roof, or a tall pole.
So depending on where you put the motion sensor and the trees and/or structures around it, the lux value it reports could be lower than a sensor that has an unobstructed āviewā of the sky.
Re lux... And I'm not claiming any real expertise here... Nor am I wanting to come across as some kind of counter to @marktheknife 's expert advice..
(Have I prefaced this enough...)
I would add that low (or high) lux readings in an outdoor motion sensor may be useful to indicate the conditions immediately outside a room and the likely conditions that would drive automations, I think ..
Actually I wasnāt necessarily advocating for the outdoor weather station approach .
The east side of my living room gets darker much sooner than the west side, because well, thatās where the sun is, lol. Also thereās more tree cover outside the east-facing windows.
So while I do have a Ecowitt weather station on the roof, I also use other lux sensors to turn on some lights before others.
Yeah, was (poorly) trying to downplay my comments so I didn't seem to be countering yours and other comments. But ultimately sensors at key parts of the house, inho, are a better indicator of how best to drive lighting in different parts of the home.
Personally, I would think there are two many reasons inside light could fluctuate to depend on a outdoor sensor. I would think maybe something like a Aeotec multisensor or Zooz 4-1 sensor with a lux sensor in the room may be better. At least then you are reading the room that is actually effected. It would take some trial and error to determine at what point you want the change to actually effect lights, but that could work.
In terms of variability, my approach to this is to use a private boolean in the rule to make sure that once I close the blinds, for example, I don't go back, so once I reach a threshold I am happy with, I close the blinds and there's no going back.