Doorbell Sequence Advice

Hi, I’m very new to Node-RED and having great fun learning. I’ve been trying to work on a pretty typical sequence for a Doorbell chime.

I’ve used a lot of information from this post.

Basically it boils down to:

  1. Doorbell pressed
  2. Capture current volume of all Alexa devices
  3. Increase Volume to 90% for all Alexa devices
  4. Play Chime
  5. Revert Volume back

I have managed to achieve this (after an embarrassing amount of time figuring it out) with the following:

[{"id":"393db8d.1060848","type":"api-current-state","z":"6c7101b0.e0c0a","name":"Echo Show Volume?","server":"bcca64cb.debed8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.george_s_echo_show","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":620,"wires":[["2346232e.a7630c"]]},{"id":"2346232e.a7630c","type":"change","z":"6c7101b0.e0c0a","name":"Extract Current Volume","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.attributes.volume_level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":620,"wires":[["7d88e206.6a978c"]]},{"id":"5b70f2f7.eec36c","type":"api-call-service","z":"6c7101b0.e0c0a","name":"Increase Vol. to 90%","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","data":"{\"volume_level\":\"0.9\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":700,"y":860,"wires":[["f474c76e.3548d8"]]},{"id":"6ef2e671.997bb8","type":"api-call-service","z":"6c7101b0.e0c0a","name":"Revert Vol.","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo_show","data":"{\"volume_level\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1110,"y":620,"wires":[[]]},{"id":"f474c76e.3548d8","type":"api-call-service","z":"6c7101b0.e0c0a","name":"Play Chime","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"play_media","entityId":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","data":"{\"media_content_id\":\"amzn_sfx_doorbell_chime_01\",\"media_content_type\":\"sound\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":970,"y":860,"wires":[[]]},{"id":"7d88e206.6a978c","type":"delay","z":"6c7101b0.e0c0a","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":940,"y":620,"wires":[["6ef2e671.997bb8"]]},{"id":"e1ad8bc8.459ac8","type":"api-current-state","z":"6c7101b0.e0c0a","name":"Echo Volume?","server":"bcca64cb.debed8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.george_s_echo","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":680,"wires":[["6ff5f09b.dd361"]]},{"id":"80d9862f.a02cc8","type":"api-current-state","z":"6c7101b0.e0c0a","name":"Echo Dot Volume?","server":"bcca64cb.debed8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.george_s_echo_dot","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":470,"y":740,"wires":[["8783ccd9.a7497"]]},{"id":"9a17f5f7.2d7918","type":"api-current-state","z":"6c7101b0.e0c0a","name":"Sonos Volume?","server":"bcca64cb.debed8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.george_s_sonos_one","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":800,"wires":[["4ebbd74e.4c8248"]]},{"id":"6ff5f09b.dd361","type":"change","z":"6c7101b0.e0c0a","name":"Extract Current Volume","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.attributes.volume_level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":680,"wires":[["91c6387d.3f9148"]]},{"id":"8783ccd9.a7497","type":"change","z":"6c7101b0.e0c0a","name":"Extract Current Volume","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.attributes.volume_level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":740,"wires":[["df96f779.f0bcb8"]]},{"id":"4ebbd74e.4c8248","type":"change","z":"6c7101b0.e0c0a","name":"Extract Current Volume","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.attributes.volume_level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":800,"wires":[["e989936.ab50c7"]]},{"id":"cf84316b.e8add","type":"api-call-service","z":"6c7101b0.e0c0a","name":"Revert Vol.","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo","data":"{\"volume_level\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1110,"y":680,"wires":[[]]},{"id":"91c6387d.3f9148","type":"delay","z":"6c7101b0.e0c0a","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":940,"y":680,"wires":[["cf84316b.e8add"]]},{"id":"f2b8d75a.0329b8","type":"api-call-service","z":"6c7101b0.e0c0a","name":"Revert Vol.","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo_dot","data":"{\"volume_level\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1110,"y":740,"wires":[[]]},{"id":"df96f779.f0bcb8","type":"delay","z":"6c7101b0.e0c0a","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":940,"y":740,"wires":[["f2b8d75a.0329b8"]]},{"id":"4bd2d0ce.adf9c","type":"api-call-service","z":"6c7101b0.e0c0a","name":"Revert Vol.","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_sonos_one","data":"{\"volume_level\":\"{{payload}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1110,"y":800,"wires":[[]]},{"id":"e989936.ab50c7","type":"delay","z":"6c7101b0.e0c0a","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":940,"y":800,"wires":[["4bd2d0ce.adf9c"]]},{"id":"9d5a44d.6f3f5b8","type":"delay","z":"6c7101b0.e0c0a","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":450,"y":860,"wires":[["5b70f2f7.eec36c"]]},{"id":"85319993.09ff38","type":"server-events","z":"6c7101b0.e0c0a","name":"Doorbell Press","server":"bcca64cb.debed8","event_type":"doorbird_doorbell_button","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":120,"y":740,"wires":[["393db8d.1060848","e1ad8bc8.459ac8","9a17f5f7.2d7918","80d9862f.a02cc8","9d5a44d.6f3f5b8","2906112a.a4694e"]]},{"id":"2906112a.a4694e","type":"api-call-service","z":"6c7101b0.e0c0a","name":"Alert TV","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"notify","service":"lounge_tv","entityId":"","data":"{\"message\":\"Doorbell\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":440,"y":920,"wires":[[]]},{"id":"bcca64cb.debed8","type":"server","name":"Home Assistant","addon":true}]

However, I don’t think its the most efficient way of doing things, so it would be great to get some feedback from more experienced users. I feel like things could be condensed more with a function node, but I do like the visibility of the current setup.

Speed is the most important factor, and naturally grabbing the volume attribute of each device does slow things down a little when compared to going direct to a call service node, I’ve tried to mitigate this by using a very short delay before running the Increase Vol. to 90% node. Do you think this is best or would it just be as fast (or faster) to have the Increase Vol. to 90% node triggered by the payload from the Extract Current Volume nodes?

Also, its a bit of a bodge with the 4 second delay, it would be cleaner to have a the Revert Vol. nodes kick in after the chime has played but I’m not entirely sure how to set that up.

And finally, as for the Doorbell Press ‘events: all’ node; is it best practice to avoid this node when possible? Would an events state node be a faster (or perhaps less resource heavy) option? The only issue I have with the events state node is that I’m using the Doorbird Integration which triggers an event on doorbell press so doesn’t have an entity that I could use, so I’m unsure on how that would work.

Any feedback would be greatly appreciated, thanks.

G

Multiple current-state nodes really aren’t slowing you down. They don’t make a call to HA as they just search the cached value that is already stored in NR.

Using the events all node is a valid option for this use case.


None of these examples are tested.

Here’s one of using the get-entities node and some message variables to cut down on the number of nodes used but it’s purely cosmetic compared to your version.

[{"id":"52aa9190.67a2d","type":"api-call-service","z":"ffbd7f06.4a014","name":"Increase Vol. to 90%","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","data":"{\"volume_level\":\"0.9\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":548,"y":1776,"wires":[["e8b85db4.88bee"]]},{"id":"e8b85db4.88bee","type":"api-call-service","z":"ffbd7f06.4a014","name":"Play Chime","version":1,"debugenabled":false,"service_domain":"media_player","service":"play_media","entityId":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","data":"{\"media_content_id\":\"amzn_sfx_doorbell_chime_01\",\"media_content_type\":\"sound\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":758,"y":1776,"wires":[[]]},{"id":"7ca0c10b.f9bbf","type":"api-call-service","z":"ffbd7f06.4a014","name":"Revert Vol.","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"{{payload.entity_id}}","data":"{\"volume_level\":\"{{payload.attributes.volume_level}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":758,"y":1728,"wires":[[]]},{"id":"dcd295ac.17f758","type":"delay","z":"ffbd7f06.4a014","name":"","pauseType":"delay","timeout":"4","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":508,"y":1728,"wires":[["7ca0c10b.f9bbf"]]},{"id":"28c2b712.38a4b8","type":"delay","z":"ffbd7f06.4a014","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":342,"y":1776,"wires":[["52aa9190.67a2d"]]},{"id":"69adf73c.11b108","type":"server-events","z":"ffbd7f06.4a014","name":"Doorbell Press","event_type":"doorbird_doorbell_button","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":144,"y":1728,"wires":[["28c2b712.38a4b8","970b23ad.317b3","d567be61.c5b67"]]},{"id":"970b23ad.317b3","type":"api-call-service","z":"ffbd7f06.4a014","name":"Alert TV","version":1,"debugenabled":false,"service_domain":"notify","service":"lounge_tv","entityId":"","data":"{\"message\":\"Doorbell\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":332,"y":1824,"wires":[[]]},{"id":"d567be61.c5b67","type":"ha-get-entities","z":"ffbd7f06.4a014","name":"","rules":[{"property":"entity_id","logic":"includes","value":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":342,"y":1728,"wires":[["dcd295ac.17f758"]]}]

Here’s a version trying to remove the need for the 4-second delay. The 250ms delay might need to be increased or removed.

[{"id":"5f913f38.4990f","type":"api-call-service","z":"5f457227.97f8dc","name":"Revert Vol.","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"{{payload.entity_id}}","data":"{\"volume_level\":\"{{payload.volume_level}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1606,"y":1360,"wires":[[]]},{"id":"d8f4e50c.d3d9c8","type":"server-events","z":"5f457227.97f8dc","name":"Doorbell Press","event_type":"doorbird_doorbell_button","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":144,"y":1360,"wires":[["d5a91ca5.c3611","7f704902.084028"]]},{"id":"d5a91ca5.c3611","type":"api-call-service","z":"5f457227.97f8dc","name":"Alert TV","version":1,"debugenabled":false,"service_domain":"notify","service":"lounge_tv","entityId":"","data":"{\"message\":\"Doorbell\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":316,"y":1408,"wires":[[]]},{"id":"2a1af24f.63fffe","type":"ha-get-entities","z":"5f457227.97f8dc","name":"","rules":[{"property":"entity_id","logic":"includes","value":"devices","valueType":"msg"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":486,"y":1360,"wires":[["33dce0e1.a54ac"]]},{"id":"7f704902.084028","type":"change","z":"5f457227.97f8dc","name":"set devices","rules":[{"t":"set","p":"devices","pt":"msg","to":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":326,"y":1360,"wires":[["2a1af24f.63fffe"]]},{"id":"26ed74e7.e8dc8c","type":"api-call-service","z":"5f457227.97f8dc","name":"Increase Vol. to 90%","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","data":"{\"volume_level\":\"0.9\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1012,"y":1360,"wires":[["2de0cae9.cdd6c6"]]},{"id":"2de0cae9.cdd6c6","type":"api-call-service","z":"5f457227.97f8dc","name":"Play Chime","version":1,"debugenabled":false,"service_domain":"media_player","service":"play_media","entityId":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","data":"{\"media_content_id\":\"amzn_sfx_doorbell_chime_01\",\"media_content_type\":\"sound\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1190,"y":1360,"wires":[["4b727c81.b41b84"]]},{"id":"4b727c81.b41b84","type":"delay","z":"5f457227.97f8dc","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1334,"y":1360,"wires":[["3eaf489b.c735c8"]]},{"id":"33dce0e1.a54ac","type":"change","z":"5f457227.97f8dc","name":"Extract Current Volume","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t   \"entity_id\": payload.entity_id,\t   \"volume_level\": payload.attributes.volume_level\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":686,"y":1360,"wires":[["40f16373.149eec"]]},{"id":"40f16373.149eec","type":"join","z":"5f457227.97f8dc","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":850,"y":1360,"wires":[["26ed74e7.e8dc8c"]]},{"id":"3eaf489b.c735c8","type":"split","z":"5f457227.97f8dc","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1472,"y":1360,"wires":[["5f913f38.4990f"]]}]

and here’s a version using a function node

[{"id":"394b7ff9.312dd","type":"function","z":"ffbd7f06.4a014","name":"Extract Current Volume","func":"const states = global.get(\"homeassistant\").homeAssistant;\nconst devices = [\n    'media_player.george_s_echo_show', \n    'media_player.george_s_echo_dot', \n    'media_player.george_s_echo', \n    'media_player.george_s_sonos_one'\n];\nconst volumeLevels = {};\ndevices.forEach(d => {\n    volumeLevels[d] = states[d].attributes.volume_level;\n})\nmsg.payload = volumeLevels;\nmsg.devices = devices.join(\",\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":334,"y":2816,"wires":[["9edcacb1.524c5"]]},{"id":"dd831b40.936cd8","type":"server-events","z":"ffbd7f06.4a014","name":"Doorbell Press","event_type":"doorbird_doorbell_button","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":112,"y":2816,"wires":[["45d99e3e.7da46","394b7ff9.312dd"]]},{"id":"9edcacb1.524c5","type":"api-call-service","z":"ffbd7f06.4a014","name":"Increase Vol. to 90%","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"{{devices}}","data":"{\"volume_level\":\"0.9\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":564,"y":2816,"wires":[["757bc51c.62101c"]]},{"id":"757bc51c.62101c","type":"api-call-service","z":"ffbd7f06.4a014","name":"Play Chime","version":1,"debugenabled":false,"service_domain":"media_player","service":"play_media","entityId":"{{devices}}","data":"{\"media_content_id\":\"amzn_sfx_doorbell_chime_01\",\"media_content_type\":\"sound\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":758,"y":2816,"wires":[["8f3bacc9.aa25a"]]},{"id":"8f3bacc9.aa25a","type":"delay","z":"ffbd7f06.4a014","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":918,"y":2816,"wires":[["f1c011df.c792c"]]},{"id":"d403a05c.b3657","type":"api-call-service","z":"ffbd7f06.4a014","name":"Revert Vol.","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"{{entity_id}}","data":"{\"volume_level\": {{payload}} }","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1238,"y":2816,"wires":[[]]},{"id":"45d99e3e.7da46","type":"api-call-service","z":"ffbd7f06.4a014","name":"Alert TV","version":1,"debugenabled":false,"service_domain":"notify","service":"lounge_tv","entityId":"","data":"{\"message\":\"Doorbell\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":284,"y":2864,"wires":[[]]},{"id":"5bc52994.e2f8e8","type":"comment","z":"ffbd7f06.4a014","name":"delay needed?","info":"","x":928,"y":2768,"wires":[]},{"id":"f1c011df.c792c","type":"split","z":"ffbd7f06.4a014","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"entity_id","x":1074,"y":2816,"wires":[["d403a05c.b3657"]]}]

edit:

I don’t use echos but if the state of the echo changes when playing the chime you could use a wait-until node after the Play Chime call-service node to check if the state is idle then continue with reverting the sound levels.

Wow, thanks Kermit. Appreciate the feedback and the work put in!

And thanks for providing all the different sequences already done, I’m going to play around with these and see what works best timing wise.

Have a great weekend!

So I played around with a few options and believe I’ve found a clean way to ensure that the volume reverts back once the chime has sounded. There is still a 4 second delay as this about the same amount of time it takes to play the ding dong sound, I got around this by using the node-red-contrib-hold module.

Also I didn’t originally consider that if music was playing then it would crank the volume to 9 before chiming, which had a WAF (technically GAF in my case) of about -3. So I have accounted for that in the flow I am currently using.

Thanks for the suggestion here Kermit but unfortunately this method wasnt viable when I relised I needed to account for music playing too.

[{"id":"393db8d.1060848","type":"api-current-state","z":"6c7101b0.e0c0a","d":true,"g":"2f40ed0c.ebc662","name":"Echo Show: status?","server":"bcca64cb.debed8","version":1,"outputs":2,"halt_if":"playing","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.george_s_echo_show","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":400,"y":100,"wires":[["b612e6bd.3086f8"],["2346232e.a7630c"]]},{"id":"2346232e.a7630c","type":"change","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Extract Current Volume","rules":[{"t":"set","p":"volume","pt":"msg","to":"data.attributes.volume_level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":120,"wires":[["6e53dbff.d14ba4"]]},{"id":"5b70f2f7.eec36c","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Increase Vol. to 90%","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","data":"{\"volume_level\":\"0.9\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":600,"wires":[["f474c76e.3548d8"]]},{"id":"6ef2e671.997bb8","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Revert Vol.","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo_show","data":"{\"volume_level\":\"{{volume}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1250,"y":100,"wires":[["7b4626bc.c98888"]]},{"id":"f474c76e.3548d8","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Play Chime","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"play_media","entityId":"media_player.george_s_echo_show, media_player.george_s_echo_dot, media_player.george_s_echo, media_player.george_s_sonos_one","data":"{\"media_content_id\":\"amzn_sfx_doorbell_chime_01\",\"media_content_type\":\"sound\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":590,"y":600,"wires":[["e10f357c.cd55b8"]]},{"id":"e1ad8bc8.459ac8","type":"api-current-state","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Echo: playing?","server":"bcca64cb.debed8","version":1,"outputs":2,"halt_if":"playing","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.george_s_echo","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":true,"x":380,"y":200,"wires":[["974053e0.83e14"],["6ff5f09b.dd361"]]},{"id":"80d9862f.a02cc8","type":"api-current-state","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Echo Dot: playing?","server":"bcca64cb.debed8","version":1,"outputs":2,"halt_if":"playing","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.george_s_echo_dot","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":true,"x":390,"y":320,"wires":[["8c5c2662.edda38"],["8783ccd9.a7497"]]},{"id":"9a17f5f7.2d7918","type":"api-current-state","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Sonos: playing?","server":"bcca64cb.debed8","version":1,"outputs":2,"halt_if":"playing","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.sonos","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":true,"x":380,"y":440,"wires":[["ec026a84.4d8658"],["4ebbd74e.4c8248"]]},{"id":"6ff5f09b.dd361","type":"change","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Extract Current Volume","rules":[{"t":"set","p":"volume","pt":"msg","to":"data.attributes.volume_level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":240,"wires":[["af2c6e2e.de4a1"]]},{"id":"8783ccd9.a7497","type":"change","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Extract Current Volume","rules":[{"t":"set","p":"volume","pt":"msg","to":"data.attributes.volume_level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":360,"wires":[["7301fd65.894e44"]]},{"id":"4ebbd74e.4c8248","type":"change","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Extract Current Volume","rules":[{"t":"set","p":"volume","pt":"msg","to":"data.attributes.volume_level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":480,"wires":[["1142526.1d205ae"]]},{"id":"cf84316b.e8add","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Revert Vol.","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo","data":"{\"volume_level\":\"{{volume}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1250,"y":200,"wires":[["23eaba46.1fa1a6"]]},{"id":"f2b8d75a.0329b8","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Revert Vol.","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_echo_dot","data":"{\"volume_level\":\"{{volume}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1250,"y":320,"wires":[["68ee91a.841057"]]},{"id":"2906112a.a4694e","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Alert TV","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"notify","service":"lounge_tv","entityId":"","data":"{\"message\":\"Doorbell\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":360,"y":520,"wires":[[]]},{"id":"3ec7412d.02f54e","type":"server-events","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Doorbell Press","server":"bcca64cb.debed8","event_type":"doorbird_doorbell_button","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":120,"y":320,"wires":[["393db8d.1060848","e1ad8bc8.459ac8","80d9862f.a02cc8","9a17f5f7.2d7918","2906112a.a4694e","8a5bec33.4fc19"]]},{"id":"c893d950.6ef068","type":"comment","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Ding Dong to Alexa's on Press","info":"","x":160,"y":60,"wires":[]},{"id":"8a5bec33.4fc19","type":"delay","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":255,"y":600,"wires":[["5b70f2f7.eec36c"]],"l":false},{"id":"ec026a84.4d8658","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"YES: Pause","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_pause","entityId":"media_player.sonos","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":420,"wires":[["4ebbd74e.4c8248"]]},{"id":"5d2c730.622b18c","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Revert Vol.","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.george_s_sonos_one","data":"{\"volume_level\":\"{{volume}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1250,"y":440,"wires":[["e454bd9f.6a209"]]},{"id":"e454bd9f.6a209","type":"switch","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Was it playing?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"playing","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1440,"y":440,"wires":[["77cfcb2d.1bb2f4"]]},{"id":"77cfcb2d.1bb2f4","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"YES: Resume playing","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_play","entityId":"media_player.sonos","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1660,"y":440,"wires":[[]]},{"id":"1142526.1d205ae","type":"hold","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Hold Until Chimed","x":1050,"y":440,"wires":[["5d2c730.622b18c"]]},{"id":"8c5c2662.edda38","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"YES: Pause","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_pause","entityId":"media_player.george_s_echo_dot","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":300,"wires":[["8783ccd9.a7497"]]},{"id":"974053e0.83e14","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"YES: Pause","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_pause","entityId":"media_player.george_s_echo","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":180,"wires":[["6ff5f09b.dd361"]]},{"id":"b612e6bd.3086f8","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"YES: Pause","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_pause","entityId":"media_player.george_s_echo_show","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":60,"wires":[["2346232e.a7630c"]]},{"id":"6e53dbff.d14ba4","type":"hold","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Hold Until Chimed","x":1050,"y":100,"wires":[["6ef2e671.997bb8"]]},{"id":"af2c6e2e.de4a1","type":"hold","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Hold Until Chimed","x":1050,"y":200,"wires":[["cf84316b.e8add"]]},{"id":"7301fd65.894e44","type":"hold","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Hold Until Chimed","x":1050,"y":320,"wires":[["f2b8d75a.0329b8"]]},{"id":"7dd44c3c.13ad44","type":"change","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Release Hold","rules":[{"t":"set","p":"trigger","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":600,"wires":[["1142526.1d205ae","af2c6e2e.de4a1","7301fd65.894e44"]]},{"id":"68ee91a.841057","type":"switch","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Was it playing?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"playing","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1440,"y":320,"wires":[["a43c890f.24d048"]]},{"id":"23eaba46.1fa1a6","type":"switch","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Was it playing?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"playing","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1440,"y":200,"wires":[["fbd0745.1cb6588"]]},{"id":"7b4626bc.c98888","type":"switch","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"Was it playing?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"playing","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1440,"y":100,"wires":[["c8e3a6c6.fc16e8"]]},{"id":"a43c890f.24d048","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"YES: Resume playing","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_play","entityId":"media_player.sonos","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1660,"y":320,"wires":[[]]},{"id":"fbd0745.1cb6588","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"YES: Resume playing","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_play","entityId":"media_player.george_s_echo","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1660,"y":200,"wires":[[]]},{"id":"c8e3a6c6.fc16e8","type":"api-call-service","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"YES: Resume playing","server":"bcca64cb.debed8","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_play","entityId":"media_player.george_s_echo_show","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1660,"y":100,"wires":[[]]},{"id":"e10f357c.cd55b8","type":"delay","z":"6c7101b0.e0c0a","g":"2f40ed0c.ebc662","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":695,"y":600,"wires":[["7dd44c3c.13ad44"]],"l":false},{"id":"bcca64cb.debed8","type":"server","name":"Home Assistant","addon":true}]

All the state nodes have ‘Block Input Overrides’ selected, as without this the payload remains to be the data from the doorbird_doorbell_button event rather than a payload that contains the current volume (or at least that’s my understanding of what’s happening here).

Just thought I would share this in case anyone else came across this thread looking for ideas.

Two tolerable issues remain:

  1. The Sonos and Alexa Show both play an annoying volume change beep each time the level is adjusted (hence why the Echo show part is disabled). I dont believe there is any kind of work around for this though.

  2. There is a bit of a (variable) lag from the doorbell press to the actual chime, somewhere between 3-7 seconds, the TV alert is instance though as no need to wait for volume adjusting. Potentially this might be shortened if I tried host Node-RED on my PC rather than a HA but I don’t know whether it will, or if it would be worth the migration.

@gmoney
Hi
I just installed my doorbird today and added the Integration to HA
I’m able to see the camera and trigger the relay too
I would like now through nodeRed to define some specific fucntions when the Ring Button is pressed
I read a lot of post and even imported your NodeRed Flow to see how you did, but I was not able to manage how to get a Doorbird Event (like the Ring Button pressed)
Could you please explain me step by step what’s the procedure ?

Thanks

regards

After a lot of posts reading, i was able to understand the process. I’m now able to get events like ‘Button Pressed’ or "Relay trigger’, etc…
I used then the Browser_mod to open a popup windows when someone ring. That Popup windows is displaying the Video stream into a Picture Glance Card (which include a button to trigger the relay)

Hey isaste,

Glad to you read you got your setup sorted in the end. I havent heard of the Browser_mod, maybe ill look into it, does it work on the mobile app too?

If you imported the flow OK then I guess it was related to the naming of your events, for my setup I use the following integration options:

image

Then these are prefixed with ‘doorbird_doorbell_’ in Node Red, so its looking for a ‘doorbird_doorbell_button’ event as the trigger.

I worked out what the event name was out by listening to all events in developer tools and then actually pressing the doorbell.

I didn’t test it on mobile app, but only on a Tablet running on Android
I will try it and will let you know

With it, I’m able to get a full screen Popup windows of my Doodrbird when someone ring
I also used another feature of that Broswer_Mod which is the “navigate” one, which allow to force my table to change it’s HA Page to another one.

Just tried it on mobile app and it works too
I checked the DeviceId through the custom:browser-player on tne Mobile App
Then I execute the service below from Developer Tool on my main HA system
Result is that on thr Mobile App which was open, hte Doorbird Camera Popup !!

title: Popup example
card:
  type: picture-glance
  title: Doorbird
  entities:
    - entity: switch.doorbird_relay_1
      icon: 'mdi:lock-open'
  camera_image: camera.doorbird_live
  camera_view: live

deviceID:
  - 37056xxx-b376dxxx    <=== put here your own DeviceID (the one for the Mobile App)

large: true
hide_header: false
auto_close: false

Great, thanks for checking it out and sharing your config, I’ll be giving this a try!