Wrong Unit for Iluminance and missing current iluminance in mqtt
What happened?
Since last Update no longer lx instead mv unit for Iluminance with this sensor and current iluminace is not longer published to mqtt https://www.zigbee2mqtt.io/devices/RB-SRAIN01.html#tuya-rb-srain01
What did you expect to happen?
No response
How to reproduce it (minimal and precise)
No response
Zigbee2MQTT version
2.7.1 (unknown)
Adapter firmware version
{"maintrel":120,"majorrel":2,"minorrel":6,"product":0,"revision":"0x26780700","transportrev":0}
Adapter
ConBee2/RaspBee2
Setup
os: #1 SMP PREEMPT Tue Nov 4 14:31:07 UTC 2025 - 6.12.51-haos - arm64
node: v22.16.0
ha: true
Device database.db entry
No response
Debug log
No response
Notes
No response
Same problem here
Also being discussed in https://github.com/Koenkk/zigbee2mqtt/issues/29901
I have the same issue
I have the same issue
Comparison between different devices, one with a problem, the other without. I hope this helps.
I have the same issue
We have 2 options here:
- Remove the
illuminancedevice_class - Compute the illuminance lx value based on the voltage (@dgibbs64 not sure if this makes sense?)
Rain.js Iβve put together a converter with the help of Copilot to restore the old functions.
Rain.js Iβve put together a converter with the help of Copilot to restore the old functions.
I added the original battery refresh button, not sure it works, and I confirmed two pingerprints.
Rain.js Iβve put together a converter with the help of Copilot to restore the old functions.
Where should I put this rain.js file? Thanks
@Koenkk
I think it's probably worth reverting the original lx sensor to not break existing automations. However add a new mV entity that shows the real output in mV. Finally an entity that does a calculated Lx value based on the mV value. This way there is backwards compatibility plus the real sensor reading and a calculated Lx. This should achieve all goals I think giving users multiple ways to use the sensor. Hope that makes sense.
Problem is, current iluminance is not longer published to mqtt, so also a recalculate helper in hoa will not help
We have 2 options here:
- Remove the
illuminancedevice_class- Compute the illuminance lx value based on the voltage (@dgibbs64 not sure if this makes sense?)
It worked until a few days ago. Why did this change happen? Couldn't it just stay the same?
I have the same problem on my TS0207 _TZ3210_tgvtvdoc (Solar rain sensor) device, downgrading to 2.7.0 solves the problem.
@snclab The problem is that the sensor the device is providing not actually a lux sensor is a mV sensor. So your lux readings are completely false (it's just the voltage from the solar panel). For example if the lux was saying 3000 that was not lux but mV. The Lx number would be much higher in reality. I have proposed a workaround above and recomendation that the z2m docs state that the device doesnt actually monitor lux.
I don't particularly care about the accuracy of illumination changes. All the automations that were configured for this sensor broke (I adjusted the values ββto match real-world conditions).
Problem is, current iluminance is not longer published to mqtt
I'm wondering about that, because I've rolled back to 2.7.0-1 and the current illumination is published again.
And under 2.7.1-1 illumination 20min-average and max were published unfortunately in [mV], current illumination was shown too on ZigBee2MQTT-Addon in HA, but in HA-Dashboard as unavailable, as you could see in some postings above.
So for me it isn't a device problem, it is a problem with addon-code-(2.7.1-1)!
Lux (lx) and millivolts (mV) are different physical quantities. There are devices that use different sensors for the same purpose. So it makes no sense to block the use of millivolts (mV) to measure illumination. Just re-enable the functionality as it was before and everyone will be happy.
Problem is, current iluminance is not longer published to mqtt
I'm wondering about that, because I've rolled back to 2.7.0-1 and the current illumination is published again.
And under 2.7.1-1 illumination 20min-average and max were published unfortunately in [mV], current illumination was shown too on ZigBee2MQTT-Addon in HA, but in HA-Dashboard as unavailable, as you could see in some postings above.
So for me it isn't a device problem, it is a problem with addon-code-(2.7.1-1)!
How did you roll back to the older version?