hassio-addons/addon-node-red

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:

  1. It prevents me from having to add a new node for every new speaker
  2. 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:

  1. have two or more speakers
  2. add a flow that sends a tts call to media_player.all_speakers and then performs an action after
  3. 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).


:wave: Thanks for opening your first issue here! If you're reporting a :bug: bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be useful.

posted by addons-assistant[bot] almost 5 years ago

The problem I'm running into is two fold.

And unfortunately, both aren't an add-on problem.

First, home assistant can occasionally "lose" speakers until the instance is restarted.

If you consider that a bug, that specific part should be filed with Home Assistant.

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).

That is an implementation issues/decision on the Node-RED Home Assistant Node.

From an add-on perspective, there is nothing I can do about either of those. Please report this with the appropriate projects.

Thanks 👍

posted by frenck almost 5 years ago

Thank you for the response.

Can I get clarification on the last part. I think I'm suggesting a functional change that would allow the user to choose between two options for the node (continue execution on failure or don't). Are you saying this is the wrong forum to ask for that, or are you saying that this is the correct place but the decision has been made not to do that?

If this is the correct place, I'd just like to point out that what I'm suggesting would allow for it to be an optional decision. That way if there's a node in this sort of situation, and you need to do cleanup on failure, then this leaves an option to allow execution to continue. It wouldn't prevent any of the current behavior.

posted by cmgerdes almost 5 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

posted by addons-assistant[bot] almost 5 years ago

Fund this Issue

$0.00
Funded

Pull requests