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
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).