jewesta
(Jens W.)
April 29, 2020, 9:58pm
1
Hi everyone,
there is a group in my setup called “TV” that appears to have an ON/OFF value. In other words it acts as if an aggregation function were defined, but there isn’t. Screenshots from Visual Studio Code. Mouse hovering over group item to show current state:
If I rename the group to “TV2”, the phantom ON/OFF value is gone. If I rename it back to “TV”, it’s back to its broken state.
I had been wondering about frequent IllegalArgumentExceptions in openhab.log. Like this one:
2020-04-29 22:19:07.362 [ERROR] [me.core.internal.events.EventHandler] - Dispatching/filtering event for subscriber 'org.eclipse.smarthome.core.events.EventSubscriber' failed: Can not compare incompatible units.
java.lang.IllegalArgumentException: Can not compare incompatible units.
at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:174) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.applyState(GenericItem.java:234) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.setState(GenericItem.java:219) ~[?:?]
at org.eclipse.smarthome.core.library.items.NumberItem.setState(NumberItem.java:121) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemUpdater.receiveUpdate(ItemUpdater.java:75) ~[?:?]
at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:52) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.lambda$0(EventHandler.java:155) ~[?:?]
I always thought that some rogue rule was causing them because they are a bit unspecific. Only recently I noticed the broken group and that it was the cause of the exceptions. Now, the obvious “solution” is to just not name the group “TV”. Still, it doesn’t feel right to just leave this alone as there is some broken state persisted somewhere.
So my question is: Does anyone have any idea how I can get rid of this group?
Thank!
Jens
Hardware: mac Mini 2012
OS: macOS Catalina
openHAB 2.5.4 (Has been going on for quite a few versions now. Unfortunately cannot remember since when.)
rossko57
(Rossko57)
April 30, 2020, 12:34am
2
I’ve recently learnt that there is a default aggregation, see github below.
Unrelatedly, I was tinkering with Group commands recently, to show a virgin Group would not accept commands. , I then gave a flavour to it, e.g. Group:Dimmer, and commands worked, hurrah.
But editing back to just Group with no flavour … commands still worked, and this survived reboot. I didn’t dig further but it suggests Group details are getting preserved in the JSONDB somewhere.
I would suggest deleting your problem Group, stopping OH and searching the JSONDB for it. I’m guessing the lack of type/flavour for your TV2 Group may be as relevant as lack of declared aggregation.
You’ll be interested in this, relating to Groups
opened 04:40PM - 21 Feb 20 UTC
closed 05:54PM - 08 Apr 20 UTC
bug
UoM
OH 2.5.1-2
x2 Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
128GB RAM
I have be… en intermittently seeing a warning in the log for a while and finally did some investigation. It can be reproduced with the following Items, which mimick what I have in production:
```
Group gTest_Group "Test Group" <none>
Number:Illuminance Test_Luminance "Test Luminance [%.0f lx]" <sun> (gTest_Group)
Number:Intensity Test_SolarRadiation "Test Solar Radiation [%.0f W/m²]" <sun> (gTest_Group)
```
I then slammed the system with this Jython script, although not all runs produced errors:
```
from core.log import logging, LOG_PREFIX#, log_traceback
LOG = logging.getLogger("{}.TEST_2".format(LOG_PREFIX))
for index in range(1, 100001):
events.postUpdate("Test_Luminance", str(index))
events.postUpdate("Test_SolarRadiation", str(index))
LOG.warn("{}, {}, {}".format(items["gTest_Group"], items["Test_Luminance"], items["Test_SolarRadiation"]))
```
Over the course of testing this a few times with different numbers of iterations, this produced the folliowing. Note the time breaks. Lower numbers of iterations did not always produce an error. My production system has a cron rule that runs every 3 minutes updating Items in a group and I see the warning in the log maybe once a day or more. Running the same test with non-UoM Items does not produce the errors, so they appear to have something to do with the default group state aggregator (Equals) when there are group members with states that are QuantityType.
```
2020-02-21 10:40:36.652 [WARN ] [org.eclipse.smarthome.core.items.GenericItem] - failed notifying listener 'org.eclipse.smarthome.model.rule.runtime.internal.engine.RuleEngineImpl@12783c01' about state update of item Test_SolarRadiation: Can not compare incompatible units.
java.lang.IllegalArgumentException: Can not compare incompatible units.
at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:174) ~[bundleFile:?]
at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[bundleFile:?]
at org.eclipse.smarthome.core.items.GenericItem$1.run(GenericItem.java:260) [bundleFile:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2020-02-21 10:58:25.806 [ERROR] [org.eclipse.smarthome.core.internal.events.EventHandler] - Dispatching/filtering event for subscriber 'org.eclipse.smarthome.core.events.EventSubscriber' failed: Unable to convert to system unit during compare.
java.lang.IllegalArgumentException: Unable to convert to system unit during compare.
at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:171) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.applyState(GenericItem.java:234) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.setState(GenericItem.java:219) ~[?:?]
at org.eclipse.smarthome.core.library.items.NumberItem.setState(NumberItem.java:121) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemUpdater.receiveUpdate(ItemUpdater.java:75) ~[?:?]
at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:52) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.lambda$0(EventHandler.java:155) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2020-02-21 10:58:27.891 [ERROR] [org.eclipse.smarthome.core.internal.events.EventHandler] - Dispatching/filtering event for subscriber 'org.eclipse.smarthome.core.events.EventSubscriber' failed: Unable to convert to system unit during compare.
java.lang.IllegalArgumentException: Unable to convert to system unit during compare.
at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:171) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.applyState(GenericItem.java:234) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.setState(GenericItem.java:219) ~[?:?]
at org.eclipse.smarthome.core.library.items.NumberItem.setState(NumberItem.java:121) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemUpdater.receiveUpdate(ItemUpdater.java:75) ~[?:?]
at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:52) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.lambda$0(EventHandler.java:155) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2020-02-21 11:00:18.403 [ERROR] [org.eclipse.smarthome.core.internal.events.EventHandler] - Dispatching/filtering event for subscriber 'org.eclipse.smarthome.core.events.EventSubscriber' failed: Unable to convert to system unit during compare.
java.lang.IllegalArgumentException: Unable to convert to system unit during compare.
at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:171) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.applyState(GenericItem.java:234) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.setState(GenericItem.java:219) ~[?:?]
at org.eclipse.smarthome.core.library.items.NumberItem.setState(NumberItem.java:121) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemUpdater.receiveUpdate(ItemUpdater.java:75) ~[?:?]
at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:52) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.lambda$0(EventHandler.java:155) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2020-02-21 11:00:21.032 [ERROR] [org.eclipse.smarthome.core.internal.events.EventHandler] - Dispatching/filtering event for subscriber 'org.eclipse.smarthome.core.events.EventSubscriber' failed: Unable to convert to system unit during compare.
java.lang.IllegalArgumentException: Unable to convert to system unit during compare.
at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:171) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.applyState(GenericItem.java:234) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.setState(GenericItem.java:219) ~[?:?]
at org.eclipse.smarthome.core.library.items.NumberItem.setState(NumberItem.java:121) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemUpdater.receiveUpdate(ItemUpdater.java:75) ~[?:?]
at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:52) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.lambda$0(EventHandler.java:155) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2020-02-21 11:00:23.089 [ERROR] [org.eclipse.smarthome.core.internal.events.EventHandler] - Dispatching/filtering event for subscriber 'org.eclipse.smarthome.core.events.EventSubscriber' failed: Can not compare incompatible units.
java.lang.IllegalArgumentException: Can not compare incompatible units.
at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:174) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.applyState(GenericItem.java:234) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.setState(GenericItem.java:219) ~[?:?]
at org.eclipse.smarthome.core.library.items.NumberItem.setState(NumberItem.java:121) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemUpdater.receiveUpdate(ItemUpdater.java:75) ~[?:?]
at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:52) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.lambda$0(EventHandler.java:155) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
2020-02-21 11:00:23.093 [ERROR] [org.eclipse.smarthome.core.internal.events.EventHandler] - Creation of ESH-Event failed, because one of the registered event factories has thrown an exception: Error invoking #valueOf(String) on class 'org.eclipse.smarthome.core.library.types.QuantityType' with value '64620.0 1/(m²·m²)'.
java.lang.IllegalStateException: Error invoking #valueOf(String) on class 'org.eclipse.smarthome.core.library.types.QuantityType' with value '64620.0 1/(m²·m²)'.
at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:189) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseType(ItemEventFactory.java:157) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.getState(ItemEventFactory.java:135) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.createStateChangedEvent(ItemEventFactory.java:130) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.createEventByType(ItemEventFactory.java:83) ~[?:?]
at org.eclipse.smarthome.core.events.AbstractEventFactory.createEvent(AbstractEventFactory.java:55) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.createESHEvent(EventHandler.java:134) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.handleEvent(EventHandler.java:108) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.handleEvent(EventHandler.java:85) ~[?:?]
at org.eclipse.smarthome.core.internal.events.ThreadedEventHandler.lambda$0(ThreadedEventHandler.java:67) ~[?:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:180) ~[?:?]
... 10 more
Caused by: java.lang.IllegalArgumentException: unexpected token 8
at tec.uom.se.quantity.Quantities.getQuantity(Quantities.java:80) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.<init>(QuantityType.java:95) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.valueOf(QuantityType.java:138) ~[?:?]
at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:180) ~[?:?]
... 10 more
2020-02-21 11:00:23.587 [ERROR] [org.eclipse.smarthome.core.internal.events.EventHandler] - Dispatching/filtering event for subscriber 'org.eclipse.smarthome.core.events.EventSubscriber' failed: Unable to convert to system unit during compare.
java.lang.IllegalArgumentException: Unable to convert to system unit during compare.
at org.eclipse.smarthome.core.library.types.QuantityType.compareTo(QuantityType.java:171) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.equals(QuantityType.java:156) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.applyState(GenericItem.java:234) ~[?:?]
at org.eclipse.smarthome.core.items.GenericItem.setState(GenericItem.java:219) ~[?:?]
at org.eclipse.smarthome.core.library.items.NumberItem.setState(NumberItem.java:121) ~[?:?]
at org.eclipse.smarthome.core.internal.items.ItemUpdater.receiveUpdate(ItemUpdater.java:75) ~[?:?]
at org.eclipse.smarthome.core.items.events.AbstractItemEventSubscriber.receive(AbstractItemEventSubscriber.java:52) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.lambda$0(EventHandler.java:155) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_232]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
```