openHAB 4.0 SNAPSHOT discussion

I’m currently working on improving the script file watcher to solve the Nashorn missing issue.

3 Likes

Is there a roadmap for 4.0 anywhere?
Great work btw, I jumped into OpenHAB at v3 and it’s been super stable and seems to be having a lot of work done towards making things easier for the end user.

This is about as close as we get to a roadmap.

1 Like

FYI, @florian-h05 and I are already working on migrating blockly to jsscripting (based on graalsvm):

see Migrate Blockly to JS Scripting (GraalJS) · Issue #1597 · openhab/openhab-webui · GitHub

The current state is already pretty far and blockly already supports Nashorn and graalsvm at the same time and will even gracefully provide some new blocks on jsscripting only that can’t be easily done on Nashorn.

See the discussion on how we intend to provide the migration path because it does not only affect blockly but also all handwritten rules. We are also currently discussing how we want to address the migration.

1 Like

Same here, but as @J-N-K states it is already under investigation.

is there also a wishlist for openhab 4.0?

edit: created this post Openhab 4.0 wishlist

No, there is none :wink:
But feel free to open a new topic with your feature request.

The closest would be an issue in the appropriate repo on GitHub.

Just to add a little update on the application/javascript could not be found, if you have a Nashorn script triggered with a system start level trigger, it won’t trigger during startup and you’ll have to run it manually. I’m sure Nashorn isn’t becoming available until too late in the run levels to trigger the rule.

Of course I’m going to be converting my rules and rule templates to be JS Scripting based, but I’m leaving them for now to proved a better test environment and help out where I can.

The problem with the start level triggers is not exactly the same, but related.
The start level problem with all automation addons is because they start at level 80, and for file based scripts it can happen that they are loaded even after start level 100 has been reached.

See JSR223 scripts and start levels · Issue #3199 · openhab/openhab-core · GitHub.

True for file based rules, but these are all UI rules.

What appears to be happening is the rule is loaded prior to Nashorn being available so the rule is disabled. A little later on in the startup process Nashorn becomes available and the rule is enabled but the start level the rule should have been triggered by has already passed (in this case it’s start level 20) so it doesn’t trigger.

Since they are not file based I think that issue doesn’t apply in this case.

It’s not a really big deal for now and it’s clearly going to be fixed. I just wanted to make it clear that my specific problem is in the UI for other early adopters. :slight_smile:

1 Like

This is now fixed.

1 Like

Hi,
Well, found this post after wondering why my OpenHAB went t!ts up.
I managed to upgrade my OpenJDK from 11 to 17 and partially fixed it.
I’m now hitting the issue that the JS transform is gone and to use “SCRIPT”
Sorry, but what???
The only documentation I’ve found is this “Transformations | openHAB” which doesn’t even make sense.

What do I need to actually do to get this working again?

This is one of the errors I’m now getting:

2022-12-23 20:13:54.414 [WARN ] [t.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: Invalid path '$.DS18B20-2.Temperature' in '{"Time":"1970-03-03T22:54:15+00:00","Switch1":"OFF","Switch2":"OFF","Switch3":"OFF","DS18B20-1":{"Id":"3C01B556F54F","Temperature":0.3},"BME280":{"Temperature":19.4,"Humidity":47.9,"DewPoint":8.0,"Pressure":976.2},"BH1750":{"Illuminance":0},"PressureUnit":"hPa","TempUnit":"C"}'

Is there an add-on/binding or something else that I need to install to get the JS transform to work?

Thanks,
Richie

First of all: OH4 is in a very early stage there will be more breaking changes and since we there are some fundamental changes (Java 17, Karaf 4.4 and some larger refactorings - not all of that is completed yet) snapshots are expected to be unstable. In general it is NEVER recommended to use snapshots in a production environment.

Regarding your issues:

  • JS transformation is not any will not be available in OH4 because it depends on Nashorn. The SCRIPT transformation should do everything you need regarding transformations. What is your issue there? Please note that the associated profile is not available at the moment.
  • Your error go is not related to the JS transformation but the JSONPath transformation. This is a different add-on. That aside: The input JSON does not contain an element for the key DS18B20-2, so the transformation fails. Check if you picked the correct transformation for that channel (DS18B20-1 is present). If this doesn’t help, please open a separate thread, this has nothing to do with OH4.

BTW: “Sorry, but what??? … .which doesn’t even make sense” is quite rude.

Hi,
Yeah, I appreciate it is in early stages, but I’ve been using the snapshots to ensure I get some of the newer fixes, as opposed to the latest stable/milestone releases.
I think i’ve got the JS Transform and JSON transform confused - I presume the JSON Transform is still in use?
I didn’t intend for it to come across as “rude” - I think my confusion of JS and JSON transform made it not make sense to me :frowning: Sorry
On further investigation it turned out that one of my Tasmota devices was misbehaving - rebooted it to resolve the JSONPATH error.

Thanks,
Richie

Yes.

When using the snapshots there is no guarantee that they will work from day to day. You must always be willing to spend some time investigating when things go wrong (and filing issues where appropriate) and backing out an upgrade as necessary. This is always true but even more so when OH switches to a new major release (i.e. from 3.x to 4.x). The snapshots are going to be a bit rough over the next few months and there will be breaking changes along the way.

Hi,
Thanks for replying.
I think I’d not been expecting a 4.0 release (I’ve not had a lot of time recently to focus on the community).
My own fault for just thinking there’d be a latest 3.4 snapshot that wouldn’t have major changes.
I’ve got it installed and working now, but will be a bit more careful before installing the next few.

Thanks,
Richie

FYI: If you want to use the SCRIPT Transformation with JS, the docs are here: GitHub - openhab/openhab-js: openHAB JavaScript Library for JavaScript Scripting Automation.

I wonder why they aren’t on the openHAB Addons website, seems like we are missing docs updates for the 3.4.0 release @Confectrician.

23 posts were split to a new topic: OH4 on buster

It comes from add-ons. dbquery, influxdb and watsonstt declare a dependency to 2.8.x. This should be fixed in add-ons (preferably by using the one provided from core).

1 Like