Hi guys,
I try to use Main-UI defined Rules for some simpler rules - but somehow if
doesn’t work as expected for me. Am I missing something or is it a bug?
Situation:
-
StateAlarmClock
has the state600
(Number) - the rule should trigger, check the value of
StateAlarmClock
and should only execute for a state of530
RuleDSL Syntax has been:
rule "Wake Up At 05:30"
when
Time cron "0 15 5 * * ?"
then
if( StateAlarmClock.state == 530 ) {
SceneWakeUp.sendCommand(ON)
}
end
(Do not worry about the cron trigger, the quarter hour time difference is intentional)
Main-UI generated code:
triggers:
- id: "1"
configuration:
cronExpression: 0 15 5 * * ?
type: timer.GenericCronTrigger
conditions:
- inputs: {}
id: "2"
configuration:
itemName: StateAlarmClock
state: "530"
operator: =
type: core.ItemStateCondition
actions:
- inputs: {}
id: "3"
configuration:
itemName: SceneWakeUp
command: ON
type: core.ItemCommandAction
Screenshot
So according to my understanding, when the rule is triggered nothing should happen since StateAlarmClock
doesn’t equal 530
(see situation).
Instead, regardless of the value of StateAlarmClock
, the command is send to SceneWakeUp
.
Why?
Edit: fixed the old naming schema in the Rules DSL Snippet to avoid confusion (State_Alarm_Clock
→ StateAlarmClock
)