Node-Red: Doorbell Cast Camera & Announce

Here’s a simple flow that will cast a selected camera to media player and announce a message. You can use whatever input you want or use when a doorbell is pressed. MQTT, Events, Input_boolean, etc… There’s also a node to adjust volume. The delay nodes with their current settings worked best for my google hub with not cutting off the announce and displaying the camera.

You can adjust the announce message to whatever you want.

I tried using blueprints, but I couldn’t get the announce message and camera on the media player. It was one or the other. Got it working with multiple devices. One announcing and one streaming. Should of started with Node-Red first. Way easier and faster.

[{"id":"23c1d9da.d6d746","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"c965ac72.bcba8","type":"api-call-service","z":"23c1d9da.d6d746","name":"Stream Camera","server":"72b2e838.1f3c58","version":1,"debugenabled":false,"service_domain":"camera","service":"play_stream","entityId":"camera.blueiris_driveway","data":"{\"media_player\":\"media_player.living_room_display\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":720,"y":160,"wires":[["75e4c1fc.6ddfd"]]},{"id":"68211b05.a21674","type":"inject","z":"23c1d9da.d6d746","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":80,"wires":[["36c86760.0c16f8"]]},{"id":"e0347c83.01021","type":"api-call-service","z":"23c1d9da.d6d746","name":"Media Stop","server":"72b2e838.1f3c58","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_stop","entityId":"media_player.living_room_display","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1030,"y":160,"wires":[[]]},{"id":"75e4c1fc.6ddfd","type":"delay","z":"23c1d9da.d6d746","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":880,"y":160,"wires":[["e0347c83.01021"]]},{"id":"4daf35b1.b1d53c","type":"api-call-service","z":"23c1d9da.d6d746","name":"Announce","server":"72b2e838.1f3c58","version":1,"debugenabled":false,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.living_room_display","data":"{\"message\":\"Damn! They found us!\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":160,"wires":[["d4c671d9.466cd"]]},{"id":"d4c671d9.466cd","type":"delay","z":"23c1d9da.d6d746","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":540,"y":160,"wires":[["c965ac72.bcba8"]]},{"id":"36c86760.0c16f8","type":"api-call-service","z":"23c1d9da.d6d746","name":"Volume","server":"72b2e838.1f3c58","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_display","data":"{\"volume_level\":0.8}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":100,"y":160,"wires":[["c355be42.f45dd"]]},{"id":"c355be42.f45dd","type":"delay","z":"23c1d9da.d6d746","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":160,"wires":[["4daf35b1.b1d53c"]]},{"id":"72b2e838.1f3c58","type":"server","name":"Home Assistant","addon":true}]
4 Likes

This is REALLY helpful and saved me lots of time researching this. Worked like a charm against my SONY TV and Google Chromecast. Thanks!

Amazing!

The question is whether it is possible to do the same in front of Alexa?

I have a camera and a bell outside the house. I want to broadcast a photo / video directly to Alexa. Is this possible?

1 Like

It works very well!!
i tried to do the same with snapshot, i don’t know why i can save a picture and it result empty, 0 kb.
save me please!!! :slight_smile:

Not sure if you found a solution but here are a couple different ways that I do it. You will of course have to modify the code to fit your use case.

Create a call service node to notify. This should take a snapshot of the camera without saving snapshot, then send it on to your phone.

{
   "message": "Front Door",
   "title": "Home Alarm Triggered",
   "data": {
       "sticky": "true",
       "ttl": 0,
       "priority": "high",
       "channel": "alarm_stream",
       "group": "Alarm",
       "icon_url": "https://github.com/home-assistant/home-assistant-assets/blob/master/logo-round-192x192.png?raw=true",
       "image": "/api/camera_proxy/camera.front_door_cam_profile000_mainstream",
       "clickAction": "/lovelace-phone/cameras",
       "notification_icon": "mdi:shield-alert"
    }
}

This second option will save the snapshot to your www folder, in the event you want the snapshot saved.

{"filename":"/config/www/garage_pic.jpg"}

then create a call service node to notify and put the following in the data section:

{
    "title": "Garage Door Open",
    "message": "The garage door is open.",
    "data": {
        "priority": "high",
        "ttl": 0,
        "tag": "garage",
        "image": "https://mynabucasaurl.ui.nabu.casa/local/garage_pic.jpg",
        "notification_icon": "mdi:garage-alert",
        "actions": [
            {
                "action": "close_garage",
                "title": "Close Garage Door"
            },
            {
                "action": "dismiss_garage",
                "title": "Dismiss"
            }
        ]
    }
}