Single google home speaker service call failure for all_speakers causes entire flow to fail #551
cmgerdes posted onGitHub
Problem/Motivation
I have numerous google home speakers around the house. I have flows set up for announcements (such as my security system). When using these flows I need to activate the speakers, set the volume to 100%, perform the announcement, set the volume back to where it was.
In order to accomplish this, I use the call to media_player.all_speakers. This accomplishes 2 things:
- It prevents me from having to add a new node for every new speaker
- When performing the announcement, it ensures all speakers say the announcement at the same time.
(Why the issue was filed)
The problem I'm running into is two fold. First, home assistant can occasionally "lose" speakers until the instance is restarted. secondly, Node-red does not handle a failed service call cleanly, existing the flow entirely on first failure rather than continuing to execute (since all other speakers do perform the announcement).
Expected behavior
(What you expected to happen) I expect node red to either continue execution after a failed node, or to allow me to indicate on the node that execution should continue despite a service call failure.
Actual behavior
(What actually happened) Node red fails out and stops the flow, leaving my speakers in a bad state (incorrect volume).
Steps to reproduce
(How can someone else make/see it happen) The key is to cause a service call failure. The below should work:
- have two or more speakers
- add a flow that sends a tts call to media_player.all_speakers and then performs an action after
- Disconnect one speaker from power and try again.
This should cause a service call failure. The flow will exit rather than continuing onto the next node.
Proposed changes
(If you have a proposed change, workaround or fix, describe the rationale behind it)
I would propose adding a checkbox to the node that allows you to indicate that the flow should continue in the case of a service call failure. This would allow critical nodes to fail execution (so bad things don't happen if an execution continues after failure), but would also allow non-critical failures to not prevent execution (where you need to get things back into a good state).