Run Node Red inside Homebridge.
Boolean logic optimizer
A Node-RED node to provide a boolean gate and to interconnect them into a boolean network.