Your Blockly script was created with a previous version of openHAB. Please save your script

Hello Friends,

sometimes i receive this message:

"Your Blockly script was created with a previous version of openHAB. Please save your script."

Is there any chance to query which Scripts / Rules are still running in that old Version?
I’ve already tried to check the “automation_rules.json” file but did not found any versioning.

Is there a place where I can see the blocky version?

Thank you

AFAIK, this does not happen to all Blockly rules, just the ones with changed blocks.

Where do you receive this message? openhab.log? MainUI popup?

Depending on when and where the message appears, it might help identify the problematic rules or provide insight to whether or not an issue should be filed to add the rule UID to the message.

1 Like

Hello @rlkoshak,

Thank you for your input and question.

The message appears as a UI popup in the MainUI when I click on a rule or script that hasn’t been opened for a while, especially after updates to OpenHAB (OH).

It’s clear that this is necessary, for example, when updates to Graal are made. However, I would like to know if there’s a way to get a list of the rules that can be updated.

Thanks,

/Franz

OK, unfortunately it looks like this is only implemented in MainUI. I don’t think the blocks are evaluated until you open the rule. I don’t think there’s any way to search for the rules that need to be reserved.

The good news is the rules are very likely to continue to work even if you don’t save them so you can just react to these popups as they occur.

There have not been any significant changes to the underlying JS so these popups are happening because there are some new implementations of blocks but that doesn’t mean the old stop working.

1 Like

Thanks @rlkoshak for the investigations.

You can go to

/var/lib/openhab/jsondb

open

automation_rules.json

and search for

application/javascript;version

Here is an example that I found on my system - the first entry is the name of the rule.

1_color_list_text": {
“class”: “org.openhab.core.automation.dto.RuleDTO”,
“value”: {
“triggers”: ,
“conditions”: ,
“actions”: [
{
“inputs”: {},
“id”: “1”,
“configuration”: {
“blockSource”: “…”
“script”: “…”
“type”: “application/javascript;version\u003dECMAScript-2021
},
“type”: “script.ScriptAction”
}
],
“configuration”: {},
“configDescriptions”: ,
“uid”: “1_color_list_text”,
“name”: “1_test_color_list_text”,
“tags”: ,
“visibility”: “VISIBLE”
}
},

Just open 1_color_list_text and you will see the message coming up.
This way you can find all non-converted rules. To convert them, just open them and press save.

If the rule has “application/javascript” only, then it is the latest version and does not need to be updated.

Hope that was the answer you were looking for.

1 Like