OpenWeatherMap-Alerts-Weather-Driver

From the Wiki:

Lux

An estimated Lux is calculated by the driver using sunrise/sunset/twilight begins/twilight ends/cloud cover/ and/or current conditions. The calculation assumes a maximum Lux of 10,000 for a clear sky at noon. It adjusts proportionally for time from twilight ends to Noon in the morning, and Noon to twilight begins in the afternoon (the closer to noon, the higher the number). It also factors in cloud cover. If cloud cover is not available, it will estimate from the weather condition text. The update lux routine checks at least every five minutes to see if a daytime/nighttime schedule change was needed (without polling) even if long polling intervals were selected. It also provides an updated Lux calculation (again, without Polling) due to the time change. The maximum lux is set by time of day as listed below:

  • From Twilight begins until Sunrise: 50
  • From Sunrise until Sunset: 10,000
  • From Sunset to Twilight ends: 50
  • Between Twilight ends and Twilight begins: 5

There is an option for 'lux smoothing/jitter control.' This basically rounds the lux calculation to reduce the variability (code/recommendation from @nh.schottfam) . This is optional and must be selected to enable it. The lux smoothing/jitter control works as follows: If lux estimation is greater than 1,100 --> round to the nearest '800' else If lux estimation is greater than 400 --> round to the nearest '400' else set lux = 5

1 Like