Reolink Doorbell Chime on Google Home / Nest via Node-Red

Guides & How-tos
Reolink Doorbell Chime on Google Home / Nest via Node-Red

Posted May 7, 2023, 7:03 AM UTC

196
LoafdudeOP•

I needed more chimes and they are not available from Reolink

This flow listens for Onvif doorbell events and in turn casts a doorbell MP3 to my google home / nest minis.

Home minis also go to sleep so there is a loop to keep them awake (they have an annoying wake-up noise)

Uses the following libraries. All credit to them.

https://github.com/bartbutenaers/node-red-contrib-onvif-nodes

https://flows.nodered.org/node/node-red-contrib-cast

​

[{
"id": "199e98e.0fb5267",
"method": "get",
"name": "",
"swaggerDoc": "",
"type": "http in",
"upload": false,
"url": "/dingdong.mp3",
"wires": [["c3ea7088.ceec1"]],
"x": 910,
"y": 880,
"z": "60896766.db0898"
}, {
"filename": "/tmp/dingdong.mp3",
"format": "",
"id": "c3ea7088.ceec1",
"name": "",
"type": "file in",
"wires": [["397df9f6.e285f6"]],
"x": 1130,
"y": 880,
"z": "60896766.db0898"
}, {
"action": "",
"from": "",
"id": "397df9f6.e285f6",
"name": "Set Headers",
"property": "",
"reg": false,
"rules": [{
"p": "headers",
"pt": "msg",
"t": "set",
"to": "{}",
"tot": "json"
}, {
"p": "headers.content-type",
"pt": "msg",
"t": "set",
"to": "audio/mpeg",
"tot": "str"
}
],
"to": "",
"type": "change",
"wires": [["41d0ef77.4c65a"]],
"x": 1310,
"y": 880,
"z": "60896766.db0898"
}, {
"headers": {},
"id": "41d0ef77.4c65a",
"name": "",
"statusCode": "",
"type": "http response",
"wires": [],
"x": 1450,
"y": 880,
"z": "60896766.db0898"
}, {
"finalize": "",
"func": "msgs = []\nips = ['10.10.10.128', '10.10.10.99', '10.10.10.87']\nfor (var i = 0; i < ips.length; i++) {\nmsgs.push({'ip': ips[i]})\n}\nreturn [msgs];",
"id": "f80a9176.def63",
"initialize": "",
"name": "IPs to wake",
"noerr": 0,
"outputs": 1,
"type": "function",
"wires": [["eae9fcc3.e5b39"]],
"x": 1110,
"y": 940,
"z": "60896766.db0898"
}, {
"crontab": "",
"id": "f445b0c6.ee8d9",
"name": "Wake every 2 min",
"once": true,
"onceDelay": 0.1,
"payloadType": "str",
"props": [],
"repeat": "120",
"topic": "",
"type": "inject",
"wires": [["f80a9176.def63"]],
"x": 930,
"y": 940,
"z": "60896766.db0898"
}, {
"contentType": "",
"id": "eae9fcc3.e5b39",
"ip": "",
"language": "en",
"message": "",
"name": "Query",
"port": "",
"type": "cast-to-client",
"url": "",
"volume": "",
"wires": [["5a85f2bb.b5281c"]],
"x": 1250,
"y": 940,
"z": "60896766.db0898"
}, {
"finalize": "",
"func": "if (msg.payload.applications.length < 1) {\n// Google Home is Asleep\n// Waking makes a wakeup sound\n// Leave asleep and wake when next doorbell.\nreturn;\n} else if (msg.payload.applications[0]['statusText'] != \"Default Media Receiver\") {\n// Google Home is already casting - do not interupt it's cast.\nreturn;\n} else {\n// Google Home is awake and idle \n// Send blank TTS to keep it awake\nreturn {'ip': msg.ip, 'message': ' '};\n}",
"id": "5a85f2bb.b5281c",
"initialize": "",
"name": "Do not interupt",
"noerr": 0,
"outputs": 1,
"type": "function",
"wires": [["aede61f8.187e1"]],
"x": 1400,
"y": 940,
"z": "60896766.db0898"
}, {
"contentType": "",
"id": "aede61f8.187e1",
"ip": "",
"language": "en",
"message": "",
"name": "Wake",
"port": "",
"type": "cast-to-client",
"url": "",
"volume": "",
"wires": [[]],
"x": 1550,
"y": 940,
"z": "60896766.db0898"
}, {
"crontab": "",
"id": "d24f7050.8bd5b",
"name": "Start listening",
"once": true,
"onceDelay": "5",
"props": [],
"repeat": "86400",
"topic": "",
"type": "inject",
"wires": [["97d0eb18.a1ee08"]],
"x": 920,
"y": 780,
"z": "60896766.db0898"
}, {
"action": "",
"from": "",
"id": "97d0eb18.a1ee08",
"name": "",
"property": "",
"reg": false,
"rules": [{
"p": "action",
"pt": "msg",
"t": "set",
"to": "start",
"tot": "str"
}
],
"to": "",
"type": "change",
"wires": [["e9458eaa.d45b4"]],
"x": 1100,
"y": 780,
"z": "60896766.db0898"
}, {
"crontab": "",
"id": "55e40eba.19775",
"name": "Stop listening",
"once": false,
"onceDelay": 0.1,
"payload": "",
"payloadType": "date",
"repeat": "",
"topic": "",
"type": "inject",
"wires": [["3b192f32.da0b"]],
"x": 910,
"y": 820,
"z": "60896766.db0898"
}, {
"action": "",
"from": "",
"id": "3b192f32.da0b",
"name": "",
"property": "",
"reg": false,
"rules": [{
"p": "action",
"pt": "msg",
"t": "set",
"to": "stop",
"tot": "str"
}
],
"to": "",
"type": "change",
"wires": [["e9458eaa.d45b4"]],
"x": 1100,
"y": 820,
"z": "60896766.db0898"
}, {
"action": "",
"deviceConfig": "fe013234.748d6",
"id": "e9458eaa.d45b4",
"name": "",
"type": "onvif-events",
"wires": [["b8a6fb75.d6bc28"]],
"x": 1290,
"y": 780,
"z": "60896766.db0898"
}, {
"checkall": "true",
"id": "b8a6fb75.d6bc28",
"name": "",
"outputs": 1,
"property": "topic",
"propertyType": "msg",
"repair": false,
"rules": [{
"t": "eq",
"v": "RuleEngine/MyRuleDetector/Visitor",
"vt": "str"
}
],
"type": "switch",
"wires": [["9526130c.79b8f"]],
"x": 1430,
"y": 780,
"z": "60896766.db0898"
}, {
"checkall": "true",
"id": "9526130c.79b8f",
"name": "",
"outputs": 1,
"property": "data.value",
"propertyType": "msg",
"repair": false,
"rules": [{
"t": "true"
}
],
"type": "switch",
"wires": [["4cf4791f.5d21d8"]],
"x": 1550,
"y": 780,
"z": "60896766.db0898"
}, {
"contentType": "audio/mpeg",
"id": "19ad0959.462f37",
"ip": "10.10.10.87",
"language": "en",
"message": "",
"name": "",
"port": "",
"type": "cast-to-client",
"url": "http://node-red:1880/dingdong.mp3",
"volume": "",
"wires": [[]],
"x": 1740,
"y": 940,
"z": "60896766.db0898"
}, {
"contentType": "audio/mpeg",
"id": "80148271.3b878",
"ip": "10.10.10.99",
"language": "en",
"message": "",
"name": "",
"port": "",
"type": "cast-to-client",
"url": "http://node-red:1880/dingdong.mp3",
"volume": "",
"wires": [[]],
"x": 1740,
"y": 860,
"z": "60896766.db0898"
}, {
"contentType": "audio/mpeg",
"id": "c77802bd.bc12d",
"ip": "10.10.10.128",
"language": "en",
"message": "",
"name": "",
"port": "",
"type": "cast-to-client",
"url": "http://node-red:1880/dingdong.mp3",
"volume": "",
"wires": [[]],
"x": 1740,
"y": 900,
"z": "60896766.db0898"
}, {
"drop": true,
"id": "4cf4791f.5d21d8",
"name": "",
"nbRateUnits": "5",
"pauseType": "rate",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"rate": "1",
"rateUnits": "second",
"timeout": "5",
"timeoutUnits": "seconds",
"type": "delay",
"wires": [["80148271.3b878", "c77802bd.bc12d", "19ad0959.462f37"]],
"x": 1700,
"y": 780,
"z": "60896766.db0898"
}, {
"checkConnectionInterval": "5",
"id": "fe013234.748d6",
"name": "Doorbell",
"port": "8000",
"timeout": "10",
"type": "onvif-config",
"xaddress": "10.10.10.187",
"z": ""
}
]
4
mnpg_fr•

