Hi I have the following node and Im thinking of how can I make it more simple. Because no I have 17 templates and there should be a way to just make it simpler.. Its hard to explain maybe if you see my node you will understand what I mean...
[{"id":"fe5cbd20.7d67a8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"afaacc1d.ab2918","type":"template","z":"fe5cbd20.7d67a8","name":"Office - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/Office/set/state","output":"str","x":1290,"y":240,"wires":[["cffd3bfc.e19ec"]]},{"id":"26015b8c.3b0d64","type":"json","z":"fe5cbd20.7d67a8","name":"","property":"payload","action":"","pretty":false,"x":350,"y":560,"wires":[["6f592e5.2d66ad"]]},{"id":"8206c876.72a7b","type":"mqtt in","z":"fe5cbd20.7d67a8","name":"Schalter1 Taste 6","topic":"zigbee2mqtt/Schalter1","qos":"2","datatype":"auto","broker":"5d017373.c59dac","x":160,"y":560,"wires":[["26015b8c.3b0d64"]]},{"id":"6f592e5.2d66ad","type":"switch","z":"fe5cbd20.7d67a8","name":"","property":"payload.action","propertyType":"msg","rules":[{"t":"eq","v":"button_6_single","vt":"str"},{"t":"eq","v":"button_6_double","vt":"str"},{"t":"eq","v":"button_6_triple","vt":"str"},{"t":"eq","v":"button_6_hold","vt":"str"},{"t":"eq","v":"button_6_release","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":490,"y":560,"wires":[["c49d748b.ce0ff"],[],[],[],[]]},{"id":"c49d748b.ce0ff","type":"function","z":"fe5cbd20.7d67a8","name":"","func":"\n var newMsg = \"toggle\"\n msg.payload = newMsg;\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":820,"y":560,"wires":[["afaacc1d.ab2918","49cfc081.120028","5a2aa3c3.417864","6509746f.813eec","27ceba87.7b127e","8ac7c18b.8e6e48","9e9fd043.be181","d5d2a7ea.16cd8","b42f6075.c22f3","9d50264e.cabeb8","f1926037.a34498","39e18e88.303042","37b5294b.1e0d8e","85e9a81.1363158","36093f9c.7d412","b0de2c2b.c58b2","8c5ed665.2dd3a"]]},{"id":"49cfc081.120028","type":"template","z":"fe5cbd20.7d67a8","name":"FloorOffice - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/FloorOffice/set/state","output":"str","x":1310,"y":280,"wires":[["cffd3bfc.e19ec"]]},{"id":"5a2aa3c3.417864","type":"template","z":"fe5cbd20.7d67a8","name":"StepsOG - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/StepsOG/set/state","output":"str","x":1300,"y":320,"wires":[["cffd3bfc.e19ec"]]},{"id":"6509746f.813eec","type":"template","z":"fe5cbd20.7d67a8","name":"Floor2Play - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/Floor2Play/set/state","output":"str","x":1310,"y":360,"wires":[["cffd3bfc.e19ec"]]},{"id":"27ceba87.7b127e","type":"template","z":"fe5cbd20.7d67a8","name":"Floor2Bed - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/Floor2Bed/set/state","output":"str","x":1310,"y":400,"wires":[["cffd3bfc.e19ec"]]},{"id":"8ac7c18b.8e6e48","type":"template","z":"fe5cbd20.7d67a8","name":"KidsBed - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/KidsBed/set/state","output":"str","x":1300,"y":440,"wires":[["cffd3bfc.e19ec"]]},{"id":"9e9fd043.be181","type":"template","z":"fe5cbd20.7d67a8","name":"KidsBedBath - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/KidsBedBath/set/state","output":"str","x":1320,"y":480,"wires":[["cffd3bfc.e19ec"]]},{"id":"d5d2a7ea.16cd8","type":"template","z":"fe5cbd20.7d67a8","name":"KidsPlay - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/KidsPlay/set/state","output":"str","x":1300,"y":520,"wires":[["cffd3bfc.e19ec"]]},{"id":"b42f6075.c22f3","type":"template","z":"fe5cbd20.7d67a8","name":"KidsPlayBath - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/KidsPlayBath/set/state","output":"str","x":1320,"y":560,"wires":[["cffd3bfc.e19ec"]]},{"id":"9d50264e.cabeb8","type":"template","z":"fe5cbd20.7d67a8","name":"FloorEgUp - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/FloorEgUp/set/state","output":"str","x":1310,"y":600,"wires":[["cffd3bfc.e19ec"]]},{"id":"f1926037.a34498","type":"template","z":"fe5cbd20.7d67a8","name":"FloorEgDown - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/FloorEgDown/set/state","output":"str","x":1320,"y":640,"wires":[["cffd3bfc.e19ec"]]},{"id":"39e18e88.303042","type":"template","z":"fe5cbd20.7d67a8","name":"DiningTable - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/DiningTable/set/state","output":"str","x":1310,"y":680,"wires":[["cffd3bfc.e19ec"]]},{"id":"37b5294b.1e0d8e","type":"template","z":"fe5cbd20.7d67a8","name":"Livingroom - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/Livingroom/set/state","output":"str","x":1310,"y":720,"wires":[["cffd3bfc.e19ec"]]},{"id":"85e9a81.1363158","type":"template","z":"fe5cbd20.7d67a8","name":"FloorMaidsroom - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/FloorMaidsroom/set/state","output":"str","x":1330,"y":760,"wires":[["cffd3bfc.e19ec"]]},{"id":"36093f9c.7d412","type":"template","z":"fe5cbd20.7d67a8","name":"0xb0ce1814030e6413 - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/0xb0ce1814030e6413/set/state","output":"str","x":1340,"y":800,"wires":[["cffd3bfc.e19ec"]]},{"id":"b0de2c2b.c58b2","type":"template","z":"fe5cbd20.7d67a8","name":"0xb0ce1814030e6128 - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/0xb0ce1814030e6128/set/state","output":"str","x":1340,"y":840,"wires":[["cffd3bfc.e19ec"]]},{"id":"8c5ed665.2dd3a","type":"template","z":"fe5cbd20.7d67a8","name":"0xb0ce1814030e5c1a - state","field":"topic","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"zigbee2mqtt/0xb0ce1814030e5c1a/set/state","output":"str","x":1340,"y":880,"wires":[["cffd3bfc.e19ec"]]},{"id":"cffd3bfc.e19ec","type":"mqtt out","z":"fe5cbd20.7d67a8","name":"an MQTT senden","topic":"","qos":"","retain":"","broker":"5d017373.c59dac","x":1870,"y":520,"wires":[]},{"id":"5d017373.c59dac","type":"mqtt-broker","name":"MQTT","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"domoticz/bridge/state","birthQos":"0","birthRetain":"false","birthPayload":"online","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""}]