Something is a little bit strange since this configuration works fine when using ordinary MQTT in/out nodes! Now I can both receive and send the commands where the light turn on/off correctly.
[{"id":"d6672b1f.e58f48","type":"ui_switch","z":"f6a0cce1.578a1","name":"Light Switch","label":"Light Switch","tooltip":"","group":"af4d5500.1311d8","order":9,"width":"3","height":"1","passthru":false,"decouple":"true","topic":"homie/homey-topic/lucasfonster/onoff/set","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":610,"y":740,"wires":[["d312f4e2.7a9058"]]},{"id":"d312f4e2.7a9058","type":"mqtt out","z":"f6a0cce1.578a1","name":"MQTT Transmitter","topic":"","qos":"","retain":"","broker":"4709a5ff.a5e08c","x":830,"y":740,"wires":},{"id":"c2b2758f.cc9f78","type":"mqtt in","z":"f6a0cce1.578a1","name":"MQTT receiver light","topic":"homie/homey-topic/lucasfonster/onoff","qos":"2","datatype":"auto","broker":"4709a5ff.a5e08c","x":150,"y":740,"wires":[["83ef5d25.1bb9f"]]},{"id":"83ef5d25.1bb9f","type":"function","z":"f6a0cce1.578a1","name":"Convert String to Boolean","func":"if(msg.payload === "true"){\n msg.payload = true; \n}else{\n msg.payload = false;\n}\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":740,"wires":[["d6672b1f.e58f48"]]},{"id":"af4d5500.1311d8","type":"ui_group","name":"Group 4","tab":"30048f8.763b8f","order":4,"disp":true,"width":6},{"id":"4709a5ff.a5e08c","type":"mqtt-broker","z":"","name":"magnus_p","broker":"192.168.1.189","port":"1883","clientid":"Node-Red","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"30048f8.763b8f","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1,"disabled":false,"hidden":false}]