OpenHAB 2.1 keeps showing light level as 0 with BH1750 and V_LEVEL



  • I've been seeing a funny thing for a while and finally got down to try to figure this thing out.

    I have built a couple sensors with the BH1750 light sensor.
    I know the sensor works and that the lux value is transferred to the gateway and read into OpenHAB, as seen here (this is pulled from debug logging from Karaf in OH2.1):

    4;1;1;0;0;24.0
    0;255;3;0;9;TSF:MSG:READ,4-4-0,s=0,c=1,t=1,pt=7,l=5,sg=0:52.3
    4;0;1;0;1;52.3
    0;255;3;0;9;TSF:MSG:READ,4-4-0,s=2,c=1,t=37,pt=3,l=2,sg=0:30
    4;2;1;0;37;30
    0;255;3;0;9;TSF:MSG:READ,4-4-0,s=255,c=3,t=0,pt=1,l=1,sg=0:31
    4;255;3;0;0;31
    0;255;3;0;9;TSF:MSG:READ,4-4-0,s=3,c=1,t=16,pt=0,l=1,sg=0:0
    4;3;1;0;16;0
    

    Light level is child sensor 2.

    What bugs me is that each value gets transferred into an appropriate item, except for light level, as seen here:

    22:28:38.347 [DEBUG] [rsAbstractConnection$MySensorsReader] - 4;1;1;0;0;24.0
    22:28:38.349 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 4 found in gateway
    22:28:38.350 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 1 found in node 4
    22:28:38.352 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: temp(0) value to: 24.0
    22:28:38.383 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 4/1 to 2017-07-09T22:28:38.000+0200
    22:28:38.384 [DEBUG] [rsAbstractConnection$MySensorsReader] - 0;255;3;0;9;TSF:MSG:READ,4-4-0,s=0,c=1,t=1,pt=7,l=5,sg=0:52.3
    22:28:38.386 [DEBUG] [rsAbstractConnection$MySensorsReader] - 4;0;1;0;1;52.3
    22:28:38.387 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 4 found in gateway
    22:28:38.395 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 0 found in node 4
    22:28:38.397 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: hum(1) value to: 52.3
    22:28:38.405 [INFO ] [marthome.event.ItemStateChangedEvent] - iUS3TemperatureLC changed from 2017-07-09T22:26:26.000+0200 to 2017-07-09T22:28:38.000+0200
    22:28:38.430 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 4/0 to 2017-07-09T22:28:38.000+0200
    22:28:38.431 [DEBUG] [rsAbstractConnection$MySensorsReader] - 0;255;3;0;9;TSF:MSG:READ,4-4-0,s=2,c=1,t=37,pt=3,l=2,sg=0:30
    22:28:38.437 [DEBUG] [rsAbstractConnection$MySensorsReader] - 4;2;1;0;37;30
    22:28:38.437 [INFO ] [marthome.event.ItemStateChangedEvent] - iUS3Humidity changed from 52.9 to 52.3
    22:28:38.447 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 4 found in gateway
    22:28:38.448 [INFO ] [marthome.event.ItemStateChangedEvent] - iUS3HumidityLC changed from 2017-07-09T22:26:26.000+0200 to 2017-07-09T22:28:38.000+0200
    22:28:38.449 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 2 found in node 4
    22:28:38.453 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: level(37) value to: 30
    22:28:38.462 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 4/2 to 2017-07-09T22:28:38.000+0200
    22:28:38.464 [DEBUG] [rsAbstractConnection$MySensorsReader] - 0;255;3;0;9;TSF:MSG:READ,4-4-0,s=255,c=3,t=0,pt=1,l=1,sg=0:31
    22:28:38.465 [DEBUG] [rsAbstractConnection$MySensorsReader] - 4;255;3;0;0;31
    22:28:38.469 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Battery percent for node 4 update to: 31%
    22:28:38.470 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: battery value to: 31
    22:28:38.472 [INFO ] [marthome.event.ItemStateChangedEvent] - iUS3LightLevelLC changed from 2017-07-09T22:26:26.000+0200 to 2017-07-09T22:28:38.000+0200
    22:28:38.482 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 4/0 to 2017-07-09T22:28:38.000+0200
    22:28:38.483 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: battery value to: 31
    22:28:38.495 [INFO ] [marthome.event.ItemStateChangedEvent] - iUS3Battery changed from 99 to 31
    22:28:38.496 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 4/2 to 2017-07-09T22:28:38.000+0200
    22:28:38.496 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: battery value to: 31
    22:28:38.513 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 4/3 to 2017-07-09T22:28:38.000+0200
    22:28:38.514 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: battery value to: 31
    22:28:38.524 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 4/1 to 2017-07-09T22:28:38.000+0200
    22:28:38.530 [DEBUG] [rsAbstractConnection$MySensorsReader] - 0;255;3;0;9;TSF:MSG:READ,4-4-0,s=3,c=1,t=16,pt=0,l=1,sg=0:0
    22:28:38.530 [INFO ] [marthome.event.ItemStateChangedEvent] - iUS3MotionLC changed from 2017-07-09T22:26:26.000+0200 to 2017-07-09T22:28:38.000+0200
    22:28:38.534 [DEBUG] [rsAbstractConnection$MySensorsReader] - 4;3;1;0;16;0
    22:28:38.536 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Node 4 found in gateway
    22:28:38.537 [DEBUG] [rs.internal.gateway.MySensorsGateway] - Child 3 found in node 4
    22:28:38.538 [DEBUG] [ensors.handler.MySensorsThingHandler] - Updating channel: tripped(16) value to: CLOSED
    22:28:38.547 [DEBUG] [ensors.handler.MySensorsThingHandler] - Setting last update for node/child 4/3 to 2017-07-09T22:28:38.000+0200
    

    It looks like the value for light just gets ignored.

    I added light sensors via PaperUI by manually adding a thing and then an item from that (not using Simple mode).

    The code for the sensor is pulled directly out of the example and in Arduino debug, the value is properly given.

    Does anyone else have this problem?


  • Hero Member

    Hey @George-Laynes !

    You've found a bug in the binding, thank you! 🙂

    I've fixed it and it will work in future versions.



  • @TimO - I live to serve 😉 and find bugs.

    Any idea on how soon it'll be available for general public?


  • Hero Member

    @George-Laynes said in OpenHAB 2.1 keeps showing light level as 0 with BH1750 and V_LEVEL:

    Any idea on how soon it'll be available for general public?

    Very soon. The next release is finished in the next days. But it will not be backwards compatible because there was a change in the naming of the parameters, for example: skipStartupCheck is now named startupCheckEnabled, so I need to think about migration options.



Suggested Topics

  • 3
  • 18
  • 2
  • 12
  • 6
  • 3
  • 2
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts