Illuminance in lux or percent?

Hi.
Don’t really know where to put this question, hope I’m in somewhat right region :sunglasses:

I have a light meter Item which have previously been a dimensionless Number. I thought it’d be prettier making it a Number:Illuminance instead. I thought the unit would be Lux (as stated at http://next.openhab.org/docs/concepts/units-of-measurement.html ) but it turns out I get the values in percent. So now when my sensor reports 33 Lux it’s presented as 33 %. Did I do anything wrong somewhere or did anyone else do something wrong?

This isn’t really a big problem now, I’m living in Sweden and last time we saw the sun was over a month ago. But eventually the reading will go over 100 lux which will be strange in the system :stuck_out_tongue:

If the unit of the value your sensor gets you is percent then it is right that and you need to change back to a dimensionless Number.
Or you can apply a transformation on thing level.

I’m not really sure if I understand this answer… The value is in Lux and I want it presented as Lux, which I thought was default for luminance. I can’t really understand where the percent comes from at all?

edit: Haha… Now it got even more strange. The current reading is “2E+1 %”. I think that’s supposed to be 20 Lux :sunglasses:

Where does it say that ? check label in sitemap and metadata for the item, possibly you yourself have defined it.

Both in event log:

2020-12-15 12:52:25.997 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Ljusniva_ute' changed from 2E+1 % to 34 %

and in Main UI:


…and I’m 100% sure I have never put any percentage sign anywhere near the configuration of this Item.

I guess it’s not really a big problem, I can just change it back to being a normal Number. I just think it’s strange…

Where’s the data coming from, what binding is involved? It looks like it’s wrong further up the chain.

It’s from an Aeotec ZW100, through the ZWave Binding. Could it be a problem with the ZWave device database? I can’t seem to reach the online database. @chris, has it moved lately?

On the temperature channel on the same device I have an Item which is Number:Temperature and it gives me correct values in degrees Celsius (just FWIW).

No - not for a few months.

Well, it was more than months since I last tried to look in it :wink: Thanks a lot!

Ok, after checking the database, I can’t find anything about which unit the luminance sensor is supposed to be using. So I still get the feeling the values from it should be interpreted as Lux and nothing else. @chris, you got any input on this?

With this one, you get given the channel type by the binding/database combo, no choices, and must then link that to the matching Item type.
Your little screenshot earlier shows channel type Number:Illuminance which seems correct.

Two things might be wrong;
Most likely you’ve got into a mess linking to incorrect Item type originally, and that’s having a lingering effect. I’d suspect editing an existing Item type will not fix up any associated links.
I’d create a brand new Item of Number:Illuminance type and link to your zwave channel, deleting your old link and then your old Item.

If that does not work, it is possible the binding is not sending the correct Quantity type data - but that seems most unlikely.

Ok, tried that now. The new Item also shows the value as percent. So that boils down to the binding sending the wrong unit? Should I simply file a bug? @chris?

I’ve no real idea what the issue is - can you provide a debug log please? Otherwise it’s hard to know how the sensor is reporting.

Will this do?

2020-12-18 14:12:14.841 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction SendNextMessage 0 out at start. Holdoff false.
2020-12-18 14:12:15.185 [DEBUG] [WaveSerialHandler$ZWaveReceiveThread] - Receive Message = 01 0C 00 04 00 1C 06 31 05 03 0A 00 15 C5
2020-12-18 14:12:15.197 [DEBUG] [nal.protocol.ZWaveTransactionManager] - processReceiveMessage input 0<>128 : Message: class=ApplicationCommandHandler[4], type=Request[0], dest=28, callback=0, payload=00 1C 06 31 05 03 0A 00 15
2020-12-18 14:12:15.207 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Received msg (0): Message: class=ApplicationCommandHandler[4], type=Request[0], dest=28, callback=0, payload=00 1C 06 31 05 03 0A 00 15
2020-12-18 14:12:15.209 [DEBUG] [nal.protocol.ZWaveTransactionManager] - lastTransaction null
2020-12-18 14:12:15.211 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 28: Application Command Request (ALIVE:DONE)
2020-12-18 14:12:15.213 [DEBUG] [ng.zwave.internal.protocol.ZWaveNode] - NODE 28: resetResendCount initComplete=true isDead=false
2020-12-18 14:12:15.215 [DEBUG] [ng.zwave.internal.protocol.ZWaveNode] - NODE 28: Incoming command class COMMAND_CLASS_SENSOR_MULTILEVEL, endpoint 0
2020-12-18 14:12:15.216 [DEBUG] [ng.zwave.internal.protocol.ZWaveNode] - NODE 28: SECURITY not supported
2020-12-18 14:12:15.218 [DEBUG] [tocol.commandclass.ZWaveCommandClass] - NODE 28: Received COMMAND_CLASS_SENSOR_MULTILEVEL V5 SENSOR_MULTILEVEL_REPORT
2020-12-18 14:12:15.220 [DEBUG] [ss.ZWaveMultiLevelSensorCommandClass] - NODE 28: Sensor Type = Luminance(3), Scale = 1
2020-12-18 14:12:15.222 [DEBUG] [ss.ZWaveMultiLevelSensorCommandClass] - NODE 28: Sensor Value = 21
2020-12-18 14:12:15.224 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 28: Got an event from Z-Wave network: ZWaveMultiLevelSensorValueEvent
2020-12-18 14:12:15.226 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 28: Got a value event from Z-Wave network, endpoint=0, command class=COMMAND_CLASS_SENSOR_MULTILEVEL, value=21
2020-12-18 14:12:15.228 [DEBUG] [ding.zwave.handler.ZWaveThingHandler] - NODE 28: Updating channel state zwave:device:15f24d360d4:node28:sensor_luminance to 21 % [QuantityType]
2020-12-18 14:12:15.230 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 28: Commands processed 1.
2020-12-18 14:12:15.232 [DEBUG] [nal.protocol.ZWaveTransactionManager] - NODE 28: Checking command org.openhab.binding.zwave.internal.protocol.ZWaveCommandClassPayload@7d5b6d84.
2020-12-18 14:12:15.234 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction completed - outstandingTransactions 0
2020-12-18 14:12:15.236 [DEBUG] [nal.protocol.ZWaveTransactionManager] - Transaction completed - outstandingTransactions 0
2020-12-18 14:12:15.247 [DEBUG] [nal.protocol.ZWaveTransactionManager] - ZWaveReceiveThread queue empty

That looks like the important bit.

Probably. And also the thing a few lines up about “Sensor Type = Luminance(3), Scale = 1”. I’ve no idea what scale 1 is though, guess it will tell @chris something :slight_smile:

Thanks - that’s fine.

No - not really - the important bit is the decoding of the data…

I’ll make an update later.

1 Like

Yes - this is exactly the “important bit” :slight_smile:

1 Like

I never saw the PR coming so I thought you didn’t fix this yet, but after upgrading to RC2 i just realized that the readings are now in lux. Thanks a lot!

1 Like