Nope, because that supposes that HA and NodeRed can both be connected and using the USB device at the same time, which is not possible.
As for How - this in my RFX In flow:
[{"id":"c033a41c.8a82c8","type":"rfx-lights-in","z":"14d24653.cce13a","name":"RFX Lights","port":"32c78c31.961204","topicSource":"all","topic":"","x":100,"y":60,"wires":[["472ea41a.8a277c"]]},{"id":"5904b83b.af5e18","type":"rfx-doorbell-in","z":"14d24653.cce13a","name":"RFX Doorbell","port":"32c78c31.961204","topicSource":"all","topic":"","x":110,"y":120,"wires":[["472ea41a.8a277c","4e9846d5.9e7b68"]]},{"id":"374d3427.be949c","type":"rfx-meter","z":"14d24653.cce13a","name":"RFX Meter","port":"32c78c31.961204","topicSource":"all","topic":"","x":100,"y":200,"wires":[["472ea41a.8a277c"]]},{"id":"edc661f3.48312","type":"rfx-sensor","z":"14d24653.cce13a","name":"RFX Sensor","port":"32c78c31.961204","topicSource":"all","topic":"","x":110,"y":280,"wires":[["472ea41a.8a277c"]]},{"id":"f2bf95f1.f21088","type":"rfx-detector-in","z":"14d24653.cce13a","name":"RFX Alarm","port":"32c78c31.961204","topicSource":"all","topic":"","outputHeartbeats":false,"x":100,"y":360,"wires":[["472ea41a.8a277c"]]},{"id":"16bcbc7c.2e0414","type":"rfx-PT2262-in","z":"14d24653.cce13a","name":"PT2262 Devices","port":"32c78c31.961204","deviceList":"4774fc7c.21e7e4","topicSource":"all","topic":"","x":180,"y":440,"wires":[["472ea41a.8a277c","86459039.cc30f"]]},{"id":"472ea41a.8a277c","type":"function","z":"14d24653.cce13a","name":"","func":"var topic = \"dhjm/rfxgateway/\" + msg.topic;\nmsg.new_topic = topic;\nvar out = {};\n//out.data = msg.payload;\n//msg.payload = out;\nmsg.topic = topic;\nif (typeof msg.raw !== 'undefined') {\n out.data = msg.payload;\n out.raw = msg.raw;\n msg.payload = out;\n}\nreturn msg;","outputs":1,"noerr":0,"x":380,"y":80,"wires":[["4e9846d5.9e7b68","111625d3.9a936a","3ca4d25e.29941e"]]},{"id":"111625d3.9a936a","type":"mqtt out","z":"14d24653.cce13a","name":"","topic":"","qos":"","retain":"true","broker":"e2d4663.ba31a98","x":640,"y":160,"wires":[]},{"id":"32c78c31.961204","type":"rfxtrx-port","z":"","port":"/dev/ttyUSB0","enableDebug":false,"rfyVenetianMode":"EU"},{"id":"4774fc7c.21e7e4","type":"PT2262-device-list","z":"","name":"Found Devices","devices":[]},{"id":"e2d4663.ba31a98","type":"mqtt-broker","z":"","broker":"192.168.2.9","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""}]
This is my RFX Out flow
[{"id":"c548bdf4.b0a78","type":"mqtt in","z":"caf0c94d.3b5e68","name":"","topic":"dhjm/rfxgateway/command","qos":"2","datatype":"json","broker":"e2d4663.ba31a98","x":150,"y":40,"wires":[["d35d04ca.cc7b68"]]},{"id":"d35d04ca.cc7b68","type":"switch","z":"caf0c94d.3b5e68","name":"","property":"payload.device","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":350,"y":40,"wires":[["90b2d12d.64a24"]]},{"id":"90b2d12d.64a24","type":"function","z":"caf0c94d.3b5e68","name":"","func":"if (typeof msg.payload.address == 'undefined') {\n return null;\n}\nif (typeof msg.payload.data == 'undefined') {\n return null;\n}\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":40,"wires":[["227e7717.9ec9c8"]]},{"id":"227e7717.9ec9c8","type":"switch","z":"caf0c94d.3b5e68","name":"","property":"payload.device","propertyType":"msg","rules":[{"t":"eq","v":"light","vt":"str"},{"t":"eq","v":"doorbell","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":280,"y":120,"wires":[["2fde47bb.cdf9d8"],["a40d56bb.1ad6e8"]]},{"id":"2fde47bb.cdf9d8","type":"function","z":"caf0c94d.3b5e68","name":"","func":"msg.topic = msg.payload.address;\nvar o = msg.payload;\nmsg.payload = {};\nmsg.payload = o.data;\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":120,"wires":[["ff47f4be.821368","4e165f83.159e2","fadbdb64.5f4648"]]},{"id":"ff47f4be.821368","type":"rfx-lights-out","z":"caf0c94d.3b5e68","name":"AC/ARC Control","port":"32c78c31.961204","topicSource":"msg","retransmit":"once","retransmitInterval":"10","topic":"","x":640,"y":120,"wires":[]},{"id":"f340fd6c.a6998","type":"rfx-doorbell-out","z":"caf0c94d.3b5e68","name":"Doorbell Control","port":"32c78c31.961204","topicSource":"msg","topic":"","x":630,"y":180,"wires":[]},{"id":"a40d56bb.1ad6e8","type":"function","z":"caf0c94d.3b5e68","name":"","func":"msg.topic = msg.payload.address;\nvar o = msg.payload;\nmsg.payload = {};\nmsg.payload = o.data;\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":160,"wires":[["f340fd6c.a6998","4e165f83.159e2"]]},{"id":"fadbdb64.5f4648","type":"function","z":"caf0c94d.3b5e68","name":"","func":"var t = msg.topic;\nmsg.topic = \"dhjm/rfxgateway/\" + t;\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":260,"wires":[["32ac634f.f5816c"]]},{"id":"32ac634f.f5816c","type":"mqtt out","z":"caf0c94d.3b5e68","name":"","topic":"","qos":"","retain":"true","broker":"e2d4663.ba31a98","x":300,"y":320,"wires":[]},{"id":"e2d4663.ba31a98","type":"mqtt-broker","z":"","broker":"192.168.2.9","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"32c78c31.961204","type":"rfxtrx-port","z":"","port":"/dev/ttyUSB0","enableDebug":false,"rfyVenetianMode":"EU"}]
Here is a binary motion sensor picked up by RFX:
- platform: mqtt
name: "Greenroom Motion"
state_topic: "dhjm/rfxgateway/AC/0x00018D7C/2"
device_class: motion
payload_on: "On"
payload_off: "Off"
off_delay: 30
Here is the binary sensor for the doorbell:
#Doorbells
- platform: mqtt
name: "Front Door Doorbell"
state_topic: "dhjm/rfxgateway/BYRON_SX/0xBF"
payload_on: 1
off_delay: 10
Here is an example of how to do a switch:
- platform: mqtt
command_topic: dhjm/rfxgateway/command
name: "Garden Audio"
optimistic: true
payload_off: >
{"device":"light","address":"AC/0x00030CE/4","data":"Off"}
payload_on: >
{"device":"light","address":"AC/0x00030CE/4","data":"On"}
state_off: "Off"
state_on: "On"
state_topic: dhjm/rfxgateway/AC/0x00030CE/4