openHAB 3.0 Milestone 2 discussion

From the main rules page that lists all the rules, click on “Select” at the upper right corner, select the rule(s) you want to delete and click “delete” at the bottom of the screen.

1 Like

I saw this is inconsistent with things and opened an issue to address this, you know :wink:

i cant add fmiweather as thing

i get this error:

and i only have these items in my oh3 installation:

You’re probably trying to add another Thing with the UID fmiweather:forecast when one with that UID apparently already exists, that’s why you get a HTTP 409 Conflict error.

I’m in the process of converting my script based rules over to the NGRE. I have one rule that triggers a morning routine on workdays. In the script I use !Ephemeris.isBankHoliday() to not trigger on public holidays.

With the NGRE, under But only if, I only have a choice of it is a weekday or it is a holiday. Looking in the code, it is a weekday is implemented as !ephemerisManager.isWeekend(target). Digging further, this is resolved as isInDayset(CONFIG_DAYSET_WEEKEND, date);. So this would return true for a weekday that is a holiday.

It looks like there is no way to define a schedule rule that triggers on weekdays that are not holidays in NGRE.

Anything that can be done in code can be done through the UI too. If there isn’t an option to choose the specific Ephemeris condition in the drop down list, choose “a given script evaluates to true” and write the condition in code. If you are using JavaScript see openHAB 3.0 my getting started notes: Rules and I’ve an example for how to call Ephemeris Actions. Just call the isBankHoliday().

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:

Switch item=LG_TV0_KeyDummyArrow mappings=[0="\u2190", 1="\u2193", 2="\u2191", 3="\u2192"]

Is unicode not longer supported? Or is there another way to define it?

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.

Code: Selection item=LG_TV0_Application mappings=["com.webos.app.livetv"="TV", "com.webos.app.tvguide"="TV Guide"]

After switch: Selection item=LG_TV0_Application mappings=[com.webos.app.livetv="TV",com.webos.app.tvguide="TV Guide"]

Did you actually use smart quotes or just forget the code fences here? :wink:

Sorry I forgot the code fences

1 Like

I thought it best to check because I would expect smart quotes to break things.

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).

i only have added 4 things, these 4 in the second picture, so there is no thing with the same name :confused:

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?

To my amazement, it does not explode in OH2.5 / Oracle Java 8
but neither does it seem to work

var xx = "32.7"
var yy = xx.isNumeric()
logInfo("test", " yy is " + yy.toString)
2020-11-13 00:16:20.782 [INFO ] [.eclipse.smarthome.model.script.test] -  yy is false
1 Like

Removed in OH3

1 Like

Just counting down to M3 where I can finally use OH3 with expire binding

3 Likes

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.

Can you delete the Item with API Explorer?

It is likely stores in the JsonDb. It should be editable with OH shut down, I believe.