Doorbell flow with wavenet voice and Home Assistant video notification

Doorbell flow that sends a Home Assistant mobile notification with a live video feed to your phone or tablet and plays a custom Google Wavenet voice message to your Sonos and Google Cast devices. Please note that live video notifications are currently only supported with Home Assistant iOS app.

Flow flow

As seen above, my doorbell simply sends a payload to the MQTT topic "doorbell". The MQTT node is easily replaced by an Event state node, deCONZ in node, Flic node, etc, depending on your setup.

If you are satisfied with the regular node-red-contrib-cast voices and only use Google Cast devices, this flow mainly contains irrelevant nodes. Take a look at my simpler doorbell flow instead.


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

Remember to add your camera to Home Assistant and install the required nodes before importing this flow into Node-RED (check out Node types box on this page)

[{"id":"fd3c412a.4ab0b","type":"tab","label":"Doorbell","disabled":false,"info":""},{"id":"4229af7b.0db6c","type":"inject","z":"fd3c412a.4ab0b","name":"Add new","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":220,"wires":[["36ecd1a0.abc08e"]]},{"id":"c58fb0f5.6e72c","type":"wavenet","z":"fd3c412a.4ab0b","name":"Wavenet","key":"","voice":"emma","rate":"1.0","pitch":"0","volume":"0","sample":"24000","encoding":"MP3","x":490,"y":220,"wires":[["9b8c0038.b92ca"]]},{"id":"9b8c0038.b92ca","type":"file","z":"fd3c412a.4ab0b","name":"","filename":"/data/doorbell.mp3","appendNewline":false,"createDir":true,"overwriteFile":"true","encoding":"none","x":670,"y":180,"wires":[["113ca7d1.7bf0a8"]]},{"id":"542f3815.0520b8","type":"http in","z":"fd3c412a.4ab0b","name":"","url":"/doorbell.mp3","method":"get","upload":false,"swaggerDoc":"","x":100,"y":320,"wires":[["7a30796b.ac1c88"]]},{"id":"7a30796b.ac1c88","type":"file in","z":"fd3c412a.4ab0b","name":"","filename":"/data/doorbell.mp3","format":"","chunk":false,"sendError":false,"x":300,"y":320,"wires":[["fa4903a8.b2628"]]},{"id":"fa4903a8.b2628","type":"http response","z":"fd3c412a.4ab0b","name":"","statusCode":"","headers":{"content-type":"audio/mpeg"},"x":460,"y":320,"wires":[]},{"id":"48345991.529248","type":"mqtt in","z":"fd3c412a.4ab0b","name":"","topic":"doorbell","qos":"2","datatype":"auto","broker":"","x":70,"y":420,"wires":[["9f976aef.ea3c48","50312f24.c6103","1b3c2556.b6bbdb"]]},{"id":"7d823ba0.80eed4","type":"inject","z":"fd3c412a.4ab0b","name":"Test","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":480,"wires":[["9f976aef.ea3c48","50312f24.c6103","1b3c2556.b6bbdb"]]},{"id":"63f3d6ad.2768e8","type":"comment","z":"fd3c412a.4ab0b","name":"Wavenet - Sign in to Google Developer Console to get a Speech API key","info":"","x":270,"y":180,"wires":[]},{"id":"6464caf4.c5ecf4","type":"comment","z":"fd3c412a.4ab0b","name":"store voice message OR bell sound locally","info":"","x":740,"y":140,"wires":[]},{"id":"6b41e2da.42b8bc","type":"comment","z":"fd3c412a.4ab0b","name":"Make local voice message or bell sound available to your smart speakers","info":"","x":270,"y":280,"wires":[]},{"id":"923baf3a.aac58","type":"comment","z":"fd3c412a.4ab0b","name":"notify.mobile_app_<name of your device>","info":"","x":440,"y":630,"wires":[]},{"id":"113ca7d1.7bf0a8","type":"cast-to-client","z":"fd3c412a.4ab0b","name":"insert your own ip here","url":"http://192.168.3.62:1880/doorbell.mp3","contentType":"audio/mp3","message":"","language":"da","ip":"192.168.3.67","port":"","volume":"30","x":770,"y":220,"wires":[[]]},{"id":"f96f50f4.d6c3e","type":"comment","z":"fd3c412a.4ab0b","name":"Send video notification via the Home Assistant app","info":"","x":470,"y":540,"wires":[]},{"id":"9f976aef.ea3c48","type":"trigger","z":"fd3c412a.4ab0b","op1":"{\"url\":\"http://192.168.3.62:1880/doorbell.mp3\",\"contentType\":\"audio/mp3\",\"volume\":80}","op2":"{\"volume\":30}","op1type":"json","op2type":"json","duration":"7","extend":true,"units":"s","reset":"","bytopic":"all","name":"notify + reset volume","x":380,"y":480,"wires":[["5dad0477.4c6d5c"]]},{"id":"5dad0477.4c6d5c","type":"cast-to-client","z":"fd3c412a.4ab0b","name":"","url":"","contentType":"","message":"","language":"","ip":"192.168.3.67","port":"","volume":"","x":620,"y":480,"wires":[[]]},{"id":"50312f24.c6103","type":"change","z":"fd3c412a.4ab0b","name":"notify + reset volume","rules":[{"t":"set","p":"payload","pt":"msg","to":"http://192.168.3.62:1880/doorbell.mp3","tot":"str"},{"t":"set","p":"volume","pt":"msg","to":"80","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":420,"wires":[["87e0da7f.88bf48"]]},{"id":"eff147c4.eae348","type":"http request","z":"fd3c412a.4ab0b","name":"bell sound from url","method":"GET","ret":"bin","paytoqs":false,"url":"http://soundbible.com/mp3/Two%20Tone%20Doorbell-SoundBible.com-1238551671.mp3","tls":"","persist":false,"proxy":"","authType":"","x":420,"y":140,"wires":[["9b8c0038.b92ca"]]},{"id":"46e19bf2.fc77f4","type":"inject","z":"fd3c412a.4ab0b","name":"Download","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":140,"wires":[["eff147c4.eae348"]]},{"id":"efbbd68d.670068","type":"comment","z":"fd3c412a.4ab0b","name":"Play voice message or bell sound","info":"","x":140,"y":380,"wires":[]},{"id":"7e25abaf.813ed4","type":"comment","z":"fd3c412a.4ab0b","name":"Download doorbell sound or wavenet spoken message","info":"","x":210,"y":100,"wires":[]},{"id":"8738502d.c5936","type":"comment","z":"fd3c412a.4ab0b","name":"Link to latest version of this flow: https://flows.nodered.org/flow/4d671620b09ef7042a6577dcbd813d68","info":"","x":360,"y":40,"wires":[]},{"id":"36ecd1a0.abc08e","type":"function","z":"fd3c412a.4ab0b","name":"Spoken message here","func":"msg.payload = \"<emphasis>Someone rang the doorbell</emphasis><break time='100ms'/><emphasis level='strong'>Maybe it's pizza!</emphasis>\"\n\nreturn msg;","outputs":1,"noerr":0,"x":310,"y":220,"wires":[["c58fb0f5.6e72c"]]},{"id":"1b3c2556.b6bbdb","type":"api-call-service","z":"fd3c412a.4ab0b","name":"mobile notification with camera feed","server":"","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_<insert_name_of_your_mobile_device_here>","entityId":"","data":"{\"data\":{\"attachment\":{\"content-type\":\"jpeg\"},\"entity_id\":\"camera.hoveddor_http_stream\",\"push\":{\"category\":\"camera\"},\"sticky\":true},\"message\":\"Press and hold for live video feed\",\"title\":\"Someone rang the doorbell\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":430,"y":580,"wires":[[]]},{"id":"a298c51e.edb5a8","type":"comment","z":"fd3c412a.4ab0b","name":"use your own Node-RED IP","info":"","x":400,"y":380,"wires":[]},{"id":"1af01347.8e6fcd","type":"comment","z":"fd3c412a.4ab0b","name":"use your own IP/config","info":"","x":630,"y":380,"wires":[]},{"id":"87e0da7f.88bf48","type":"sonos-universal","z":"fd3c412a.4ab0b","confignode":"","compatibilityMode":false,"command":"group.play.notification","state":"","stateType":"str","name":"","x":630,"y":420,"wires":[[]]}]

Flow Info

Created 5 years, 5 months ago
Updated 5 years, 2 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • comment (x10)
  • file (x1)
  • file in (x1)
  • function (x1)
  • http in (x1)
  • http request (x1)
  • http response (x1)
  • inject (x3)
  • mqtt in (x1)
  • trigger (x1)
Other

Tags

  • Doorbell
  • HomeAssistant
  • Hassio
  • notification
  • wavenet
  • google
  • cast
  • mqtt
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option