hi everyone im trying to transferer my rules created in paperui experimental engine to text based rules
my rule isnt working my ruke is
rule "Test LRLamp 20%@12:03PM Daily"
when
Time cron " 0 3 0 1/1 * ? *"
then
if (Lamp1_Brightness >= 20) {
sendCommand(Lamp1_Brightness, 20)
}
end
when this rule runs the log:tail command returns error
00:03:00.059 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule Test LRLamp 20%@10PM Daily: An error occurred during the script execution: The name '<XFeatureCallImplCustom> >= <XNumberLiteralImpl>' cannot be resolved to an item or type.
Your rule is error because Lamp1_Brightness is an item. You must do that :
rule “Test LRLamp 12:03PM Daily”
when
Time cron " 0 3 0 1/1 * ? *"
then
if ((Lamp1_Brightness.state as DecimalType).intValue >= 20) {
sendCommand(Lamp1_Brightness, 20)
}
end
rule "Test KL 1:20PM Daily"
when
Time cron "0 22 13 1/1 * ? *"
then
if (BULB1DSKITCHEN_Brightness.state >= 20) {
BULB1DSKITCHEN_Brightness.sendCommand(20)
}
end
this rule worked thanks for that i only made changes to the cron so it would run now and changed also changed bulb as people were using lamp 1
rule "Dim LR Light @ 10:00PM Daily"
when
Time cron " 0 0 22 1/1 * ? *"
then
if (Movie_Mode_Trigger.state == OFF) {
if (Lamp1_Brightness.state >= 20) {
Lamp1_Brightness.sendCommand(20)
}
}
end
do you after enable the openhab eextension or set it as a default in studio code i have pasted a rule and its just white text not colored i have downloaded and installed the OH extention