Great job u/Loafdude! Thanks for sharing it.

2
mediaserver8•

So I made the Alexa version, with a few extra features like the ability to voice select which devices the notifications play on;

An alterative Alexa announcement solution for Reolink doorbells : reolinkcam (reddit.com)

3
mediaserver8•

Trying to modify this to work with Alexa, but the OnVif Events node is crashing Nodered with a 'create pull-point subscription first' error as described here;

You should create pull-point subscription first · Issue #28 · bartbutenaers/node-red-contrib-onvif-nodes · GitHub

Looks like the onvif-nodes is not maintained.

Did you encounter this issue and, if so, how did you get around it?

2
mediaserver8•

Ah! Figured it out. Its necessary to set up a user in the Reolink device and use those credentials in the Device Setup inside the OnVif Events node. Simples.

Hope that helps someone.

2
LoafdudeOP•

Nice thanks for sharing the fix.

1
southaussiewaddy•

This is awesome! Nice work mate, when I get sometime I’ll try this. Thanks for sharing

2
MakeMoneyHustle•

Oh wow, any way this can work on Sonos?

1
LoafdudeOP•

Can you Chromecast to a Sonos? If so, it might.

2
Jieterpan96•

Really nice! Do you also know if you could use a cast node to tell a google nest hub to show the live view of the camera?

1
LoafdudeOP•

I don't have a nest hub. I'm unaware of it's capabilities

1