Simple example. The key is to be able to distinguish to source. Here I add a msg.topic.
[{"id":"dfa876bb.414a5","type":"inject","z":"652f7308.d51334","name":"","topic":"","payload":"255","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":160,"wires":[["84c40e6.8bbb37"]]},{"id":"e2851d93.abb09","type":"inject","z":"652f7308.d51334","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":120,"wires":[["84c40e6.8bbb37"]]},{"id":"84c40e6.8bbb37","type":"change","z":"652f7308.d51334","name":"water","rules":[{"t":"set","p":"topic","pt":"msg","to":"water","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":140,"wires":[["f1dcc175.37c8c"]]},{"id":"291023f2.ca1be4","type":"inject","z":"652f7308.d51334","name":"","topic":"","payload":"255","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":260,"wires":[["d28ffb86.83835"]]},{"id":"4bb12e01.0d2e18","type":"inject","z":"652f7308.d51334","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":220,"wires":[["d28ffb86.83835"]]},{"id":"d28ffb86.83835","type":"change","z":"652f7308.d51334","name":"door","rules":[{"t":"set","p":"topic","pt":"msg","to":"door","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":220,"wires":[["f1dcc175.37c8c"]]},{"id":"167b6872.0d5d2","type":"debug","z":"652f7308.d51334","name":"0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":160,"wires":[]},{"id":"8716058f.cf401","type":"debug","z":"652f7308.d51334","name":"255","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":710,"y":220,"wires":[]},{"id":"f1dcc175.37c8c","type":"switch","z":"652f7308.d51334","name":"0 or 255","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"255","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":500,"y":180,"wires":[["167b6872.0d5d2"],["8716058f.cf401"]]}]