Mute my TV when hotword is recognized

Hi there,

i am having a big wish for my snips. For me the hotword detection with “Hey Snips” works very reliable, even in noisy environments. But if it is noisy, i have lots of trouble that Snips does not recognize the actual intent. If i ask e.g. “Hey Snips” … “switch the kitchen light on”, it happens very often that Hey Snips is recognized but the command is not and i just get back an error.

For me it would be brilliant, if i can mute my TV when the hotword is detected and unmute it after the command has been received.

Any ideas, how to get this working?

Cheers
Andreas

If you have something like a logi harmony hub you could achieve this very easily over nodered. Just create a flow that subscribes to the hotword detected hermes topic on mqtt and than a harmony node to send the mute and after a timer unmute command to you TV. Nodered is great and easy to learn for cross platform integration like this.
Johannes

Interesting topic :slight_smile:

Any chance to be able to do it by only sbscribing to MQTT topic?
I’ve seen that it is possible to check wake word detection : hermes/hotword/<WAKEWORD_ID>/detected
(ref here : https://docs.snips.ai/reference/hermes#detecting-a-wake-word)

Not sure which topic is informing the end of sound capture then…
My guess would be to sbscribe to “hermes/asr/textCaptured” and when something is published then it means the capture is ended (and therefore sound turned on again :slight_smile: )

Or maybe “hermes/tts/sayFinished” (here : https://docs.snips.ai/reference/hermes#being-notified-when-tts-has-finished-speaking-some-text) that will somehow notify of end of snips answer.

Other solution might be : https://docs.snips.ai/reference/hermes#being-notified-when-a-sound-frame-is-captured

or even : https://docs.snips.ai/reference/hermes#being-notified-when-a-sound-frame-is-captured

pleinty of solutions to get there through MQTT I think.
Sorry it is a little bit messy and random…

Maybe a suggestion on how to do it the best way?

Anyhwo I’m not sure on how coding that into python or whatever :slight_smile:

Ok looking a little bit more into it, I would go for a detection of all Wake word for muting and a detection of the end of ASR text capture for unmuting.
That would match with a subscirption to following topics :
‘hermes/hotword/#/detected’ (using the # wildcard to get all the wake words)
‘hermes/asr/textCaptured’

I owuld need some help regarding the subscirption to those topics in an action.py.
Usually I have something like this :

if name == “main”:
mqtt_opts = MqttOptions()
with Hermes(mqtt_options=mqtt_opts) as h:
h.subscribe_intents(intent_callback).start()

Is a command like that would work:
h.subscribe_hotword_#_detected(intent_callback).start()
h.subscribe_asr_textCaptured(intent_callback).start()

Not sure of what I’m doing there and even less about typo… or is that absolutely nonsense?
It owuld be weird to have “intent_callback” in that, but on another hand I don’t know how to handle a link to some function in the code without a call through “intent_callback”…
Defenetely not a coding guy :slight_smile: :slight_smile:

Hey there,

actually i found a way to get the trick done with the snips App FHEM from Thyraz. Actually FHEM is an open source smarthome solution: the FHEM UI has a low WAF (woman acceptance factor) but besides that it works very well and i really like FHEM, cause it integrates very nicely with many smarthome products and also with MQTT.

Using this App and FHEM it is just a one liner as the App as such detects already when snips is listening. In case somebody is interested i can share the details.

Cheers
Andreas

Good for you :slight_smile:

On my side I achieved that with a little python script that monitor “hermes/hotword/default/detected” and “hermes/asr/textCaptured” topics and send a mute and unmute on messages posted on those topics :slight_smile:

that’s avoiding another interface/program to handle all that ( already dealing with SNIPS and Domoticz interface at the moment :wink: )
So i’m done with that!
Tested and approved yesterday evening, getting the WAF agreement :slight_smile: :slight_smile: :slight_smile:

2 Likes

@Loky31 Hey, maybe it is even better to take hermes/dialogue/sessionEnded instead of hermes/asr/textCaptured, because then you would here the answers from apps and after that the TV will mute again.
:wink:

Hello @atomix,

I’ve tried that but for some reason it seems that the ‘hermes/dialogue/sessionEnded’ is not working …

I really have no clue for what reason it works just fine with the ‘hermes/asr/textCaptured’ (it detects messages) and not with the other topic…

Ok found why :slight_smile:

The right topic is ’ hermes/dialogueManager/sessionEnded’

:slight_smile:

And yeah works good :v:

1 Like

is there a guide on how to do this?

Hum it will depend on how you set the mute to your TV :slight_smile:

On my side it’s handled through Domoticz. I can imagine that some TV have direct command to do so.

i am using home assistant, when i subscribe to “hermes/hotword/default/detected” this is what appears, what payload would i use?

Ok, then you are able to know on home assitant side when the hotword is detected. So then trigger a script, a command or what is needed (a dummy switch?) to mute your TV.

It doesn’t trigger the automation when i say the hotword thru the rpi, Here is a sample of my automation:

but when i run it thru a script, everything works fine.

After some trial and error I made it work! here is my final setting in automation.yaml
automation