How to create a macro with OpenHab?

This post will explain how to do that: Design Pattern: Unbound Item (aka Virtual Item)