The difficulty using the filter node seems to be because your data is split between the two wires, for "Switch turn on" and "Switch turn off".
Is it possible to combine these into one, rbe then split again? Something like this (no HA nodes in the example)
[{"id":"06e1b33b692056bc","type":"inject","z":"18302aaec057c898","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"19","payloadType":"num","x":90,"y":80,"wires":[["0f19e212ce258b8b"]]},{"id":"60ddbdf3832ab530","type":"inject","z":"18302aaec057c898","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","x":90,"y":120,"wires":[["0f19e212ce258b8b"]]},{"id":"ceefcd7272a139c9","type":"inject","z":"18302aaec057c898","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":90,"y":160,"wires":[["0f19e212ce258b8b"]]},{"id":"0f19e212ce258b8b","type":"switch","z":"18302aaec057c898","name":"<20?","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"20","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":230,"y":100,"wires":[["b7d5980bb6049dbe"],["44def34c21007195"]]},{"id":"44def34c21007195","type":"change","z":"18302aaec057c898","name":"OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":120,"wires":[["41ef36c36f8ac7a7"]]},{"id":"b7d5980bb6049dbe","type":"change","z":"18302aaec057c898","name":"ON","rules":[{"t":"set","p":"payload","pt":"msg","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":80,"wires":[["41ef36c36f8ac7a7"]]},{"id":"41ef36c36f8ac7a7","type":"rbe","z":"18302aaec057c898","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":470,"y":100,"wires":[["020ac02ac024ddbb"]]},{"id":"020ac02ac024ddbb","type":"switch","z":"18302aaec057c898","name":"ON or OFF ?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"ON","vt":"str"},{"t":"eq","v":"OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":610,"y":100,"wires":[["e54564bb5d8098e3","f5dbeaa5575a8496"],["250c2727b643a907","cd83acadd225604c"]]},{"id":"e54564bb5d8098e3","type":"link out","z":"18302aaec057c898","name":"Turn something ON","mode":"link","links":[],"x":810,"y":80,"wires":[],"l":true},{"id":"250c2727b643a907","type":"link out","z":"18302aaec057c898","name":"Turn something OFF","mode":"link","links":[],"x":820,"y":120,"wires":[],"l":true},{"id":"4f575cbb1e44d2dd","type":"inject","z":"18302aaec057c898","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"18","payloadType":"num","x":90,"y":40,"wires":[["0f19e212ce258b8b"]]},{"id":"f5dbeaa5575a8496","type":"debug","z":"18302aaec057c898","name":"ON","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":40,"wires":[]},{"id":"cd83acadd225604c","type":"debug","z":"18302aaec057c898","name":"OFF","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":160,"wires":[]}]