Blocky Rules with Datetime creating exeption

On startup, I want to set my alarm clock to 7:00:00 on that day. Sure, I could use persistence. But I decided on OH3 for this code. On OH4 I seem to get a exception:

2023-09-02 21:27:02.291 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'cc36c55e08' failed: org.graalvm.polyglot.PolyglotException: SyntaxError: <eval>:51:43 Expected an operand but found .
  neu =;
<eval>:62:0 Expected eof but found }

This is the blocky generated code:

var default_alarm_clock;

default_alarm_clock =;

  • Platform information:
    • Hardware: RPI4
    • OS: Linux
    • Java Runtime Environment: openJDK-17
    • openHAB version: 4.0.2

Did you create the original with the earlier DateTime marketplace library blocks, as opposed to the new Date Time blocks in the base UI? I had some rules that had problems like you are describing and when I replaced the old blocks with the new ones, everything worked.

Try like this without the variable

1 Like

And here’s how you use this block type that @Rolli has mentioned:

Thanks! I changed to the new code, all fine now.