First of all, I would like to say that I’m very impressed about OH3.
Actually I’m trying to migrate my OH2 instance, but I have some problems with the sitemap validator.
I’m using unicode charactors to display some icons in Basic-UI, but the validator don’t like them:
There is another problem with the sitemap validator:
If I define a selection with mapping in the code view and then switch to design view and back the quotes get lost and the result is an validation error.
Before I go file a bug, is there any reason isNumeric() is no longer working?
2020-11-12 22:00:33.993 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'roku-4' failed: 'isNumeric' is not a member of 'java.lang.String'; line 170, column 16, length 67 in roku
caused by:
receivedCommand.split("_").get(1).isNumeric()
I’ve tried other variants by adding .toString() to force (what should already be a string) to be recognized as a string and it has no impact. The purpose of this check is to see if the string that was sent is a number (in this case, an app ID for a roku).
Has that ever worked? isNumeric is not a method on java.lang.String for neither Java 8 nor Java 11 and you are working with a java.lang.String. Are you using Jython perhaps?
It’s worked fine on OH2. It’s been part of my Roku rules for several years now. All rules DSL, nothing fancy. I use zulu for my java backend so maybe it was pulled out between zulu8 and zulu11?
I open an issue on this, but posting here in case anyone knows of a fix.
I inadvertently while using the rest api explorer sent a malformed request to add an item OH. Everytime I start openHAB I receive an error and rules, items and other elements are not loaded.
2020-11-13 11:10:35.608 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add "SwitchItem" with key "API Switch": The specified name of the item 'API Switch' is not valid!
java.lang.IllegalArgumentException: The specified name of the item 'API Switch' is not valid!
at org.openhab.core.items.ItemUtil.assertValidItemName(ItemUtil.java:79) ~[bundleFile:?]
at org.openhab.core.internal.items.ItemRegistryImpl.initializeItem(ItemRegistryImpl.java:183) ~[bundleFile:?]
at org.openhab.core.internal.items.ItemRegistryImpl.onAddElement(ItemRegistryImpl.java:232) ~[bundleFile:?]
at org.openhab.core.internal.items.ItemRegistryImpl.onAddElement(ItemRegistryImpl.java:1) ~[bundleFile:?]
It appears the request to add the item is persisted somewhere (maybe by the karaf framework?) but I can’t seem to find where to clear it out. Does anyone know how to clear out pending elements without a reinstall? I have already cleared the cache.
Any suggestion on how to import isNumeric() back into the rules DSL for use? I’ve tried just importing org.apache.commons.lang.StringUtils at the top but I can’t seem to get the syntax for StringUtils working correctly.
That would have worked had you used “32” instead of “32.7”. It very literally only looks for 0-9 as the only characters, the decimal point caused it to fail.
I really like where Openhab is going with these releases! Some quirks that I have observed so far:
time to boot openhab up is significantly longer than it was with openhab 2 (now ~5 minutes, before ~30 seconds)
overall a tad less snappy than OH2, especially latency between physical interaction and reaction of the system
sometimes most of my rules just stop working. Right now I can’t make them work anymore, but since its in the middle of the night now I give up
All rules have been imported from OH2 rules files.
Relevant Log entries (interesting: Caused by: java.lang.IllegalStateException: Cannot create a duplicate value ‘newState’.):
[ERROR] [e.automation.internal.RuleEngineImpl] - Failed to execute rule ‘licht-2’: Fail to execute action: script
[DEBUG] [e.automation.internal.RuleEngineImpl] -
java.lang.RuntimeException: Fail to execute action: script
at org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1187) ~[bundleFile:?]
at org.openhab.core.automation.internal.RuleEngineImpl.runRule(RuleEngineImpl.java:987) [bundleFile:?]
at org.openhab.core.automation.internal.TriggerHandlerCallbackImpl$TriggerData.run(TriggerHandlerCallbackImpl.java:91) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.IllegalStateException: Cannot create a duplicate value ‘newState’.
at org.eclipse.xtext.xbase.interpreter.impl.DefaultEvaluationContext.newValue(DefaultEvaluationContext.java:46) ~[?:?]
at org.openhab.core.model.script.runtime.internal.engine.DSLScriptEngine.createEvaluationContext(DSLScriptEngine.java:143) ~[?:?]
at org.openhab.core.model.script.runtime.internal.engine.DSLScriptEngine.eval(DSLScriptEngine.java:118) ~[?:?]
at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.lambda$0(ScriptActionHandler.java:62) ~[?:?]
at java.util.Optional.ifPresent(Optional.java:183) ~[?:?]
at org.openhab.core.automation.module.script.internal.handler.ScriptActionHandler.execute(ScriptActionHandler.java:59) ~[?:?]
at org.openhab.core.automation.internal.RuleEngineImpl.executeActions(RuleEngineImpl.java:1179) ~[bundleFile:?]
… 7 more