Closed alexf2015 closed 5 years ago
In addition if the binding already provides a value with unit MWh it also causes an error:
2018-12-23 18:23:08.844 [DEBUG] [nternal.handler.SolarEdgeBaseHandler] - Channel is to be updated: aggregate_year#consumption: 2.267 MWh
2018-12-23 18:23:08.862 [ERROR] [me.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 '2.267 MWh'.
java.lang.IllegalStateException: Error invoking #valueOf(String) on class 'org.eclipse.smarthome.core.library.types.QuantityType' with value '2.267 MWh'.
at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:190) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseType(ItemEventFactory.java:158) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.getState(ItemEventFactory.java:136) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.createStateEvent(ItemEventFactory.java:116) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.createEventByType(ItemEventFactory.java:80) ~[?:?]
at org.eclipse.smarthome.core.events.AbstractEventFactory.createEvent(AbstractEventFactory.java:51) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.createESHEvent(EventHandler.java:121) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.handleEvent(EventHandler.java:95) ~[?:?]
at org.eclipse.smarthome.core.internal.events.EventHandler.handleEvent(EventHandler.java:72) ~[?:?]
at org.eclipse.smarthome.core.internal.events.ThreadedEventHandler.lambda$0(ThreadedEventHandler.java:67) ~[?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:181) ~[?:?]
... 10 more
Caused by: java.lang.IllegalArgumentException: MWh not recognized (in 2.267 MWh at index 6)
at tec.uom.se.quantity.Quantities.getQuantity(Quantities.java:80) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.<init>(QuantityType.java:96) ~[?:?]
at org.eclipse.smarthome.core.library.types.QuantityType.valueOf(QuantityType.java:139) ~[?:?]
at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.items.events.ItemEventFactory.parseSimpleClassName(ItemEventFactory.java:181) ~[?:?]
... 10 more
Will push a PR in openhab-core for this
Thanks. I am just a little bit confused why this class exists both in openhab-core and eclipse-smarthome. According to the package name I thought it came from eclipse-smarthome.
See openhab/openhab-core#588
As stated in title conversion to unit MWh is not supported:
Corresponding item: