NEST HUB AND RING DOORBELL

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

Post Reply
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

NEST HUB AND RING DOORBELL

Post by pvklink »

For those who are interested, I made a "Ring doorbell".
I used a lot of scripts made by others and integrated them.
My solution is a compex one, uses:
- domoticz, dzvents
- mqtt
- node-red, some nodes
- apache

But a good scripter can scripts this all in dzvents, so that seems to be an easier road to follow then my infra, but in my case that was already there..
I will attach a screendump and a dump of the flow in node-red (for the dzvents scripters among us...)

How it works:
1. Ring the doorbell ( a wifi doorbell from action)
2. Node-red via mqtt cathes this on signal and starts a flow
3. The flow speaks (The doorbell is ringing on my nest hub)
4. the flow grabs every 5 seconds a image off my webcam (9 euros sonoff) and sends the link to my NEST HUB.
The nest hub grabs the image via the received link from the apache server
5. After a minute the last image stays fixed on the screen of the NEST HUB for a minute
6. Nest hub will be put in normal mode (alternative is say ok google stop..)
7. All the images are stored on a local folder on my rpi and are synchronised to my nas (NAS is not always on, only daytime)
8. So no payed services, and everything local

PM: the included flow uses a injector to trigger the flow. Normally this will be triggered by a received message from the doorbell via mqtt/domoticz in nodered...

Code: Select all

[{"id":"a8421a83.69ae9","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"6c9aedc7.a2fa84","type":"http request","z":"a8421a83.69ae9","name":"CAM image","method":"GET","ret":"bin","paytoqs":false,"url":"https://192.168.20.52/cgi-bin/currentpic.cgi","tls":"","persist":false,"proxy":"","authType":"basic","x":350,"y":280,"wires":[["6925251.73bb1dc"]]},{"id":"6925251.73bb1dc","type":"file","z":"a8421a83.69ae9","name":"Save image","filename":"/media/pi/motionfiles/BEL_CAMERA_STRAAT.jpg","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":530,"y":280,"wires":[["4dea3766.1dade8"]]},{"id":"1abdb333.75914d","type":"function","z":"a8421a83.69ae9","name":"Send image","func":"msg = \n{\n  host: \"192.168.20.37\",\n  payload: {\n    type: \"MEDIA\",\n    media: {\n      url: \"http://192.168.20.35/myimages/\"+ msg.payload,\n      title: \"Voordeur\", // optional unless desired\n    }\n  }\n};\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":180,"wires":[["c43b3e55.a29598"]]},{"id":"c7f9bc91.dfd4","type":"delay","z":"a8421a83.69ae9","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":340,"y":180,"wires":[["6c9aedc7.a2fa84"]]},{"id":"82d9eea4.ad3a18","type":"delay","z":"a8421a83.69ae9","name":"","pauseType":"delay","timeout":"60","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":520,"y":460,"wires":[["71802469.831bdc"]]},{"id":"71802469.831bdc","type":"function","z":"a8421a83.69ae9","name":"Close Nest Hub","func":"msg = \n{\n  host: \"192.168.20.37\",\n  payload: {\n    type: \"CLOSE\",\n  }\n};\n\n\nreturn msg;\n","outputs":1,"noerr":0,"x":700,"y":460,"wires":[["c43b3e55.a29598"]]},{"id":"c43b3e55.a29598","type":"castv2-sender","z":"a8421a83.69ae9","name":"Google Home Hub","host":"","x":1070,"y":80,"wires":[[]]},{"id":"a531dd28.a8bff","type":"function","z":"a8421a83.69ae9","name":"Voice message","func":"msg = \n{\n  host: \"192.168.20.37\",\n  payload: {\n    type: \"TTS\",\n    text: \"Er wordt gebeld\",\n    speed: 1, // optional to adjust TTS speed, defaults to 1\n    language: \"nl\", // optional to set TTS language, default to en\n    title: \"Voordeur\", // optional unless desired\n  }\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":80,"wires":[["c43b3e55.a29598","c7f9bc91.dfd4"]]},{"id":"4dea3766.1dade8","type":"function","z":"a8421a83.69ae9","name":"Random filename","func":"// this function generates a randomized file name as gate_YYYYMMDDHHMMSS.jpg\nvar now = new Date();\nvar yyyy = now.getFullYear();\nvar mm = now.getMonth() < 9 ? \"0\" + (now.getMonth() + 1) : (now.getMonth() + 1); // getMonth() is zero-based\nvar dd  = now.getDate() < 10 ? \"0\" + now.getDate() : now.getDate();\nvar hh = now.getHours() < 10 ? \"0\" + now.getHours() : now.getHours();\nvar mmm  = now.getMinutes() < 10 ? \"0\" + now.getMinutes() : now.getMinutes();\nvar ss  = now.getSeconds() < 10 ? \"0\" + now.getSeconds() : now.getSeconds();\nnode.status({fill:\"blue\",shape:\"ring\",text:\"Date: \"+dd + \".\" + mm + \".\" + yyyy + \" \" + hh + \":\" + mmm + \":\" + ss});\n\nmsg.payload = \"BEL_CAMERA_STRAAT_\" + dd + \"-\" + mm + \"-\" + yyyy + \":\" + hh + \":\" + mm + \":\" + ss + \".jpg\";\n\nreturn msg;","outputs":1,"noerr":0,"x":710,"y":280,"wires":[["fc2939f6.1fc1b8","1abdb333.75914d"]]},{"id":"fda4abc9.e309e","type":"comment","z":"a8421a83.69ae9","name":"Voice announcement","info":"","x":640,"y":60,"wires":[]},{"id":"1f0b0c6b.c31874","type":"comment","z":"a8421a83.69ae9","name":"Display image on the Home Hub","info":"Set the delay to a time it takes for the NAS upload or the file copy to complete\nAlso adjust the URL in the function node to point to the correct URL\nCheck the debug node to see errors returned by Home Hub","x":750,"y":140,"wires":[]},{"id":"3189ba6c.8f0ad6","type":"comment","z":"a8421a83.69ae9","name":"Return to the default screen","info":"Go back to the default screen (image rotator) after some time","x":920,"y":460,"wires":[]},{"id":"60e4d27f.94571c","type":"exec","z":"a8421a83.69ae9","command":"","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":1110,"y":280,"wires":[[],[],["6af71b94.d66724"]]},{"id":"fc2939f6.1fc1b8","type":"function","z":"a8421a83.69ae9","name":"Random filename","func":"a = msg.payload\nmsg.payload = \"mv /media/pi/motionfiles/BEL_CAMERA_STRAAT.jpg \" + \"/media/pi/motionfiles/\" + a\n\nreturn msg;","outputs":1,"noerr":0,"x":930,"y":280,"wires":[["60e4d27f.94571c"]]},{"id":"59f22372.ff24fc","type":"inject","z":"a8421a83.69ae9","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":280,"wires":[["a531dd28.a8bff"]]},{"id":"6af71b94.d66724","type":"repeat","z":"a8421a83.69ae9","name":"repeat","repetitions":"12","elseOutput":true,"outputs":2,"x":330,"y":360,"wires":[["4d798177.b4bc58"],["82d9eea4.ad3a18"]]},{"id":"4d798177.b4bc58","type":"delay","z":"a8421a83.69ae9","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":520,"y":360,"wires":[["6c9aedc7.a2fa84"]]},{"id":"f42aa152.dee9e","type":"comment","z":"a8421a83.69ae9","name":"Aantal nodes slopen de repeatstatus","info":"Go back to the default screen (image rotator) after some time","x":770,"y":360,"wires":[]}]
deurbel.jpg
deurbel.jpg (248.74 KiB) Viewed 1063 times
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
User avatar
FireWizard
Posts: 1968
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: NEST HUB AND RING DOORBELL

Post by FireWizard »

Hi,

Nice solution.

I also assume that your issue, posted: https://www.domoticz.com/forum/viewtopi ... 21&t=31210, has been solved.

You may want to look to these options as well.
https://www.domoticz.com/forum/viewtopi ... 21&t=31210

This is what I use to present both the Domoticz screens and the camera streams to the Google Nest Hub.

Also the user DewGew has an alternative: https://github.com/DewGew/Domoticz-Google-Assistant
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest