Group shows value as UNDEF

Tags: #<Tag:0x00007fc91d789108> #<Tag:0x00007fc91d786318>

I’m just getting started with OH(3); I’ve been using OH1/2 for years.
I have defined a Group as Measurement, Light, Number:Luminousintesity with MAX for aggregation. It has a member Item of Measurement, Light, Number:luminousIntensity; The item is showing a value and is being graphed as a number. The Group just shows as UNDEF. I had tried with two member items of number type, that also produces a UNDEF aggregation.
I’m hoping someone can point me in the right direction!

With no aggregation, Group state is NULL.
Seeing UNDEF is therefore a step forward! It’s tried but failed to update.
Typically you’ll see this where it’s trying to perform nonsense - getting MAX of a String type member, for example, or trying to put a COUNT result into a String type Group.
In the first instance, I would carefully check Group type and your sole member Item type, and check there are no unexpected members. Look at the Item’s JSON code with API explorer, in case the UI is hiding stuff.

There have been problems with parsing Quantity type Group definiions, closely connected to exactly how/where you define them. Could you share?

You bet!
This is from the events.log for tha item:
mqtt:broker:broker3:basementLightLevel triggered 100.0
This is a screen clip of the item (let me know if there’s another way of sharing the definition, I’ve been using the UI rather than files to try and make the switch to OH3 from OH1/2):

That’s an event channel, it’s not an Item state.
Group aggregations work with Item states.

Your screenshot shows an Item linked to a different channel.
The Item is a Quantity type, Number:Luminousintesity,but it’s state appears to have no units.
I think that will blow up an aggregation attempting to work with units, which an aggregation on a Quantity type Group should do. (Is that 100 lux? 100 millicandles? … UNDEFined)

So you need to explore why your Item has no units.
MQTT binding generic Things supply no units by default.

@rossko57 I’m afraid I’m missing what you mean. I have (I think) a group item that should find the MAX value of a group of items (in this case just one item); the items have a state of a number. The numbers have no units but I’m not understanding why the absence of units would cause a problem for finding the MAX or SUM,…
I’ve tried adding a “pattern” of “%d Lux” using metadata, but it didn’t change the group MAX from UNDEF.
I appreciate your help, I hope I can understand soon.
(In OH2 the Group MAX MIN, AVG,… works for those item(s))

Because you’ve told openHAB that there should be units. You selected Number:LuminousIntensity.
Because you cannot compare undimensioned numbers to quantities (with units), functions like MAX will not work.

Example; for a Number:Power Group let’s get …
MAX of two Item states 1W and 100mW
Answer - 1W because MAX is aware of units.
Now let’s get …
MAX of two Item states 1W and 100
Answer - 1W because 100 is meaningless here without units
Now let’s get …
MAX of one Item state 100
Answer - UNDEF because 100 is still meaningless here without units

If you don’t intend to provide these numbers with units, don’t use Number:LuminousIntensity, they’re just Numbers.

What did it do to the state of the Item? MAX doesn’t care about any of your Item’s properties except the actual state.

Note that Lux is not a valid unit for openHAB, instead it uses the SI symbol lx.
I’m not sure it’s even an appropriate unit for LuminousIntensity, I think its about different quantity Illuminance, but I don’t understand how these relate.


That was the solution! I’ve changed both the Group and Item to Number and all is good.

Thanks for your help! I’ll continue to work my way through the learning curve :slightly_smiling_face:

It didn’t seem to affect the state of the item; the item still showed as a number and was being graphed.