Geen idee of iemand bekend is met Philips HUE, maar ik heb een aantal motionsensors die ik via de API uitlees en opsla. De motionsensor heeft een motion-, temperature- en lightsensor. De waarde van de lightsensor ligt volgens mij tussen 0 en 30000.
Ik zou dit graag weer willen geven in LUX.
Volgens de HUE Developers pagina:
"Light level in 10000 log10 (lux) +1 measured by sensor. Logarithm scale used because the human eye adjusts to light levels and small changes at low lux levels are more noticeable than at high lux levels."
Volgens wikipedia:
Illuminance (lux) Surfaces illuminated by
0.0001 Moonless, overcast night sky (starlight)[4]
0.002 Moonless clear night sky with airglow[4]
0.05–0.3 Full moon on a clear night[5]
3.4 Dark limit of civil twilight under a clear sky[6]
20–50 Public areas with dark surroundings[7]
50 Family living room lights (Australia, 1998)[8]
80 Office building hallway/toilet lighting[9][10]
100 Very dark overcast day[4]
150 Train station platforms[11]
320–500 Office lighting[8][12][13][14]
400 Sunrise or sunset on a clear day.
1000 Overcast day;[4] typical TV studio lighting
10,000–25,000 Full daylight (not direct sun)[4]
32,000–100,000 Direct sunlight
Maar dat komt totaal niet overeen met wat ik nu heb. Als het al een beetje donker is, vanaf een uur of 17.30 tot 8:00 is de waarde 1 en dat is het laagste wat ik krijg. Ik heb verschillende manieren geprobeerd, maar zonder het gewenste resultaat.
$lux = (10000*log($row['lightlevel'] | float, 10) + 1);
$lux = (10000*log10($row['lightlevel']) + 1);
$lux = (10 ^ (($row['lightlevel'] - 1) / 10000));
$lux = number_format(round(pow(10, ($row['lightlevel'] - 1) / 10000),2), 2, '.', ''); // Deze gebruik ik nu
Waardes die ik nu krijg met de laatste functie
9.04 Trappengat 9 Feb 14:24
70.21 Keuken 9 Feb 14:24
9.04 Hal 9 Feb 14:20
8.82 Trappengat 9 Feb 14:19
64.80 Keuken 9 Feb 14:19
9.92 Hal 9 Feb 14:15
8.93 Trappengat 9 Feb 14:14
78.47 Keuken 9 Feb 14:14
9.70 Hal 9 Feb 14:10
10.03 Trappengat 9 Feb 14:09
65.24 Keuken 9 Feb 14:09
7.94 Hal 9 Feb 14:05
8.82 Trappengat 9 Feb 14:04
69.87 Keuken 9 Feb 14:04
7.94 Hal 9 Feb 14:00
11.24 Trappengat 9 Feb 13:59
69.87 Keuken 9 Feb 13:59
Iemand meer verstand van wiskundige formules in PHP?