Sample Virtual Device - Supergiovane/node-red-contrib-knx-ultimate GitHub Wiki

VIRTUAL DEVICE

A Virtual device node is a knx-ultimate node acting as a real KNX device.
It can react to a read requests from bus and respond with the current node's status. It's very powerful. Let's see how to implement it.
I'ts important that the group address, doesn't belong to any real KNX device in your installation, otherwise you may interfere with that.

Diagram


Copy this code and paste it into your flow

View code

Adjust the nodes according to your setup

[{"id":"16008ddc.e536aa","type":"knxUltimate","z":"d54a843.d1740f8","server":"123ea2c2.4a920d","topic":"5/0/1","outputtopic":"","dpt":"1.001","initialread":false,"notifyreadrequest":true,"notifyresponse":false,"notifywrite":true,"notifyreadrequestalsorespondtobus":true,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"false","listenallga":false,"name":"Light Status","outputtype":"read","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":510,"y":140,"wires":[[]]},{"id":"6026b0c2.01986","type":"comment","z":"d54a843.d1740f8","name":"OUTPUT","info":"","x":360,"y":360,"wires":[]},{"id":"5d348222.98124c","type":"inject","z":"d54a843.d1740f8","name":"Read","props":[{"p":"payload","v":"true","vt":"bool"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":370,"y":140,"wires":[["16008ddc.e536aa"]]},{"id":"7b3ea20f.7a5d9c","type":"comment","z":"d54a843.d1740f8","name":"1 - Simulate the read request (This is the Virtual Device)","info":"","x":500,"y":100,"wires":[]},{"id":"5d369bf2.fa47c4","type":"comment","z":"d54a843.d1740f8","name":"This sample shows how to make your own KNX device, aka Virtual Device. Don't use any real Group Address, to avoid a real KNX device to respond.","info":"","x":510,"y":40,"wires":[]},{"id":"874a9486.d65c6","type":"knxUltimate","z":"d54a843.d1740f8","server":"123ea2c2.4a920d","topic":"5/0/1","outputtopic":"","dpt":"1.001","initialread":false,"notifyreadrequest":false,"notifyresponse":true,"notifywrite":false,"notifyreadrequestalsorespondtobus":true,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"false","listenallga":false,"name":"Light Status","outputtype":"write","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":370,"y":400,"wires":[["dec16169.4ab8e8"]]},{"id":"dec16169.4ab8e8","type":"debug","z":"d54a843.d1740f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":400,"wires":[]},{"id":"d104af91.31da18","type":"knxUltimate","z":"d54a843.d1740f8","server":"123ea2c2.4a920d","topic":"5/0/1","outputtopic":"","dpt":"1.001","initialread":false,"notifyreadrequest":false,"notifyresponse":false,"notifywrite":false,"notifyreadrequestalsorespondtobus":true,"notifyreadrequestalsorespondtobusdefaultvalueifnotinitialized":"true","listenallga":false,"name":"Light Status","outputtype":"update","outputRBE":false,"inputRBE":false,"formatmultiplyvalue":"1","formatnegativevalue":"leave","formatdecimalsvalue":"999","passthrough":"no","x":650,"y":240,"wires":[[]]},{"id":"68008f9b.05a54","type":"inject","z":"d54a843.d1740f8","name":"True","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":370,"y":240,"wires":[["d104af91.31da18"]]},{"id":"d0908aa0.7a678","type":"comment","z":"d54a843.d1740f8","name":"2 - Update only the node value, without sending anything to KNX BUS","info":"","x":550,"y":200,"wires":[]},{"id":"7b72eaef.8c98d4","type":"function","z":"d54a843.d1740f8","name":"via JS","func":"msg.event = \"Update_NoWrite\";\nmsg.payload = false;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":280,"wires":[["d104af91.31da18"]]},{"id":"ed3f93c9.abd278","type":"inject","z":"d54a843.d1740f8","name":"False","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":370,"y":280,"wires":[["7b72eaef.8c98d4"]]},{"id":"123ea2c2.4a920d","type":"knxUltimate-config","host":"224.0.23.12","port":"3671","physAddr":"15.15.22","suppressACKRequest":false,"csv":"\"Group name\"\t\"Address\"\t\"Central\"\t\"Unfiltered\"\t\"Description\"\t\"DatapointType\"\t\"Security\"\n\"Attuatori luci\"\t\"0/-/-\"\t\"\"\t\"\"\t\"Attuatori luci\"\t\"\"\t\"Auto\"\n\"Luci primo piano\"\t\"0/0/-\"\t\"\"\t\"\"\t\"Luci primo piano\"\t\"\"\t\"Auto\"\n\"Camera da letto luce\"\t\"0/0/1\"\t\"\"\t\"\"\t\"Camera da letto luce\"\t\"DPST-1-8\"\t\"Auto\"\n\"Loggia camera da letto\"\t\"0/0/2\"\t\"\"\t\"\"\t\"Loggia camera da letto\"\t\"DPST-1-1\"\t\"Auto\"\n\"Camera armadi luce\"\t\"0/0/3\"\t\"\"\t\"\"\t\"Camera armadi luce\"\t\"DPST-1-1\"\t\"Auto\"\n\"Bagno grande luce\"\t\"0/0/4\"\t\"\"\t\"\"\t\"Bagno grande luce\"\t\"DPST-1-1\"\t\"Auto\"\n\"Loggia bagno grande\"\t\"0/0/5\"\t\"\"\t\"\"\t\"Loggia bagno grande\"\t\"DPST-1-1\"\t\"Auto\"","KNXEthInterface":"Auto","KNXEthInterfaceManuallyInput":"","statusDisplayLastUpdate":true,"statusDisplayDeviceNameWhenALL":true,"statusDisplayDataPoint":false,"stopETSImportIfNoDatapoint":"stop","loglevel":"error","name":"Multicast Router","localEchoInTunneling":true,"delaybetweentelegrams":"","delaybetweentelegramsfurtherdelayREAD":""}]
⚠️ **GitHub.com Fallback** ⚠️