[SOLVED] I don't know whats wrong with this rule

rule "Day Mode"
when
     Time cron "<0 0 0 * * ?>" or
    Item NightMode  received update ON or
    Item DayMode  received update OFF
then
    sendCommand(DayMode,OFF)
    sendCommand(NightMode,ON)
end
rule "Night Mode"
when
     Time cron "0 0 10 ? * * *" or
    Item DayMode  received update ON
        Item NightMode  received update OFF
then
    sendCommand(NightMode,OFF)
    sendCommand(DayMode,ON)
end

this is not doing what is is suppose to do

First point is, if you use received update and then send a command to the same item, the rule will loop endlessly.
Second point is, your cron string is wrong.

rule "day mode"
when
    Time cron "0 0 0 * * ?" // 00:00:00 every day
then
    DayMode.sendCommand(OFF)
end

rule "night mode"
when
    Time cron "0 0 10 * * ?" // 10:00:00 every day
then
    DayMode.sendCommand(ON)
end

Please, whenever possible use the method Item.sendCommand(Value) rather than the action sendCommand(Item,Value).

why is my cron wrong?
i want to activate night mode every night @ 12 am and day mode everyday at 10 am

You are not using the proper syntax for cron expressions for the Quartz Scheduler which is used by OH.

There should be no < >

You should not use ? for the Day of Month field, only for the Day of Week field.

Udo’s corrections do just that.

i used the rule maker n it worked fine. :smile: thanks anyways