Wake word via web browser?

I’ve seen the guide to setting up wake-word detection with the M5 Atom Echo hardware, but is there a reason the HA front-end couldn’t be configured to handle wake-word detection from a local microphone through the browser?

On my Windows 10 machine, I am able to navigate to my HA front-end in a browser and click the little assist button in the corner, and then click the microphone to send a voice request to HA Assist. Is there a way to do this with a wake-word if I just leave my browser open? And if not, what’s stopping that functionality from happening? Is it a security issue with allowing a browser constant access to the microphone or something else?

Could that functionality even be developed for HA in a browser? I’m mostly just trying to understand why this would have been developed for the M5 Atom Echo device before just setting this up through the web front-end? I honestly know next to nothing about web development… so pardon my ignorance… I was just curious if anyone knows the development hurdles for something like this?

Yes. Browsers do not allow microphones to listen over http. It has to be https. So nothing has been developed as local HA access is very often http.

Mobile applications do not have this same restriction and the HA compaion app may support this in future.

Is there any reason this can’t be done over https though? I have https for my instance and would love the ability to use browser-based wake words.

2 Likes

Supporting a wake word on the web is (in my opinion) completely unrelated to whether https is required. From a browser perspective, once https is enabled, nothing is stopping a website from indefinitely accessing the microphone.

This can be proven by opening the following link, allowing access to the microphone, and leaving the page open. Microphone | Web Audio API

Therefore, the limitation of lack of wake word support is squarely in the implementation of the Home Assistant web UI, not a browser API issue.

I would also be curious about adding support for this, as even Home Assistant Assist - Desktop doesn’t handle wake words.

1 Like

Your opinion is wrong. As even a cursory web search would have confirmed. e.g. https://blog.mozilla.org/webrtc/camera-microphone-require-https-in-firefox-68/

HTTPS is required and HA is (by default) delivered via HTTP.

Microphone access requires a secure context, yes - but the HA web UI already supports a microphone (and correctly requires https), so mentioning it as a blocker for supporting wake words feels a little disingenuous. If we were talking about introducing mic support at all, sure. I’d agree - but that’s not the topic.

You could say “a HA instance is unlikely to have a secure context, therefore adding wake word support feels unnecessary”, which is a valid opinion to have. I was simply attempting to clarify that difference for aaaaa, and anyone else coming across this thread.

I’ve just checked the HA frontend repo, and it looks like nobody has attempted wake word support on the web yet. So it’s theoretically possible, but I’d agree unlikely.
Generally, it seems the more recommended method is to use wyoming satellite, though that’s only really supported on Linux at this time.

1 Like

The default instal is local only and http.

Home assistant web UI already has a button for listening that doesn’t work on http which means that its not against any rules or practices to allow microphone support for those who have https enabled.

I see most users as using http being irrelevant, I’d argue that a lot of people would switch to https if they could get this feature and using https is trivial to do there’s even an addon with a wizard.

When web wake word becomes a standard feature, any smartphone or tablet can become a smart assistant and the goal of replacing alexa and google home becomes that much closer.