the errors in the logs have changed. It does appear the helper library is now loading.
I’m seeing this on start up
==> /var/log/openhab/openhab.log <==
2023-03-12 09:33:00.398 [WARN ] [ort.loader.AbstractScriptFileWatcher] - Failed to unload script '/etc/openhab/automation/ruby/.gem/9.4.2.0/bundler.lock': script reference not found.
the file referred to in the error message does NOT appear to exist in that location
And the typical error when a jruby automation runs is now this
==> /var/log/openhab/openhab.log <==
2023-03-12 09:38:00.745 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'AmbientLightDimmer' failed: Error during evaluation of Ruby in uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/delegate.rb at line 91: (NoMethodError) undefined method `to_i' for #<OpenHAB::Core::Items::Proxy:0x2a71c5c0>
This is a harmless warning. It will be silenced in the future build.
You might now be using version 5 of the helper library? If that’s the case, please read through the changelog for 5.0.0 carefully.
Specifically, items are not treated as state anymore. So if you meant to refer to its state / value, you need to write ItemName.state instead of ItemName.
You can still use the predicate methods on the item such as ItemName.on?
Mostly affected things like dimmer where you want to check the actual value, so change MyDimmer > 50 to MyDimmer.state > 50
There are other changes too so please read through. Timers also changed a bit especially timers with id.
BINGO!!!
error message is gone, rule runs
so… snapshot seems to have cured your race condition!
ok… where is the face palm emoji?
I actually do remember reading this in the jruby thread and just got reckless with the upgrade for the purpose of testing, big thank you Jim for helping
BTW
Great job to all the developers and folks who have done an amazing job on OH4
The speed which Java 17 has been integrated and all the refinements since the early version I had been running are amazing
JRuby now has the simplest (yet probably the most powerful and succinct) syntax for script transformation.
You could do this inline transformation for a temperature item (which can of course be implemented as a file-based transformation for better code clarity). Just to show off what Ruby can do in “one line” of code.