Dead rule - missing ID

Hello together,

I have creared a rule (with id). I have saved it. It was listed in the rules section. If I click on it the design page apears and it fading in and out in gray. The code page shows:

? Configuration
? Triggers
? Condition
? Action

If you want to save it, it says missing id. You are not able to delete it, stating not found.

Can somebody help?

Thanks and regards

Before doing anything, first try restarting openHAB and then force a reload of the MainUI in the browser (usually something like ctrl-shift-r).

After coming up in a clean slate, is the rule still there or did it disappear? If it’s still there is it showing the same behaviors?

See if you can capture an animated gif of this fading in and out. I’ve never seen that before.

Post a screen shot of the rule page.

If possible, post a screen shot of the code tab of the rule page.

What’s in openhab.log?

Double check that the file system openHAB is running on is not full. The UI and openHAB can become confused if openHAB was unable to save the rule after it’s submitted by the UI.

Hello Rich,

reload and reload did not work.

Video
Bildschirmaufnahme
Also showing the code tab

System is not full. I have added another rule already, doing what the corrupted one supposed to do.

Regards
René

LOG

Picture of the rule

For what ever reason that rule is corrupted. I can’t say why it’s corrupted. We can clean it up manually.

  1. Stop openHAB.
  2. Navigate to /var/lib/openhab/jsondb. Make a backup of automation_rules_disabled.json and automation_rules.json.
  3. Open automation_rules_disabled.json.
  4. Remove the entry for Alarm_Fenster_Schlafzimmer_Garten. It will look something like
  "christmas_lights": {
    "class": "java.lang.Boolean",
    "value": true
  },
  1. Open automation_rules.json and search for Alarm_Fenster_schlafzimmer_Garten. With any luck it won’t be there and the problem is the rule is gone here but wasn’t removed from the disabled list. If the rule does exist, post the entry here so I can see it and then remove it. The entry will look something like
  "christmas_lights": {
    "class": "org.openhab.core.automation.dto.RuleDTO",
    "value": {
      "triggers": [
        {
          "id": "1",
          "configuration": {
            "itemName": "TimeOfDay"
          },
          "type": "core.ItemStateChangeTrigger"
        }
      ],
      "conditions": [
        {
          "inputs": {},
          "id": "2",
          "configuration": {
            "itemName": "TisTheSeason",
            "operator": "\u003d",
            "state": "ON"
          },
          "type": "core.ItemStateCondition"
        }
      ],
      "actions": [
        {
          "inputs": {},
          "id": "3",
          "configuration": {
            "script": "var logger \u003d log(\u0027Christmas Lights\u0027);\n\nlogger.info(\u0027Setting the christmas lights!\u0027);\n\nvar newState \u003d \u0027OFF\u0027;\n\nvar currToD \u003d items.getItem(\u0027TimeOfDay\u0027).state;\nvar tods \u003d \u0027AFTERNOON,EVENING\u0027;\n\nvar daysto \u003d actions.Ephemeris.getDaysUntil(\u0027Christmas\u0027);\nif(daysto \u003c\u003d 1) tods \u003d tods + \u0027,DAY\u0027;\n\nif(tods.contains(currToD)){\n  newState \u003d \u0027ON\u0027;\n}\n\nlogger.info(\u0027Current tod \u003d {} on tods \u003d {}\u0027, currToD, tods);\nfor each (var light in items.getItem(\u0027AllChristmasLights\u0027).members) {\n  light.sendCommandIfDifferent(newState);\n}\n",
            "type": "application/javascript;version\u003dECMAScript-2021"
          },
          "type": "script.ScriptAction"
        }
      ],
      "configuration": {},
      "configDescriptions": [],
      "uid": "christmas_lights",
      "name": "Christmas Lights",
      "tags": [
        "Christmas",
        "Control",
        "Light"
      ],
      "visibility": "VISIBLE",
      "description": "Turns on and off the Christmas lights"
    }
  },

Yours will probably be much shorter. Pay attention to the indentation and { } which will tell you where the rule starts and stops.

  1. Start OH and watch the logs for errors and look to see that everything works and the rule is gone.

will need help from a friend to do so… will come back then