use an expression with a scalable item.

If the item addressed by a scene’s “when block” has a scale (has scalable value), then an expression to use with or methods should return value in format to be compatible with an item.

      "name": "Temperature10F",
      "code": "return { value = 10, scale = \"fahrenheit\" }",
      "params": {}

The expression will return constant JSON object with fields value = 10 and scale = “fahrenheit”. In the case of incompatible values, a scene event that uses an expression will never raise.