deCONZ: hue motion sensor light level not updating after change

Hey guys,

I have a problem with my hue motion sensors (deCONZ), but I have no idea how to solve it.

I’m using the light level function of some hue motion sensors in my automations. For example:

- id: '1588378706859'
  alias: 'Flur: BWM schaltet Licht ein'
  description: ''
  trigger:
  - entity_id: binary_sensor.bwm_flur_motion 
    from: 'off'
    platform: state
    to: 'on'
  condition:
  - below: '15'
    condition: numeric_state
    entity_id: sensor.bwm_flur_lightlevel 
  action:
  - data:
      brightness_pct: 30
      kelvin: 2000
    entity_id: light.flur
    service: light.turn_on
  - data: {}
    entity_id: input_boolean.flur_bwm_hat_licht_eingeschaltet
    service: input_boolean.turn_on

- id: '1588378946541'
  alias: 'Flur: Licht ausschalten'
  description: ''
  trigger:
  - entity_id: binary_sensor.bwm_flur_motion 
    for: 0:00:15
    from: 'on'
    platform: state
    to: 'off'
  condition:
  - condition: state
    entity_id: input_boolean.flur_bwm_hat_licht_eingeschaltet
    state: 'on'
  action:
  - data: {}
    entity_id: light.flur
    service: light.turn_off

- id: '1588379068599'
  alias: 'Flur: Licht wurde ausgeschaltet'
  description: ''
  trigger:
  - entity_id: light.flur
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - data: {}
    entity_id: input_boolean.flur_bwm_hat_licht_eingeschaltet
    service: input_boolean.turn_off

If the sensor detects motion and the light level is below 15lx the automation turns the light on. After there is no motion anymore (+15 seconds), the automation turns the light off.
-> works as I expect.

But I found the following out:
light level is 0lx when motion is detected -> light turns on -> light level changed to a value higher then 15 (because of the light) in deCONZ and home assistant -> motion turns off -> light level still the same value -> 15 seconds later the light level is not changing.
-> maybe 5 minutes (!) later the value changed to 0lx.

But I have no idea, how to fix this problem :frowning:

Thank you.

I have the same issue as well, did you ever manage to fix this? I’m just using set times now (motion will turn lights on between 18:00 and 00:00 etc) but it’s not ideal as you need to keep changing the times as the sun goes down earlier in winter etc. Really annoying!

For future reference, I think this isn’t something HA can do anything about.
The Hue motion sensor only updates its illuminance:

  • when motion is detected (i.e. the “occupancy” sensor changes to “occupied”
  • when the “opening” sensor (not the “occupancy” sensor) value changes (this is why you see an update 5 minutes later: that’s the actual time it takes for the sensor to got back to “closed” after opening)

The way to get around it is for your automation to wait a bit after motion is detected before reading the illuminance (i.e. insert a “delay” action). I add 1 second waits in my automations (so: trigger when occupancy changes, then wait 1s, then do something if illuminance is above my trigger level)