Your problems have nothing to do with the rule examples this thread is about.
This line, as a “global” definition -
populates your CurrentTime variable with a value only once, at rules file load time.
So far as I can see, you never update it, so yes it will stay the same.
This behaviour has not changed since OH2.
Wouldn’t you be interested in “now” at the time the rule runs?
When you’re ready, you might show us those.
I don’t know what your Zwave problems are about, but not related to this rule.
That metadata doesn’t look wrong but it’s hard to tell by just looking at the JSON like that.
If the metadata is present but not well formed then the rule will complain about that.
You can see which Items are being considered by the rule by turning up the logging to DEBUG when it runs. It will list all the Items it’s using for the day.
If you don’t get any errors and you don’t see your Item in the debug logs then for some reason the rule doesn’t see that Item at all. If you see errors then the error should tell you what’s wrong.
I’m trying to get the javascript version running on my OH3.1 system. But when executing the script imported from ephemTimeOfDay.yml io get this error in openhab.log:
2021-07-18 11:23:15.674 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID '1d2a859923' failed: org.graalvm.polyglot.PolyglotException: ReferenceError: "scriptExtension" is not defined
I cleaned /etc/openhab/automation before installing all files mentioned in the README.md at:
It appears that if you’ve installed the GraalVM JavaScript addon it replaces the default one. In other words, you can’t. If you do not plan on using the GraalVM JavaScript, don’t install it. If you do plan on using it you’ll have to rewrite the rule above to work with that.
You’ve also installed Jython and Groovy too. Do you have plans to use those? If not don’t install them. The more stuff you have installed the more opportunities there are for problems. Only install add-ons (and software for that matter) you intend to use. Don’t install stuff “just in case”.
Logging debug-info worked and one “Time of day”-item was indeed missing. Instead of messing about with metadata in the API-explorer, I just created the item again with info from your github. Now it works fine. Thanks