Example flow I use with homekit
[{"id":"534c1b6.4260ee4","type":"mqtt out","z":"fb27fd4d.7e296","name":"","topic":"","qos":"0","retain":"false","broker":"228872c0.fd94d6","x":579,"y":138,"wires":[]},{"id":"4c9b626f.ae5614","type":"mqtt in","z":"fb27fd4d.7e296","name":"","topic":"homebridge/from/set/Fan","qos":"2","datatype":"json","broker":"228872c0.fd94d6","x":156,"y":92,"wires":[["7b840a95.24a784"]]},{"id":"df38a4fd.368268","type":"mqtt in","z":"fb27fd4d.7e296","name":"","topic":"homebridge/from/set/Boiler","qos":"2","datatype":"json","broker":"228872c0.fd94d6","x":166,"y":138,"wires":[["7b840a95.24a784"]]},{"id":"db5998c2.7eaf78","type":"mqtt in","z":"fb27fd4d.7e296","name":"","topic":"homebridge/from/set/Kleine Lamp","qos":"2","datatype":"json","broker":"228872c0.fd94d6","x":186,"y":184,"wires":[["7b840a95.24a784"]]},{"id":"7b840a95.24a784","type":"function","z":"fb27fd4d.7e296","name":"","func":"destination_topic = []\nm = msg.payload.value\nsource_topic = msg.topic\n\ndestination_topic[\"homebridge/from/set/Fan\"] = \"livingroom/fan/cmnd/POWER\" \ndestination_topic[\"homebridge/from/set/Boiler\"] = \"Boiler/relay/0/set\" \ndestination_topic[\"homebridge/from/set/Kleine Lamp\"] = \"livingroom/switch/cmnd/POWER\" \n\nif(m){\n return {topic:destination_topic[source_topic],payload:1}\n}\nelse{\n return {topic:destination_topic[source_topic],payload:0}\n}\n","outputs":1,"noerr":0,"x":441,"y":138,"wires":[["534c1b6.4260ee4","41619320.1d614c"]]},{"id":"41619320.1d614c","type":"debug","z":"fb27fd4d.7e296","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":578,"y":198,"wires":[]},{"id":"228872c0.fd94d6","type":"mqtt-broker","z":"","name":"mqtt","broker":"10.0.0.202","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]