RTCGQ11LM light level broken since 2.17

For me 2.17 beta breaks the light level on all of my RTCGQ11LM Aqara motion sensors. Meaning the light level is stuck on one value (seems to be random, I’ve one stuck at 0 lux, one at 49 lux, one at 236 lux…):

Other Sensor seem to work well.

I experienced the same with my Philips HUE Outdoor sensor.
Had to downgrade to 2.16.01.

What does deconz debug output tell you? In deconz GUI, select Help → Debug view. Then select DDF only and trigger the light sensor (probably best to do it with the flashlight of a mobile). You should see some line comparable to the below (the item to look for is either lux or lightlevel, depending on the device):

23:07:46:577 00:15:8d:00:02:d1:35:73-01-0400/state/lux expression: const tholddark = R.item('config/tholddark').val;
const tholdoffset = R.item('config/tholdoffset').val;
const lux = Attr.val;
let ll = 0;

if (lux > 0 && lux < 0xffff) {
    ll = Math.round(10000 * Math.log10(lux) + 1);
}

R.item('state/lightlevel').val = ll;
R.item('state/dark').val = ll <= tholddark;
R.item('state/daylight').val = ll >= tholddark + tholdoffset;

Item.val = lux; --> 7

All my Hue and Xiaomi sensors work flawlessly in this regard.

The site where I had trouble with 2.17.0 has a 112 node network.
On a second site with only 20 nodes 2.17.0 works OK.

On both sites the sensor is routed through other nodes.

I will try again on the 112 node site next week when I’m back there.
Gave the mesh ample time to settle though, 4-5 hours.

Maybe this might help:

21:31:06:854 failed to evaluate expression for 00:15:8d:00:07:e9:1b:31-01-0400/state/lux: const tholddark = R.item('config/tholddark').val;
const tholdoffset = R.item('config/tholdoffset').val;
const lux = Attr.val;
let ll = 0;

if (lux > 0 && lux < 0xffff) {
    ll = Math.round(10000 * Math.log10(lux) + 1);
}

R.item('state/lightlevel').val = ll;
R.item('state/dark').val = ll <= tholddark;
R.item('state/daylight').val = ll >= tholddark + tholdoffset;

Item.val = lux;, err: TypeError: Property 'log10' of object [object Math] is not a function

Yeah, that’s a pointer. Could you please also provide some info around your system setup? Hardware, OS…

@manup Any thoughts on this maybe? Might be a qt thingy…?

Sure, Raspberry Pi 3B+ running Raspian 10, no open updates according to apt-get. Conbee II with latest firmware (26780700). Network consist of 73 nodes, mostly Aqara sensors and Ikea lights, some Osram/Lightify lights, a few sonoff relays, a few sunricher switches…

Besides a piVCCU and zigbee2mqtt instance the Raspi isn’t doing anything besides being a Smart Home Gateway.

Good catch, looks like the log10 isn’t available in all QT/ Javascript Engine versions.

I think it’s useful to integrate our own Util. lib so we do not depend on the Qt version and can do other fancy stuff like big number handling.

I’ll add a small PR for this later on.

1 Like

Related PR: https://github.com/dresden-elektronik/deconz-rest-plugin/pull/6152