Binary math in a openhab2 rule

Thanks for posting the working result. It will be a lot easier for us to read though if you How to use code fences.