Skip to content

Instantly share code, notes, and snippets.

@RamonBell
Created April 30, 2021 16:45
Show Gist options
  • Save RamonBell/46a28406ae57fcde81d507b7dcaa41d0 to your computer and use it in GitHub Desktop.
Save RamonBell/46a28406ae57fcde81d507b7dcaa41d0 to your computer and use it in GitHub Desktop.
Code for RF Doorbell
[{"id":"fec9b4e3.fe2c78","type":"tab","label":"RF doorbell","disabled":false,"info":""},{"id":"619264af.40619c","type":"function","z":"fec9b4e3.fe2c78","name":"side door boorbell","func":"var line1 = [\"Some one is ringing the side doorbell \" ]\n\nmsg.payload =\n\nline1[Math.floor(Math.random() * line1.length)]\n\n\nreturn msg\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":560,"wires":[["a4dbdbdb.d13fa8"]]},{"id":"569a909a.ed83f","type":"function","z":"fec9b4e3.fe2c78","name":"front door boorbell","func":"var line1 = [\"Some one is ringing the front doorbell \" ]\n\nmsg.payload =\n\nline1[Math.floor(Math.random() * line1.length)]\n\n\nreturn msg\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":80,"wires":[["a4dbdbdb.d13fa8"]]},{"id":"2cdcf18c.a6965e","type":"api-current-state","z":"fec9b4e3.fe2c78","name":"Home?","server":"","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.home_mode","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":440,"y":200,"wires":[["569a909a.ed83f"],["b3cea535.c3c5f8","f0be7957.91f1d8","95c81b71.844d88"]]},{"id":"b3cea535.c3c5f8","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"Doorbell Melissa's phone","server":"","version":1,"debugenabled":true,"service_domain":"notify","service":"mobile_app_sm_g965u","entityId":"","data":"{\"message\":\"Someone is ringing the front doorbell\",\"data\":{\"type\":\"tts\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1270,"y":120,"wires":[[]]},{"id":"f0be7957.91f1d8","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"Doorbell on my phone","server":"","version":1,"debugenabled":true,"service_domain":"notify","service":"mobile_app_pixel_2","entityId":"","data":"{\"message\":\"Someone is ringing the front doorbell\",\"data\":{\"type\":\"tts\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1260,"y":180,"wires":[[]]},{"id":"a4dbdbdb.d13fa8","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"Alexa Announce family room ","server":"","version":1,"debugenabled":true,"service_domain":"notify","service":"alexa_media_ramon_s_echo_plus","entityId":"","data":"{\"message\":\"{{payload}}\",\"data\":{\"type\":\"announce\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1280,"y":280,"wires":[[]]},{"id":"76467088.26d7a","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"Side doorbell Melissa's phone","server":"","version":1,"debugenabled":true,"service_domain":"notify","service":"mobile_app_sm_g965u","entityId":"","data":"{\"message\":\"Someone is ringing driveway doorbell\",\"data\":{\"type\":\"tts\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1290,"y":440,"wires":[[]]},{"id":"48e2cd35.b53ba4","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"Side doorbell on my phone","server":"","version":1,"debugenabled":true,"service_domain":"notify","service":"mobile_app_pixel_2","entityId":"","data":"{\"message\":\"Someone is ringing the driveway doorbell\",\"data\":{\"type\":\"tts\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1280,"y":500,"wires":[[]]},{"id":"74153ae5.d88f14","type":"api-current-state","z":"fec9b4e3.fe2c78","name":"Home?","server":"","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.home_mode","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":520,"wires":[["11f4da3d.f40a96"],["76467088.26d7a","48e2cd35.b53ba4","bb7147a.51696b8"]]},{"id":"11f4da3d.f40a96","type":"time-range-switch","z":"fec9b4e3.fe2c78","name":"night time range","lat":"","lon":"","startTime":"21:30","endTime":"05:00","startOffset":0,"endOffset":0,"x":600,"y":340,"wires":[[],["619264af.40619c"]]},{"id":"b8b11cb8.e2064","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"Alexa Announce Dustin's room ","server":"","version":1,"debugenabled":true,"service_domain":"notify","service":"alexa_media_dustin_s_echo_dot","entityId":"","data":"{\"message\":\"{{payload}}\",\"data\":{\"type\":\"announce\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1290,"y":340,"wires":[[]]},{"id":"bb7147a.51696b8","type":"function","z":"fec9b4e3.fe2c78","name":"side door boorbell","func":"var line1 = [\"Some one is ringing the side doorbell \" ]\n\nmsg.payload =\n\nline1[Math.floor(Math.random() * line1.length)]\n\n\nreturn msg\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":680,"wires":[["b8b11cb8.e2064"]]},{"id":"95c81b71.844d88","type":"function","z":"fec9b4e3.fe2c78","name":"front door boorbell","func":"var line1 = [\"Some one is ringing the front doorbell \" ]\n\nmsg.payload =\n\nline1[Math.floor(Math.random() * line1.length)]\n\n\nreturn msg\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":220,"wires":[["b8b11cb8.e2064"]]},{"id":"42b9a47c.d64a3c","type":"api-current-state","z":"fec9b4e3.fe2c78","name":"work bench?","server":"","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.work_bench_work_bench","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":470,"y":660,"wires":[["e946b5e2.8d67d8","48c32bc3.da4ed4"],[]]},{"id":"a5e66103.6d2aa","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"Alexa Announcegarage","server":"","version":1,"debugenabled":true,"service_domain":"notify","service":"alexa_media_garage_echo_dot","entityId":"","data":"{\"message\":\"{{payload}}\",\"data\":{\"type\":\"announce\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1270,"y":780,"wires":[[]]},{"id":"e946b5e2.8d67d8","type":"function","z":"fec9b4e3.fe2c78","name":"side door boorbell","func":"var line1 = [\"Some one is ringing the side doorbell \" ]\n\nmsg.payload =\n\nline1[Math.floor(Math.random() * line1.length)]\n\n\nreturn msg\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":800,"wires":[["a5e66103.6d2aa"]]},{"id":"48c32bc3.da4ed4","type":"function","z":"fec9b4e3.fe2c78","name":"front door boorbell","func":"var line1 = [\"Some one is ringing the front doorbell \" ]\n\nmsg.payload =\n\nline1[Math.floor(Math.random() * line1.length)]\n\n\nreturn msg\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":740,"wires":[["a5e66103.6d2aa"]]},{"id":"8d76c970.d8d668","type":"inject","z":"fec9b4e3.fe2c78","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":760,"wires":[["6d6ead61.765fb4"]]},{"id":"ac37a1d3.8b1a8","type":"mqtt in","z":"fec9b4e3.fe2c78","name":"","topic":"tele/RF_Bridge/RESULT","qos":"2","datatype":"auto","broker":"28f8704b.3b96a","x":130,"y":60,"wires":[["f7af417.49940c"]]},{"id":"f7af417.49940c","type":"switch","z":"fec9b4e3.fe2c78","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"13FC0E","vt":"str"},{"t":"cont","v":"09940E","vt":"str"},{"t":"cont","v":"13FC0B","vt":"str"},{"t":"cont","v":"09940B","vt":"str"}],"checkall":"false","repair":false,"outputs":4,"x":130,"y":360,"wires":[["2cdcf18c.a6965e"],["74153ae5.d88f14","42b9a47c.d64a3c"],["4753bd55.9ceca4"],["601be633.9bb368"]]},{"id":"601be633.9bb368","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"Side doorbell tamper on my phone","server":"","version":1,"debugenabled":true,"service_domain":"notify","service":"mobile_app_pixel_2","entityId":"","data":"{\"message\":\"Someone is tampering with the driveway doorbell\",\"data\":{\"type\":\"tts\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1300,"y":600,"wires":[[]]},{"id":"4753bd55.9ceca4","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"Front doorbell tamper on my phone","server":"","version":1,"debugenabled":true,"service_domain":"notify","service":"mobile_app_pixel_2","entityId":"","data":"{\"message\":\"Someone is tampering with the front doorbell\",\"data\":{\"type\":\"tts\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1300,"y":660,"wires":[[]]},{"id":"c7a0282f.7c89b8","type":"api-call-service","z":"fec9b4e3.fe2c78","name":"","server":"","version":1,"debugenabled":false,"service_domain":"media_player","service":"play_media","entityId":"media_player.ramon_s_echo_plus","data":"{\"media_content_type\":\"sound\",\"message_content_id\":\"{{ payload }}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":450,"y":820,"wires":[[]]},{"id":"6d6ead61.765fb4","type":"change","z":"fec9b4e3.fe2c78","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"buzzers_pistols_01","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":760,"wires":[["c7a0282f.7c89b8"]]},{"id":"28f8704b.3b96a","type":"mqtt-broker","name":"","broker":"192.168.0.8","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment