@gerritv
I am using v1.3.0 of the BH1750 library which I think is the most recent version on github (updated Jan 22).
I had the same issue when using ONE_TIME_HIGH_RES_MODE in that the sensor would return an accurate light level on first power up but then each subsequent read would return the same value regardless of the light level.
Reading through the source code (I think) the measureReady statement is still missing a configure statement to re-power up the module.
So I put a configure statement in the main loop of the sketch which (I think) powers up the module and then a wait for 200ms to allow enough time before reading.
void loop(){
if (!lightSensor.configure(BH1750::ONE_TIME_HIGH_RES_MODE)){
Serial.println("Could not power up light sensor");
}
wait (200);
if (lightSensor.measurementReady()) {
uint16_t lux = lightSensor.readLightLevel();// Get Lux value
#ifdef MY_DEBUG
Serial.println(lux);
#endif
send(msgLight.set(lux, 1));
}
etc...
My device is a combination temp/hum sensor using a HTU21 and light sensor using BH1750.
I now get accurate light levels each read cycle.
In BH1750 continuous mode the current draw was about 0.15mA between reads. In one time mode it is now reading 0.01mA on my ammeter, i.e. almost too small to read.