Sorry about the delay in responding - I've been very busy this week.
Here's a cut-down version of the NR flow for the IR security system.
[{"id":"121e7a1e.9edc66","type":"mqtt in","z":"d604a211.103938","name":"","topic":"node41/reading/ir/level/#","qos":"2","datatype":"auto","broker":"a86115be.40797","x":230,"y":340,"wires":[["3cb3209c.2c5588","99766cf1.371078"]]},{"id":"28bc587e.eaea28","type":"rising-edge","z":"d604a211.103938","name":"","threshold":"0","x":650,"y":340,"wires":[["2631a893.1d397"]]},{"id":"2631a893.1d397","type":"function","z":"d604a211.103938","name":"","func":"msg.payload=\"IR detected in rear garden\";\nreturn msg;","outputs":1,"noerr":0,"x":810,"y":340,"wires":[["3aed7900.dd064e"]]},{"id":"3cb3209c.2c5588","type":"function","z":"d604a211.103938","name":"","func":"if (msg.payload == \"1\")\n {\n msg.payload = 1;\n }\nelse if (msg.payload == \"0\")\n {\n msg.payload = 0;\n }\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":340,"wires":[["28bc587e.eaea28"]]},{"id":"99766cf1.371078","type":"debug","z":"d604a211.103938","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":490,"y":400,"wires":[]},{"id":"7be32425.13144c","type":"inject","z":"d604a211.103938","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":240,"wires":[["3cb3209c.2c5588"]]},{"id":"6ae036c5.ae339","type":"inject","z":"d604a211.103938","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":280,"wires":[["3cb3209c.2c5588"]]},{"id":"fdaccb35.7a9a48","type":"inject","z":"d604a211.103938","name":"Test IR unit remotely","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":160,"wires":[["e103eaa7.5b52b"]]},{"id":"78e3cdd4.4c3fcc","type":"mqtt out","z":"d604a211.103938","name":"","topic":"node41/cmd","qos":"","retain":"","broker":"a86115be.40797","x":570,"y":160,"wires":[]},{"id":"e103eaa7.5b52b","type":"function","z":"d604a211.103938","name":"","func":"msg.payload = \"event,IRon\";\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":160,"wires":[["78e3cdd4.4c3fcc"]]},{"id":"3aed7900.dd064e","type":"telegrambot-notify","z":"d604a211.103938","name":"","bot":"","chatId":"","message":"","parseMode":"","x":980,"y":340,"wires":[]},{"id":"a86115be.40797","type":"mqtt-broker","z":"","name":"Use this one 192.168.1.142","broker":"192.168.1.142","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
I used a Wemos D1 Mini to handle the IR detector - wired it up as a switch.
I also used a set of "Rules" (in the Wemos) to remotely trigger GPIO-13 to remotely test the IR detector was working.
On IRon do
gpio,13,1 //Set input 0 High
timerSet,1,1 //timer 1 set for 1 sec
endon
On IRoff do
timerSet,1,0 //timer 1 set to halt,
gpio,13,0 //Set input 0 low (normal state)
endon
On Rules#Timer=1 do
gpio,13,0 //Set input 0 low (normal state)
endon
Hope you find the above files/screenshots useful.
Regards from David.
PS:
I should add that I arrange for all my nodes to post their data in the format:
<node_number>/reading/<device_name>/<value>
You might need to alter the topic in the MQTT-In and MQTT-Out nodes to match the format you use.