openHAB 4.0 SNAPSHOT discussion

The refactored component is part of both channel-add and channel-edit, so I think yes that affects this as well.

It seems to not affect channel configuration. I have updated the issue with more information.

1 Like

This question is actually not answered. :slight_smile: I hope Iā€™m not making a fuss if this only happens for me. Does anyone else see this problem?

I can confirm that I can see the same issue on the latest snapshot.

Please see latest comments from @wborn in the issue. Maybe not to be considered a blocker?

I think I can provide a fix soon, so please wait a bit.

3 Likes

I searched in this thread for jruby and didnā€™t see anything, sorry if I missed it
Upgrade OH3 to OH4 and everything seems fine except jruby rules throwing an error

==> /var/log/openhab/events.log <==
2023-03-11 15:38:31.449 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'OutsideLuxNum' changed from 3065.515869140625 to 3108.8778076171875

==> /var/log/openhab/openhab.log <==
2023-03-11 15:38:31.455 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'AmbientLightDimmer' failed: Error during evaluation of Ruby in org/jruby/RubyModule.java at line 4311: (NameError) uninitialized constant OutsideLuxNum

here is another

2023-03-11 15:38:32.401 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Sun_Elevation' changed from 36.37246644373223 Ā° to 35.38033239923391 Ā°

==> /var/log/openhab/openhab.log <==
2023-03-11 15:38:32.413 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'SunAngle' failed: Error during evaluation of Ruby in <script> at line 1: (NameError) undefined local variable or method `logger' for main:Object

a restart of openHAB didnā€™t help
Do I need to update my gem or something?
Bit of a ruby noob

The 5.0 version of the jRuby helper library was announced last week and there is ongoing changes which have moved the library into the openHAB project now and have it be included in the add-on same as how the JS Scripting add-on and library works.

1 Like

This seems like the helper library didnā€™t load at all.

There are two current issues on 4.0M1 (and snapshot up to build #3363 that Iā€™ve tested)

  1. Thereā€™s an important PR that didnā€™t get merged before M1 release. This PR sets the default gem and require, and it is useful (not critical) for new users. It doesnā€™t affect you if youā€™ve already installed jrubyscripting addon previously. You wouldā€™ve had to set the gem settings in the past, thus overriding the default value anyway.
  2. There is a current active bug (I think it lies in core) causing a race condition in the script file watcher, affecting the jrubyscripting addon. Iā€™ve submitted a PR to fix it.

Because of this, Iā€™d suggest going back to 3.4.2 or wait for an openhab-snapshot version once problem #2 above is fixed.

1 Like

If I did so I have no idea what I sent them to or what they should be. So you are saying jruby is broken in OH4? with no work around?

On another note my Hue bridge had to be set to HTTP instead of HTTPS which I guess it defaulted itself to on upgrade

The settings are documented in the installation instructions for the relevant helper libraries:
For openhab-scripting 4.x and openhab-scripting 5.x.

Currently, yes the addon is broken. It loads intermittently due to the race condition. If it does load, it would work. Either version of the helper library should work. Iā€™ve just discovered my PR to fix #2 above didnā€™t quite solve the problem. Still debugging it right now. Iā€™ll let you know here once itā€™s fixed.

1 Like

@Andrew_Rowe please uninstall the built in jrubyscripting addon from OH4 and drop this jar into your addons folder: Release jrubyscripting-oh4.0-0.0.1: [lcn] Add shutter positioning/angle, operating hours counters, tunablā€¦ Ā· jimtng/openhab-addons Ā· GitHub

Then if you still encounter the same error message, please open a separate topic to track it and tag me on it.

1 Like

Is there already an option to upgrade using openHABian??

you can try to switch to snapshots. Let me know if that works.

I may not see the point. But as 4.0.0 M1 is released it would be enough to switch to testing releases to install the milestone, woudnā€™t it ?

But JSONPath Transformation is still available in OH4.x, right? Just JS (Java Script) is replaced.

I think, thatā€™s what also @mstormi meant :wink:
If JSONPath Transformation is still available on OH4, I might give it a try.

Yes, JSONPATH is still available. The removal is due to the more generic Script Transformation Service. You can still use JS, but you have to change the call (i.e. set SCRIPT instead of JS, change extension to .script, set js option for the called Script)
SCRIPT can use any rule language which is supported by openHAB (as far as I know), so itā€™s only a breaking change, but not a go-away.

1 Like

Does anyone know why the SCRIPT transformation was designed to use .script? Is there a reason not to use myscript.js, myscript.rb, myscript.rules?

Yes. Because all transformations use the name of the transformation service as file extension.

1 Like