OH3 Javascript rules.SwitchableJSRule initial state always ON (enabled)

Is it possible to create a Javascript rules.SwitchableJSRule(…) who’s initial state is OFF?

No, but you can immediately command the Switch Item to OFF after creating the rule.

Another way could be to do the following:

  1. Make sure the Switch Item is configured to persist its value.
  2. Create the Item first before creating the rule. Update the Switch Item to OFF.
  3. Wait long enough for the OFF to be persisted.
  4. Now create the rule.

SwitchableJSRule will delete the old Item and then create it anew. Then, after creating the rule, it tries to initialize it to its most recent historic state which should be OFF. The Item will change to OFF and the rule should become disabled.

In both cases though, the rule will come up enabled for a few milliseconds before becoming disabled.