Executing the SCRIPT-transformation failed: Could not get script for UID '<filename>.script'

I’ve seen this reported on OH 3.4.2 and experienced this myself on OH 4.0 SNAPSHOT #3368.

Scenario: You want to use a transformation on a Channel. I’ve tested this and seen it with the MQTT binding. I’d expect it to be the same for the HTTP binding at the least, probably any binding or transformation.

Add SCRIPT:graaljs:<filename>.script as the transformation pattern and the above error will appear. This has been reported for both JS Scripting and Rules DSL. Note, this syntax is for the MQTT and HTTP binding. I don’t know if it’s the same for all bindings. Those might use SCRIPT(graaljs:<filename>.script)

Work Around:

  • verify the file is in the $OH_CONF/transform folder
  • verify the file has the .script extension
  • verify that the openhab user has permissions to read the file
  • if all of that checks out, restart OH.