Using that testing version you posted, I get this result:
debug_info: UPnP not detected
I am using UPnP on my OPNsense router but it’s not working correctly and I don’t have the networking know-how to fix it… networking is not really my forte.
I appreciate you helping me debug this. Is there somewhere I can donate to you to buy you a coffee or something?
To be honest I’m not too worried about the snapshot/restore functionality not working, I think I have some workarounds in my lovelace UI and a node red flow that still provides the same functionality, I’ve been working on it all week instead of actually working
The top two media player cards are media_player.spotify players for myself and my wife, and the next four are media_player.linkplayer players for each device.
In terms of automation, here is my node-red flow if anyone else is interested. I have three subflows: the first checks if media is playing either on any rokus or two spotify instances for myself or my wife and saves the state of each device to a variable. The second subflow does all of the checks (am I on a conference call, is an input_boolean for TTS notifications on, etc.) and actually calls the service to send the TTS notification. The final subflow checks each device’s previous state and restarts playback if it was playing previously.
Note that in the living room, both the roku and linkplay are attached to the same sound bar as different sources. I have to change the source on the soundbar (vizio soundcast plugin) before sending the TTS notification and then change the source back before resuming any playback.
Flow:
Check Media Status Subflow:
[{"id":"a85d05ef.d790d8","type":"switch","z":"b422b1d5.42072","name":"Check LR Roku","property":"lr_roku_status","propertyType":"global","rules":[{"t":"eq","v":"playing","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":800,"y":140,"wires":[["1faa15a5.3e8292"],["42a0d435.d7d094"]]},{"id":"1faa15a5.3e8292","type":"api-call-service","z":"b422b1d5.42072","name":"Pause Roku Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"remote","service":"send_command","entityId":"remote.roku_lr","data":"{\"command\":\"play\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1020,"y":100,"wires":[["82488a23.ca0858"]]},{"id":"82488a23.ca0858","type":"api-call-service","z":"b422b1d5.42072","name":"Set Soundbar Source - AUX","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"media_player","service":"select_source","entityId":"media_player.vizio_living_room","data":"{\"entity_id\":\"media_player.vizio_living_room\",\"source\":\"AUX\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1280,"y":140,"wires":[["42a0d435.d7d094"]]},{"id":"e01492fb.8ed9c8","type":"switch","z":"b422b1d5.42072","name":"Check Bedroom Roku","property":"bedroom_roku_status","propertyType":"global","rules":[{"t":"eq","v":"playing","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":820,"y":320,"wires":[["1601e892.14b10f"],["42a0d435.d7d094"]]},{"id":"1601e892.14b10f","type":"api-call-service","z":"b422b1d5.42072","name":"Pause Roku Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"remote","service":"send_command","entityId":"remote.roku_bedroom","data":"{\"command\":\"play\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1040,"y":280,"wires":[["42a0d435.d7d094"]]},{"id":"29d7faf3.bbe8ce","type":"switch","z":"b422b1d5.42072","name":"Check Den Roku","property":"den_roku_status","propertyType":"global","rules":[{"t":"eq","v":"playing","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":810,"y":240,"wires":[["734115cd.d71e44"],["42a0d435.d7d094"]]},{"id":"734115cd.d71e44","type":"api-call-service","z":"b422b1d5.42072","name":"Pause Roku Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"remote","service":"send_command","entityId":"remote.40_tcl_roku_tv","data":"{\"command\":\"play\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1020,"y":200,"wires":[["42a0d435.d7d094"]]},{"id":"24ebc1c4.c1fc8e","type":"change","z":"b422b1d5.42072","name":"Set LR Roku Status Context","rules":[{"t":"set","p":"lr_roku_status","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":140,"wires":[["a85d05ef.d790d8"]]},{"id":"288a8029.edf77","type":"change","z":"b422b1d5.42072","name":"Set Den Roku Status Context","rules":[{"t":"set","p":"den_roku_status","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":240,"wires":[["29d7faf3.bbe8ce"]]},{"id":"ef5f3be7.39e1d8","type":"change","z":"b422b1d5.42072","name":"Set Bedroom Roku Status Context","rules":[{"t":"set","p":"bedroom_roku_status","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":320,"wires":[["e01492fb.8ed9c8"]]},{"id":"f9284486.f8355","type":"api-current-state","z":"b422b1d5.42072","name":"Get LR Roku State","server":"9e1e946a.079518","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.roku_lr","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":270,"y":140,"wires":[["24ebc1c4.c1fc8e"]]},{"id":"614980b9.515ca","type":"api-current-state","z":"b422b1d5.42072","name":"Get Den Roku State","server":"9e1e946a.079518","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.40_tcl_roku_tv","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":280,"y":240,"wires":[["288a8029.edf77"]]},{"id":"28b1288e.9bd438","type":"api-current-state","z":"b422b1d5.42072","name":"Get Bedroom Roku State","server":"9e1e946a.079518","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.roku_bedroom","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":290,"y":320,"wires":[["ef5f3be7.39e1d8"]]},{"id":"42a0d435.d7d094","type":"join","z":"b422b1d5.42072","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"5","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1690,"y":260,"wires":[[]]},{"id":"f3995341.d045c","type":"api-current-state","z":"b422b1d5.42072","name":"Get peetipablo Spotify State","server":"9e1e946a.079518","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.spotify_peetipablo","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":300,"y":400,"wires":[["b995f7fd.485b38"]]},{"id":"434d3201.8b6344","type":"api-current-state","z":"b422b1d5.42072","name":"Get theheartsublime Spotify State","server":"9e1e946a.079518","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"media_player.spotify_theheartsublime","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":320,"y":480,"wires":[["f595926b.e3295"]]},{"id":"b995f7fd.485b38","type":"change","z":"b422b1d5.42072","name":"Set Spotify Status Context","rules":[{"t":"set","p":"sp_peetipablo_status","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":400,"wires":[["6c15148d.20accc"]]},{"id":"f595926b.e3295","type":"change","z":"b422b1d5.42072","name":"Set Spotify Status Context","rules":[{"t":"set","p":"sp_theheartsublime_status","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":480,"wires":[["bf56ba46.902a8"]]},{"id":"6c15148d.20accc","type":"switch","z":"b422b1d5.42072","name":"Check Peetipablo Spotify","property":"sp_peetipablo_status","propertyType":"global","rules":[{"t":"eq","v":"playing","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":830,"y":400,"wires":[["87e42ea5.163ae"],["42a0d435.d7d094"]]},{"id":"87e42ea5.163ae","type":"api-call-service","z":"b422b1d5.42072","name":"Pause Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_pause","entityId":"media_player.spotify_peetipablo","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1040,"y":360,"wires":[["42a0d435.d7d094"]]},{"id":"bf56ba46.902a8","type":"switch","z":"b422b1d5.42072","name":"Check theheartsublime Spotify","property":"sp_theheartsublime_status","propertyType":"global","rules":[{"t":"eq","v":"playing","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":850,"y":480,"wires":[["2cf48478.8f6ad4"],["42a0d435.d7d094"]]},{"id":"2cf48478.8f6ad4","type":"api-call-service","z":"b422b1d5.42072","name":"Pause Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_pause","entityId":"media_player.spotify_theheartsublime","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1060,"y":420,"wires":[["42a0d435.d7d094"]]},{"id":"9e1e946a.079518","type":"server","z":"","name":"Home Assistant","addon":true}]
TTS Notification Subflow:
[{"id":"60db8635.f62a58","type":"function","z":"7b7f94f1.e3eb14","name":"Set Speech Payload","func":"const message = (msg.payload && msg.payload.message) || \"Automation provided no message\";\nvar now = new Date().toLocaleString(\"en-GB\");\n\nnode.status({ fill: \"green\", shape: \"dot\", text: \"TTS message: \" + message + \" - \" + now });\nreturn {\n payload:{\n data: {\n message: message,\n language: \"en\"\n }\n }\n};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":740,"y":100,"wires":[["f4701f1f.e8ceb"]]},{"id":"2a0ab5b9.1994ba","type":"api-current-state","z":"7b7f94f1.e3eb14","name":"Speech Notifications?","server":"9e1e946a.079518","version":1,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.voice_notifications","state_type":"habool","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":420,"y":140,"wires":[["e08969a9.63ee6"],[]],"outputLabels":["","enabled"]},{"id":"d647562e.8d1398","type":"function","z":"7b7f94f1.e3eb14","name":"Check for overrides","func":"const alwaysSpeak = msg.payload && msg.payload.urgent\nnode.status({ fill: \"green\", shape: \"dot\", text: alwaysSpeak });\nif (alwaysSpeak) {\n return [msg, null];\n} else {\n return [null, msg];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","x":210,"y":100,"wires":[["60db8635.f62a58"],["2a0ab5b9.1994ba"]],"outputLabels":["Bypass notification","Check for notifications"]},{"id":"e08969a9.63ee6","type":"api-current-state","z":"7b7f94f1.e3eb14","name":"Work Mode OFF?","server":"9e1e946a.079518","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.work_mode","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":410,"y":240,"wires":[["60db8635.f62a58"],[]],"outputLabels":["","enabled"]},{"id":"f4701f1f.e8ceb","type":"api-call-service","z":"7b7f94f1.e3eb14","name":"Send Speech Notification","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.linkplay_den","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1010,"y":100,"wires":[["d269dacd.b09318"]]},{"id":"d269dacd.b09318","type":"delay","z":"7b7f94f1.e3eb14","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1220,"y":100,"wires":[[]]},{"id":"9e1e946a.079518","type":"server","z":"","name":"Home Assistant","addon":true}]
Resume Media Subflow:
[{"id":"86b35f79.2e90d8","type":"switch","z":"9949c1df.df6f2","name":"Check LR Roku","property":"lr_roku_status","propertyType":"global","rules":[{"t":"eq","v":"unavailable","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":580,"y":60,"wires":[["b66303f0.cdd35"],["a0283b78.191db8"]]},{"id":"e47e5c89.f11f1","type":"api-call-service","z":"9949c1df.df6f2","name":"Resume Roku Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"remote","service":"send_command","entityId":"remote.roku_lr","data":"{\"command\":\"play\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1190,"y":260,"wires":[["b66303f0.cdd35"]]},{"id":"ee7173c.5de159","type":"delay","z":"9949c1df.df6f2","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1000,"y":200,"wires":[["e47e5c89.f11f1"]]},{"id":"50c4e7e7.3f8818","type":"switch","z":"9949c1df.df6f2","name":"Check Bedroom Roku","property":"bedroom_roku_status","propertyType":"global","rules":[{"t":"eq","v":"unavailable","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":600,"y":400,"wires":[["b66303f0.cdd35"],["225af727.f3d438"]]},{"id":"225af727.f3d438","type":"api-call-service","z":"9949c1df.df6f2","name":"Resume Roku Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"remote","service":"send_command","entityId":"remote.roku_bedroom","data":"{\"command\":\"play\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":830,"y":440,"wires":[["b66303f0.cdd35"]]},{"id":"6f2e9ecb.2ef1b","type":"switch","z":"9949c1df.df6f2","name":"Check Den Roku","property":"den_roku_status","propertyType":"global","rules":[{"t":"eq","v":"unavailable","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":300,"wires":[["b66303f0.cdd35"],["83428750.baba6"]]},{"id":"83428750.baba6","type":"api-call-service","z":"9949c1df.df6f2","name":"Resume Roku Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"remote","service":"send_command","entityId":"remote.40_tcl_roku_tv","data":"{\"command\":\"play\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":830,"y":340,"wires":[["b66303f0.cdd35"]]},{"id":"a0283b78.191db8","type":"api-call-service","z":"9949c1df.df6f2","name":"Set Soundbar Source - Optical","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"media_player","service":"select_source","entityId":"media_player.vizio_living_room","data":"{\"entity_id\":\"media_player.vizio_living_room\",\"source\":\"Optical\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":810,"y":140,"wires":[["ee7173c.5de159"]]},{"id":"b66303f0.cdd35","type":"join","z":"9949c1df.df6f2","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"5","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1850,"y":320,"wires":[[]]},{"id":"55c4d5ff.bb4794","type":"switch","z":"9949c1df.df6f2","name":"Check Peetipablo Spotify","property":"sp_peetipablo_status","propertyType":"global","rules":[{"t":"eq","v":"playing","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":640,"wires":[["2043704a.222f6"],["b66303f0.cdd35"]]},{"id":"2dbaf8a5.b9335","type":"switch","z":"9949c1df.df6f2","name":"Check Theheartsublime Spotify","property":"sp_theheartsublime_status","propertyType":"global","rules":[{"t":"eq","v":"playing","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":880,"wires":[["ec067ee.fe4ca"],["b66303f0.cdd35"]]},{"id":"d6613646.f62158","type":"api-call-service","z":"9949c1df.df6f2","name":"Resume Spotify Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_play","entityId":"media_player.spotify_peetipablo","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":520,"wires":[["b66303f0.cdd35"]]},{"id":"e2fff7bb.1c6d08","type":"api-call-service","z":"9949c1df.df6f2","name":"Resume Spotify Playback","server":"9e1e946a.079518","version":1,"debugenabled":false,"service_domain":"media_player","service":"media_play","entityId":"media_player.spotify_theheartsublime","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":720,"wires":[["b66303f0.cdd35"]]},{"id":"ec067ee.fe4ca","type":"delay","z":"9949c1df.df6f2","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":720,"y":720,"wires":[["e2fff7bb.1c6d08"]]},{"id":"2043704a.222f6","type":"delay","z":"9949c1df.df6f2","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":720,"y":520,"wires":[["d6613646.f62158"]]},{"id":"8172f4c0.1f7fd8","type":"change","z":"9949c1df.df6f2","name":"Clear Payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":460,"wires":[["6f2e9ecb.2ef1b","86b35f79.2e90d8","50c4e7e7.3f8818","55c4d5ff.bb4794","2dbaf8a5.b9335"]]},{"id":"9e1e946a.079518","type":"server","z":"","name":"Home Assistant","addon":true}]