All of my rule templates have been rewritten for OH 4. Remove the old template under Settings → Automation, reload the page (just in case) and re add the template. Then create a new version of the rule using the new template.
Manually trigger it at least once and watch the logs. It will check all your Items and verify that everything is configured correctly. The same Items and Item metadata will work with the new template.
The specific problem is that the 3.4 rule template was written in Nashorn JS which used application/javascript
as the language type. But in OH 4, GraalVM JS now uses application/javascript
and that code is not compatible with GraalVM JS.
There is one other snag, you’ll have to install Announcing the initial release of openhab_rules_tools. But it’s just a quick npm install openhab-rules-tools
from the $OH_CONF/automation/js folder.
Note, the rule template is located at Time Based State Machine [4.0.0.0;4.1.0.0).