Script execution of rule with UID 'Startup-1' failed: The name 'sharedCache' cannot be resolved to an item or type; line 5, column 8, length 11 in Startup
Below is my rule:
rule "Edit the Xiaomi.things to make the sub-devices online"
when System reached start level 100
then
if(sharedCache.get("SystemStarted") == null){
executeCommandLine("../conf/rules/Startup.sh")
sharedCache.put("SystemStarted", "true")
}
end
I’m running OH 4.2 stable version, is this feature removed? Or maybe the implicate variable renamed?
Thank for your reply!
I also tried to trigger the rule by cron and same result. In visual studio code it also highlights the variable name cannot be found. Maybe it’s renamed?
Edit: also tried cache.shared without luck, I got the same error.
Neither 4.2.0 nor 4.2.1 work for me. It’s the first time I try to use the shared cache so I don’t know if it worked in previous versions.
Ah ok, I tried to make some rules in other rules file with different trigger conditions, same result. Also tested with privateCache and OH complains it doesn’t exist. So it looks to me like DSL rules engine for some reason doesn’t inject those implicit variables when running the rules. (I have already done the usual suspects, like restart and clean cache)