zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Tuya ZG-204ZL illuminance reported in lux while it's raw

Open dinde opened this issue 3 years ago β€’ 26 comments

What happened?

Just installed a ZG-204ZL motion sensor with luminance sensor. Values reported for illuminance as lux is in fact raw (number can't be that high) image

What did you expect to happen?

illuminance is raw not in lux. As a feature it could be nice to have both values (with a converter directly in z2m but it's manageable thru home assistant as well).

How to reproduce it (minimal and precise)

Just install it

Zigbee2MQTT version

1.32.2

Adapter firmware version

20230507

Adapter

Sonoff ZBDongle-P

Debug log

Will upload if needed/requested

dinde avatar Sep 11 '23 20:09 dinde

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Oct 12 '23 00:10 github-actions[bot]

bump

dinde avatar Oct 12 '23 14:10 dinde

What is the actual calculation?

Crumar avatar Dec 25 '23 06:12 Crumar

any update? ive face the same issue

muktheo avatar Jan 13 '24 01:01 muktheo

Same here. The lux values is much more high than other iluminace sensor in same place.

dtalens avatar Feb 23 '24 10:02 dtalens

Same here. Compared to Eve Motion sensors the Lux values of ZG-204ZL are way too high.

jusicgn avatar Apr 20 '24 18:04 jusicgn

Looks like this one is using illuminance(): https://github.com/Koenkk/zigbee-herdsman-converters/blob/3ec951e4c16310be29cec0473030827fb9a5bc23/src/devices/tuya.ts#L6301 Others use illuminance_lux() https://github.com/Koenkk/zigbee-herdsman-converters/blob/3ec951e4c16310be29cec0473030827fb9a5bc23/src/devices/tuya.ts#L6391 which should go through this conversion: https://github.com/Koenkk/zigbee-herdsman-converters/blob/3ec951e4c16310be29cec0473030827fb9a5bc23/src/converters/fromZigbee.ts#L466


I just tried illuminance_lux in an external converter and it didn't seem to make a difference, still 2500 lux for fairly dim indoor lighting.


Hmm:

[2024-06-08 23:41:32] debug:    z2m: Received Zigbee message from 'motion1', type 'attributeReport', cluster 'msIlluminanceMeasurement', data '{"measuredValue":34059}' from endpoint 1 with groupID 0
[2024-06-08 23:41:32] debug:    z2m: No converter available for 'ZG-204ZL' with cluster 'msIlluminanceMeasurement' and type 'attributeReport' and data '{"measuredValue":34059}'

Math.pow(10, (34059 - 1) / 10000) is 2546 which is what I'm seeing in the UI so it's definitely going through the converter. I have a different sensor that reports 56 lux so it seems like this one needs something like / 20000 instead?


Yeah idk how this works actually, it has the raw value here https://github.com/Koenkk/zigbee2mqtt/blob/0e6da85d195f8696379cc55a1c34e5f495121063/lib/extension/receive.ts#L108 then in herdsman-converters it's an array again, this function https://github.com/Koenkk/zigbee-herdsman-converters/blob/3ec951e4c16310be29cec0473030827fb9a5bc23/src/lib/tuya.ts#L1383 gets [0, 0, 8, 187] and turns it into 2235 with https://github.com/Koenkk/zigbee-herdsman-converters/blob/3ec951e4c16310be29cec0473030827fb9a5bc23/src/lib/tuya.ts#L27

KaelWD avatar Jun 08 '24 12:06 KaelWD

I'm not sure if it's really the RAW value that the ZG-204ZL device delivers. I compared it with my HUE sensor (Philips 9290012607), which displays both the RAW value and the LUX value. I placed both devices right next to each other in the same room for the test. The result was:

Philips

Tuya

knuti1960 avatar Sep 16 '24 10:09 knuti1960

Hi, anything we can do to show the correct value? it’s currently night time over here and the lux values are incorrect.

I have 2 of these devices..try and guess which ones from the screenshot? :D

IMG_1566

rodrigojds avatar Oct 21 '24 22:10 rodrigojds

bump

kpapastamatis avatar Nov 25 '24 17:11 kpapastamatis

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Jan 25 '25 00:01 github-actions[bot]

bump

Scoff123 avatar Jan 25 '25 06:01 Scoff123

You can apply a calibration via the device specific settings, if someone lets me know what calibration value works I can apply that by default.

Koenkk avatar Jan 25 '25 18:01 Koenkk

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Mar 27 '25 00:03 github-actions[bot]

Hi, I just faced the same "problem". I have now placed an Ikea E2134 directly next to the ZG-204ZL and determined the following values:

Image

edit:

I tried to calibrate the ZG to behave like the IKEA one .... I have to set an offset of 97,5 πŸ˜†

Image

Image

engels0n avatar Jun 24 '25 12:06 engels0n

Why has this been closed? I'm having the same issue

danielo515 avatar Aug 09 '25 17:08 danielo515

Same issue here with all my devices. Did anyone fix it?

JinRoh3 avatar Aug 27 '25 06:08 JinRoh3

I have the same problem with two devices.

Sven051968 avatar Aug 27 '25 07:08 Sven051968

bump

cyberdie avatar Aug 29 '25 08:08 cyberdie

bump

shymedq avatar Sep 03 '25 00:09 shymedq