Door Bell

Raspberry connected to an analogue door bell switch and that rings a bell, takes a photo from the outside (from another rpi with mqtt) and logs the ring.

[{"id":"a2894ba7.a99478","type":"mqtt out","z":"ebc5be44.3b11c","name":"","topic":"dingdong","qos":"","retain":"","broker":"37f936a1.25c21a","x":600,"y":580,"wires":[]},{"id":"ed0828e7.5f47b8","type":"rpi-gpio in","z":"ebc5be44.3b11c","name":"","pin":"40","intype":"up","debounce":"25","read":true,"x":80,"y":240,"wires":[["a9cfa7b9.5cabf8"]]},{"id":"a9cfa7b9.5cabf8","type":"switch","z":"ebc5be44.3b11c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":200,"wires":[["64462c68.f6b304"],["abc84105.ccfcb"]]},{"id":"7052ecb3.eb57b4","type":"function","z":"ebc5be44.3b11c","name":"joined function","func":"var date = Date(msg.payload);\nvar msg1 = {payload: \"Someone pressed the doorbell at\"};\nvar msg2 = {payload: date.toString() };\n\nreturn [[msg1,msg2]];","outputs":1,"noerr":0,"x":680,"y":280,"wires":[["52195b1e.f2d024"]]},{"id":"52195b1e.f2d024","type":"join","z":"ebc5be44.3b11c","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","timeout":"1","count":"2","x":670,"y":400,"wires":[["7c119e09.ed011","f924760c.f818b8"]]},{"id":"f924760c.f818b8","type":"debug","z":"ebc5be44.3b11c","name":"","active":true,"console":"false","complete":"payload","x":930,"y":640,"wires":[]},{"id":"a25b3894.161e28","type":"ui_button","z":"ebc5be44.3b11c","name":"","group":"fa5a248e.f4f868","order":0,"width":0,"height":0,"passthru":false,"label":"button","color":"","bgcolor":"","icon":"","payload":"0","payloadType":"num","topic":"","x":90,"y":180,"wires":[["a9cfa7b9.5cabf8"]]},{"id":"9b5e1758.f22058","type":"ui_toast","z":"ebc5be44.3b11c","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":970,"y":540,"wires":[]},{"id":"7c119e09.ed011","type":"file in","z":"ebc5be44.3b11c","name":"","filename":"/home/pi/Desktop/log","format":"utf8","x":760,"y":480,"wires":[["9b5e1758.f22058","6df0eb9c.944b74"]]},{"id":"64462c68.f6b304","type":"change","z":"ebc5be44.3b11c","name":"change to 0","rules":[{"t":"set","p":"payload","pt":"msg","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":180,"wires":[["7052ecb3.eb57b4","67095b0.08e89a4"]]},{"id":"abc84105.ccfcb","type":"change","z":"ebc5be44.3b11c","name":"change to 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":220,"wires":[["7052ecb3.eb57b4"]]},{"id":"67095b0.08e89a4","type":"trigger","z":"ebc5be44.3b11c","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","bytopic":"all","name":"","x":480,"y":360,"wires":[["a2894ba7.a99478"]]},{"id":"6df0eb9c.944b74","type":"pushbullet","z":"ebc5be44.3b11c","config":"779d78f3.aa9fd8","pushtype":"note","title":"","chan":"","name":"","x":950,"y":400,"wires":[]},{"id":"b7ec2b15.012798","type":"rpi-gpio in","z":"ebc5be44.3b11c","name":"","pin":"12","intype":"tri","debounce":"25","read":true,"x":80,"y":340,"wires":[["f2bc612a.e88ac"]]},{"id":"f2bc612a.e88ac","type":"debug","z":"ebc5be44.3b11c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":200,"y":480,"wires":[]},{"id":"37f936a1.25c21a","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.140","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"fa5a248e.f4f868","type":"ui_group","z":"","name":"Default","tab":"219ec0b6.4f467","disp":true,"width":"6","collapse":false},{"id":"779d78f3.aa9fd8","type":"pushbullet-config","z":"","name":"admin"},{"id":"219ec0b6.4f467","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

Flow Info

Created 7 years, 1 month ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x2)
  • debug (x2)
  • file in (x1)
  • function (x1)
  • join (x1)
  • mqtt out (x1)
  • mqtt-broker (x1)
  • switch (x1)
  • trigger (x1)
Other

Tags

  • doorbell
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option