If you are just starting with OH, you will be better off using scripted automation for rules, rather than the old rules DSL.
Then you can use this…