I just draw your attention to the use of the BH1750 sensor for CubeCell capsule.
It can give some incorrect output if the GPIO0 is left floating as there is no pullup or down resistor on sensor board. Interestingly the sketches have worked when using the sensor on the USB debug board with Capsule , but when on its own in the capsule it does not work correctly all the time.
In the BH1750 spec the DVI pin the one that connects to GPIO0 is used to reset the values of the sensor. You need to set GPIO0 to pinMode(GPIO0,OUTPUT); and digitalWrite(GPIO0,HIGH); to stop it floating.
This has occurred problem has been seen with several of the sketches I have seen, such the Example LoRaWan_BH1750.