Aaaah, a man after my own heart! This should get you pointed in the right direction…
and this may also help…
Give me a shout if you want some specific help, although openHab isn’t something I can help with I’m afraid.
Pete.