dinki / View-Assist

View Assist provides visual feedback for the Home Assistant Assist Voice Assistant
76 stars 5 forks source link

To do Item: Microphone mutes on restart #18

Closed dinki closed 2 weeks ago

dinki commented 2 weeks ago

Any time HA restarts the SA microphone goes mute. An automation needs to be written to determine if the mic state is muted and if the satellite devices attribute shows that it should not be muted then toggle the mic back on.

Automation should look through the entire group of VA devices to determine and action.

mngarchow commented 2 weeks ago

Ok so to make sure I understand, here is some pseudo code.

If the StreamAssist Mic is in the off position Then                    (depending on the answer to the question below, this might just be one IF check)
    If any of the devices in the group ViewAssist_Satellites is set to muted (which entity is this?)
         Do nothing
    Else
         turn the StreamAssist mic back on
    End If
Else
     Do nothing
End If

Each VA device can be set to mute/unmute, but StreamAssist only has one mic setting. So is your intention that if any of the devices are muted, StreamAssist mic should stay off? Then once all devices are unmute, it is okay to turn the StreamAssist mic back on?

dinki commented 2 weeks ago

@mngarchow

https://community.home-assistant.io/t/condition-with-selector-boolean-in-blueprint/514683

I think this is the way to do it. define the boolean in the template part, trigger on HA start, condition trigger for when boolen is true for user preference to do this or not, then the condition check on the mic device and then turn it back on. A lot of words but seems pretty easy.

Do you want to try and add this to the control blueprint? Understood if you don't have time.

dinki commented 2 weeks ago

I'm close to finished on this one.

dinki commented 2 weeks ago

This has been updated and is ready for testing. Works for me and will close if no comments in the near future.

https://github.com/dinki/View-Assist/blob/main/View%20Assist%20control%20automations/blueprint-devicecontrol.yaml

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

mngarchow commented 2 weeks ago

Tested and working. The mic portion was much simpler than I thought you wanted.

dinki commented 2 weeks ago

Yeah it can be expanded later but for now I think this will ensure that HA restart don't cause the device to be unresponsive due to muted mic.

Thanks for confirming. Closing this one.