Rhasspy offline voice assistant toolkit

The configuration in the examples/raspberrypi area already uses snowboy, so as I was following that example, it’s already in use. But ever happy to try the other options, I’ve looked in the single_machine example and copied in the mycoft-precise settings and let this install (I’m used to these installs taking while on a pi). I’ll try that out and also the pocketphinx example and report back …

reporting back then - switch to hotword_precise didn’t give any errors, but again nothing happens when I say OK RHASSPY. I do have a British accent.

Switching to pocketsphinx gives a different issue. I get an error on the HA dashboard saying that the configuration is incorrect for pocketsphinx with a hyperlink to a page that doesn’t exist - https://www.home-assistant.io/components/hotword_pocketsphinx/

Now I know you are thinking that I didn’t copy in your advice and I also know that is the most likely problem. So here is an extract of my config file. The two files referred to do exist for the acoustic model and dictionary and I’ve removed the other hotword entries. I’m rubbish with this editor and I cannot seem to work out how to put the exact text in, but this is my best attempt using a block quote. There are spaces before the lines, but they are being remoevd and the # comments being turned into bold. If there is a neat way to just let me put the text in as it is, I’m up for knowing how. Anyway …

Listen for a hotword with snowboy.

#hotword_snowboy:

model: /home/pi/ha/rhasspy-assistant/wake/snowboy/okay_rhasspy.pmdl

#hotword_precise:

model: /home/pi/ha/rhasspy-assistant/wake/mycroft-precise/okay-rhasspy.pb

hotword_pocketsphinx:
hotword: “okay raspy” # purposely misspelled
acoustic_model: /home/pi/ha/rhasspy-tools/pocketsphinx/cmusphinx-en-us-5.2
dictionary: /home/pi/ha/rhasspy-assistant/data/mixed.dict

Thank you for your persistence. I think we’re making some progress, and this will definitely help me refine the documentation for other users!

For future reference, you can insert a code section in the editor by starting and ending it with three backticks. Everything in between will be considered code.

Can you send me the error that HA prints in the log when it fails to load hotword_pocketsphinx? The frontend information is beyond useless, especially since it assumes that the HA website is somehow hosting documentation for a third party component. I did recently push some documentation for each component up to the rhasspy_assistant repo, though; see the .py files themselves (HTML documentation is still in the works).

snowboy may be failing because the model I included was a personal one (.pmdl extension) that I trained on my own voice/microphone. I’m American, so our accents may be different enough that it’s causing problems. You can either use one of the “universal” models (.umdl extension) like snowboy.umdl or hop over to the snowboy website and train your own .pmdl model.

I’m taking some time today to run through the Raspberry Pi instructions from scratch on a fresh Pi with the PS3 Eye microphone, just to make sure I didn’t forget a step. I’ll let you know what I find.

I went through a fresh installation on a Pi today and found some bugs in the hotword_snowboy component. Those are fixed now, so please pull down the latest rhasspy-assistant before trying again.

Also, I spent some time putting together a detailed guide for the Raspberry Pi with everything I did to finally get it working. I didn’t experience any problems with the proper device not being selected, so I’m hoping that the issues you experienced came from the aforementioned fixed bugs and/or the use of my custom snowboy model.

Good luck!

That is very kind and I’ll freshen my image and run through the new docs. I’ll let you know how I get on

Now the new docs went through smoothly, but I’m not getting any response to the voice commands. I used to live in Battery Park, NY, so I’ve used my bast US accent, but no joy. I’ve enclosed the output from the hassio session in case it helps. Just shout if you need me to run anything else…

I did do a sudo dpkg-reconfigure for the timezone to be Pacific/Auckland so I could see correct date/time, but apart from that I haven’t deviated from the guide.

(homeassistant) pi@raspberrypi:~/homeassistant $ hass -c config
Config directory: /home/pi/homeassistant/config
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_off>
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_on>
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=toggle>
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=stop>
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=restart>
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=check_config>
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=homeassistant, service=reload_core_config>
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=persistent_notification, service=create>
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=persistent_notification, service=dismiss>
2018-08-03 15:11:02 INFO (MainThread) [homeassistant.bootstrap] Home Assistant core initialized
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.loader] Loaded frontend from homeassistant.components.frontend
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.loader] Loaded api from homeassistant.components.api
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.loader] Loaded http from homeassistant.components.http
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.loader] Loaded websocket_api from homeassistant.components.websocket_api
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.loader] Loaded system_log from homeassistant.components.system_log
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.loader] Loaded auth from homeassistant.components.auth
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.loader] Loaded onboarding from homeassistant.components.onboarding
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setting up http
2018-08-03 15:11:03 WARNING (MainThread) [homeassistant.components.http] You have been advised to set http.api_password.
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setup of domain http took 0.0 seconds.
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=http>
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setting up system_log
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=system_log, service=clear>
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=system_log, service=write>
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setup of domain system_log took 0.0 seconds.
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=system_log>
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setting up auth
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setup of domain auth took 0.0 seconds.
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=auth>
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setting up onboarding
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setting up api
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setting up websocket_api
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setup of domain websocket_api took 0.0 seconds.
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=websocket_api>
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setup of domain api took 0.0 seconds.
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=api>
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setup of domain onboarding took 0.0 seconds.
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=onboarding>
2018-08-03 15:11:03 INFO (MainThread) [homeassistant.setup] Setting up frontend
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setup of domain frontend took 1.6 seconds.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=frontend>
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded wav_aplay from custom_components.wav_aplay
2018-08-03 15:11:05 WARNING (MainThread) [homeassistant.loader] You are using a custom component for wav_aplay which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setting up wav_aplay
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded group from homeassistant.components.group
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setting up group
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded automation from homeassistant.components.automation
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded script from homeassistant.components.script
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded conversation from homeassistant.components.conversation
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded stt_pocketsphinx from custom_components.stt_pocketsphinx
2018-08-03 15:11:05 WARNING (MainThread) [homeassistant.loader] You are using a custom component for stt_pocketsphinx which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded intent_script from homeassistant.components.intent_script
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setting up intent_script
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setup of domain intent_script took 0.0 seconds.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=intent_script>
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded binary_sensor from homeassistant.components.binary_sensor
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded binary_sensor.command_line from homeassistant.components.binary_sensor.command_line
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setting up binary_sensor
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded switch from homeassistant.components.switch
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded switch.command_line from homeassistant.components.switch.command_line
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded rhasspy_train from custom_components.rhasspy_train
2018-08-03 15:11:05 WARNING (MainThread) [homeassistant.loader] You are using a custom component for rhasspy_train which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setting up rhasspy_train
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=rhasspy_train, service=train>
2018-08-03 15:11:05 INFO (MainThread) [custom_components.rhasspy_train] Started
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setup of domain rhasspy_train took 0.0 seconds.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=rhasspy_train>
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded config from homeassistant.components.config
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded picotts_aplay from custom_components.picotts_aplay
2018-08-03 15:11:05 WARNING (MainThread) [homeassistant.loader] You are using a custom component for picotts_aplay which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setting up picotts_aplay
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded hotword_snowboy from custom_components.hotword_snowboy
2018-08-03 15:11:05 WARNING (MainThread) [homeassistant.loader] You are using a custom component for hotword_snowboy which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded sensor from homeassistant.components.sensor
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded sensor.command_line from homeassistant.components.sensor.command_line
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded sensor.template from homeassistant.components.sensor.template
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setting up sensor
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=wav_aplay, service=play_wav>
2018-08-03 15:11:05 INFO (Thread-4) [custom_components.wav_aplay] Started
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.command_line
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=picotts_aplay, service=say>
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.template
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.command_line
2018-08-03 15:11:05 INFO (Thread-3) [custom_components.picotts_aplay] Started
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state group.default_view=unknown; hidden=True, view=True, friendly_name=default_view, order=0, entity_id=('group.inside', 'group.garage', 'group.rhasspy') @ 2018-08-02T23:11:05.885721-04:00>, entity_id=group.default_view>
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setting up conversation
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=conversation, service=process>
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setup of domain conversation took 0.0 seconds.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=conversation>
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setup of domain wav_aplay took 0.3 seconds.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=wav_aplay>
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setting up config
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.setup] Setup of domain picotts_aplay took 0.1 seconds.
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=picotts_aplay>
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.loader] Loaded config.customize from homeassistant.components.config.customize
2018-08-03 15:11:05 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=config.customize>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.loader] Loaded config.group from homeassistant.components.config.group
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=config.group>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.loader] Loaded config.hassbian from homeassistant.components.config.hassbian
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.loader] Loaded config.core from homeassistant.components.config.core
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=config.core>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.loader] Loaded config.automation from homeassistant.components.config.automation
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=config.automation>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.loader] Loaded config.script from homeassistant.components.config.script
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=config.script>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.loader] Loaded config.entity_registry from homeassistant.components.config.entity_registry
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.loader] Loaded config.config_entries from homeassistant.components.config.config_entries
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state sensor.last_intent=unknown; friendly_name=Last Intent @ 2018-08-02T23:11:06.095743-04:00>, entity_id=sensor.last_intent>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state group.rhasspy=unknown; friendly_name=rhasspy, order=3, entity_id=('hotword_snowboy.decoder', 'stt_pocketsphinx.pocketsphinx', 'sensor.last_text') @ 2018-08-02T23:11:06.129166-04:00>, entity_id=group.rhasspy>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=group, service=reload>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=group, service=set>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=group, service=remove>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=group, service=set_visibility>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setup of domain group took 0.5 seconds.
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=group>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setting up automation
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setting up script
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=script, service=reload>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=script, service=turn_on>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=script, service=turn_off>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=script, service=toggle>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setup of domain script took 0.0 seconds.
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=script>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setting up switch
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state automation.start_hotword=off; last_triggered=None, friendly_name=start hotword @ 2018-08-02T23:11:06.177844-04:00>, entity_id=automation.start_hotword>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state automation.speech_to_text__intent_recognition=off; last_triggered=None, friendly_name=speech to text -> intent recognition @ 2018-08-02T23:11:06.180791-04:00>, entity_id=automation.speech_to_text__intent_recognition>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state automation.hotword__speech_to_text=off; last_triggered=None, friendly_name=hotword -> speech to text @ 2018-08-02T23:11:06.183721-04:00>, entity_id=automation.hotword__speech_to_text>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state automation.speech_to_text_working=off; last_triggered=None, friendly_name=speech to text working @ 2018-08-02T23:11:06.186580-04:00>, entity_id=automation.speech_to_text_working>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.components.switch] Setting up switch.command_line
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=group, service=set, service_data=visible=False, entities=['automation.hotword__speech_to_text', 'automation.speech_to_text__intent_recognition', 'automation.speech_to_text_working', 'automation.start_hotword'], name=all automations, object_id=all_automations, service_call_id=1976310704-1>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=sensor>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state group.all_automations=off; friendly_name=all automations, hidden=True, auto=True, order=4, entity_id=('automation.hotword__speech_to_text', 'automation.speech_to_text__intent_recognition', 'automation.speech_to_text_working', 'automation.start_hotword') @ 2018-08-02T23:11:06.230703-04:00>, entity_id=group.all_automations>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setup of domain binary_sensor took 0.4 seconds.
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=binary_sensor>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1976310704-1>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=switch, service=turn_off>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=switch, service=turn_on>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=switch, service=toggle>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setup of domain switch took 0.1 seconds.
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=switch>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state group.all_switches=off; entity_id=('switch.garage_light', 'switch.living_room_lamp'), assumed_state=True, auto=True, hidden=True, friendly_name=all switches, order=5 @ 2018-08-02T23:11:06.260621-04:00>, entity_id=group.all_switches>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1976310704-2>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setting up hotword_snowboy
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=hotword_snowboy, service=listen>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state hotword_snowboy.decoder=idle; icon=mdi:microphone, friendly_name=Hotword @ 2018-08-02T23:11:06.271045-04:00>, entity_id=hotword_snowboy.decoder>
2018-08-03 15:11:06 INFO (MainThread) [custom_components.hotword_snowboy] Started
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setup of domain hotword_snowboy took 0.0 seconds.
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=hotword_snowboy>
2018-08-03 15:11:06 INFO (MainThread) [homeassistant.setup] Setting up stt_pocketsphinx
2018-08-03 15:11:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=stt_pocketsphinx, service=listen>
2018-08-03 15:11:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=stt_pocketsphinx, service=decode_wav>
2018-08-03 15:11:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, new_state=<state stt_pocketsphinx.pocketsphinx=idle; icon=mdi:comment-text, friendly_name=Speech to Text, text= @ 2018-08-02T23:11:21.925762-04:00>, entity_id=stt_pocketsphinx.pocketsphinx>
2018-08-03 15:11:21 INFO (MainThread) [custom_components.stt_pocketsphinx] Started
2018-08-03 15:11:21 INFO (MainThread) [homeassistant.setup] Setup of domain stt_pocketsphinx took 15.1 seconds.
2018-08-03 15:11:21 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=stt_pocketsphinx>
2018-08-03 15:11:21 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=config.config_entries>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.setup] Setup of domain config took 16.2 seconds.
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=config>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 19.53s
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Starting Home Assistant core loop
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event homeassistant_start[L]>
2018-08-03 15:11:22 WARNING (MainThread) [homeassistant.components.sensor.template] Could not render template Last Intent, the state is unknown.
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state sensor.last_text=unknown; friendly_name=Last Text @ 2018-08-02T23:11:06.097276-04:00>, new_state=<state sensor.last_text=; friendly_name=Last Text @ 2018-08-02T23:11:22.169041-04:00>, entity_id=sensor.last_text>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.loader] Loaded automation.homeassistant from homeassistant.components.automation.homeassistant
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.components.automation] Initialized trigger start hotword
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state automation.start_hotword=off; last_triggered=None, friendly_name=start hotword @ 2018-08-02T23:11:06.177844-04:00>, new_state=<state automation.start_hotword=on; last_triggered=None, friendly_name=start hotword @ 2018-08-02T23:11:22.173193-04:00>, entity_id=automation.start_hotword>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.loader] Loaded automation.event from homeassistant.components.automation.event
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.components.automation] Initialized trigger speech to text -> intent recognition
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state automation.speech_to_text__intent_recognition=off; last_triggered=None, friendly_name=speech to text -> intent recognition @ 2018-08-02T23:11:06.180791-04:00>, new_state=<state automation.speech_to_text__intent_recognition=on; last_triggered=None, friendly_name=speech to text -> intent recognition @ 2018-08-02T23:11:22.177057-04:00>, entity_id=automation.speech_to_text__intent_recognition>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.components.automation] Initialized trigger hotword -> speech to text
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state automation.hotword__speech_to_text=off; last_triggered=None, friendly_name=hotword -> speech to text @ 2018-08-02T23:11:06.183721-04:00>, new_state=<state automation.hotword__speech_to_text=on; last_triggered=None, friendly_name=hotword -> speech to text @ 2018-08-02T23:11:22.179475-04:00>, entity_id=automation.hotword__speech_to_text>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.components.automation] Initialized trigger speech to text working
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state automation.speech_to_text_working=off; last_triggered=None, friendly_name=speech to text working @ 2018-08-02T23:11:06.186580-04:00>, new_state=<state automation.speech_to_text_working=on; last_triggered=None, friendly_name=speech to text working @ 2018-08-02T23:11:22.181926-04:00>, entity_id=automation.speech_to_text_working>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Timer:starting
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.components.automation] Executing start hotword
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event logbook_entry[L]: domain=automation, name=start hotword, entity_id=automation.start_hotword, message=has been triggered>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.helpers.script] Script start hotword: Running script
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.helpers.script] Script start hotword: Executing step call service
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=hotword_snowboy, service=listen, service_data=, service_call_id=1976310704-3>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state hotword_snowboy.decoder=idle; icon=mdi:microphone, friendly_name=Hotword @ 2018-08-02T23:11:06.271045-04:00>, new_state=<state hotword_snowboy.decoder=listening; icon=mdi:microphone, friendly_name=Hotword @ 2018-08-02T23:11:22.228485-04:00>, entity_id=hotword_snowboy.decoder>
2018-08-03 15:11:22 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state group.all_automations=off; friendly_name=all automations, hidden=True, auto=True, order=4, entity_id=('automation.hotword__speech_to_text', 'automation.speech_to_text__intent_recognition', 'automation.speech_to_text_working', 'automation.start_hotword') @ 2018-08-02T23:11:06.230703-04:00>, new_state=<state group.all_automations=on; friendly_name=all automations, hidden=True, auto=True, order=4, entity_id=('automation.hotword__speech_to_text', 'automation.speech_to_text__intent_recognition', 'automation.speech_to_text_working', 'automation.start_hotword') @ 2018-08-02T23:11:22.237362-04:00>, entity_id=group.all_automations>
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.front.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_alsa.pcm.surround40.0:CARD=0'

<Text removed to fit in editor limits>

ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
connect(2) call to /tmp/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
2018-08-03 15:11:32 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state automation.start_hotword=on; last_triggered=None, friendly_name=start hotword @ 2018-08-02T23:11:22.173193-04:00>, new_state=<state automation.start_hotword=on; last_triggered=2018-08-02T23:11:32.189917-04:00, friendly_name=start hotword @ 2018-08-02T23:11:22.173193-04:00>, entity_id=automation.start_hotword>
2018-08-03 15:12:06 INFO (Thread-3) [homeassistant.components.sensor.command_line] Running command: date +%S
2018-08-03 15:12:07 INFO (Thread-15) [homeassistant.components.sensor.command_line] Running command: date +%S
2018-08-03 15:13:07 INFO (Thread-5) [homeassistant.components.sensor.command_line] Running command: date +%S
2018-08-03 15:13:07 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state sensor.temperature=43; icon=mdi:thermometer, unit_of_measurement=°F, friendly_name=Temperature @ 2018-08-02T23:11:06.155166-04:00>, new_state=<state sensor.temperature=45; icon=mdi:thermometer, unit_of_measurement=°F, friendly_name=Temperature @ 2018-08-02T23:13:07.233074-04:00>, entity_id=sensor.temperature>
2018-08-03 15:13:08 INFO (Thread-8) [homeassistant.components.sensor.command_line] Running command: date +%S
2018-08-03 15:13:26 INFO (MainThread) [homeassistant.components.http.view] Serving / to 10.13.12.212 (auth: True)
2018-08-03 15:13:27 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 10.13.12.212 (auth: True)

OK, I added a short guide on how events flow through Rhasspy and Home Assistant. I’d be curious to see what happens if you skip the hotword (by injecting the hotword_detected event), and see if pocketsphinx can understand you. Did you say whether or not you had tried the snowboy.umdl instead of okay_rhasspy.pmdl yet?

One other thing I hadn’t though of until now is pocketsphinx’s acoustic model. For the Raspberry Pi, the stt_pocketsphinx config looks like this:

stt_pocketsphinx:
  acoustic_model: $RHASSPY_TOOLS/pocketsphinx/cmusphinx-en-us-ptm-5.2
  ...

The PTM version is lighter weight (less CPU intensive), but maybe it leaves out too much. You try this and see if it helps:

stt_pocketsphinx:
  acoustic_model: $RHASSPY_TOOLS/pocketsphinx/cmusphinx-en-us-5.2
  ...

If you continue to use hotword_pocketsphinx, you’ll need to adjust it’s acoustic_model too.

I was able to succesfully get everything up and running using your latest detailed guide for the raspberry pi.

Let me first congratulate you on the well written documentation and the entire project. It worked without to much issues. :+1:

I changed the language in config_spacy.yaml as you suggested. The following is my configuration.yaml with the changes you suggested:

# Service for training rhasspy speech/intent recognizers
rhasspy_train:
  ngram_path: /data/rhasspy/rhasspy-tools/srilm/bin/armv7l/ngram
  ngram_count_path: /data/rhasspy/rhasspy-tools/srilm/bin/armv7l/ngram-count
  phonetisaurus_path: /data/rhasspy/rhasspy-tools/phonetisaurus/phonetisaurus-armv7l
  phonetisaurus_fst: /data/rhasspy/rhasspy-tools/phonetisaurus/etc/g014b2b.fst
  example_files:
    - /data/rhasspy/rhasspy-assistant/data/examples.md
  dictionary_files:
    - /data/rhasspy/rhasspy-tools/pocketsphinx/voxforge_nl_sphinx.dic
  dictionary_guess: /data/rhasspy/rhasspy-assistant/data/guess.dict
  dictionary_mixed: /data/rhasspy/rhasspy-assistant/data/mixed.dict
  language_model_base: /data/rhasspy/rhasspy-tools/pocketsphinx/voxforge_nl_sphinx.lm
  language_model_example: /data/rhasspy/rhasspy-assistant/data/examples.lm
  language_model_mixed: /data/rhasspy/rhasspy-assistant/data/mixed.lm

# Do speech-to-text with pocketsphinx.
# Use lower-fidelity acoustic model (ptm)
# Use smaller language model (derived purely from examples).
stt_pocketsphinx:
  acoustic_model: /data/rhasspy/rhasspy-tools/pocketsphinx/cmusphinx-nl-ptm-5.2
  language_model: /data/rhasspy/rhasspy-tools/pocketsphinx/voxforge_nl_sphinx.lm
  dictionary: /data/rhasspy/rhasspy-tools/pocketsphinx/voxforge_nl_sphinx.dic

Is the stt_pocketsphinx section correct to point to the language model and dictionary of pocketsphinx itself and not examples.lm and mixed.dict?

Should I also somehow first recreate the mixed.dict upfront to only contain Dutch words and not English?

Excellent! This counts as the first success :smile:

stt_pocketsphinx will work as you have it configured, but it will only understand phrases/words from the original language model/dictionary. The workflow I had originally imagined for customization involved having the rasa_nlu component and worked liked this:

  1. You add new intents/phrases to examples.md in whatever language you have configured (Dutch here)
  2. Run the rhasspy_train.train service. This will re-create examples.lm (custom language model) and mix it with your base language model into mixed.lm
  3. Any unknown words have their pronunciations guessed and put in unknown.dict. You should review these and copy/correct them in user.dict (which is combined with the base dictionary into mixed.dict
  4. Once there are no more unknown words, re-run rhasspy_train.train and restart Home Assistant

The training process trains both pocketsphinx and rasa_nlu (only if you have project_dir and rasa_config set in rhasspy_train), so you only needed to edit examples.md with the original workflow.

Now, I used Home Assistant’s conversation component for the RPi guide because it made installation much easier. But it means having to put phrases both in examples.md and configuration.yaml under the conversation config. Looking at its code, it uses regular expressions created from the phrases you put in configuration.yaml. I’m guessing these could be in Dutch, assuming Python’s re module does the right thing. Unfortunately, all of the “turn on”, “turn off” phrases it automatically generates are in English only.

What do you want to try next? Adding Dutch phrases to conversation (with copies in examples.md), or going for the full rasa_nlu?

I already had the Dutch phrases in both locations. but what to go the full rasa_nlu route.

I’d like to ideally use the intent system for everything and be able to use different interfaces like text based chat or speech to text using perhaps even multiple voice assistants to in the end always execute the same intents.

We already use Siri in Dutch and I’m considering using some of the phrases it uses to create my examples.md to have a more universal set of voice commands as well.

Here’s a guide for going the full rasa_nlu route: https://github.com/synesthesiam/rhasspy-assistant/blob/master/doc/upgrading-to-rasa.md

Please let me know how it goes!

I already had the language model downloaded earlier, so that was not a problem. Have been struggling a bit because my Python install was not configured with bzip support which was needed to install the Twisted dependency.

I noticed you updated the repo, so I just downloaded everyting fresh, but am unable to get the rhasspy_train.train service to update the model. No new files are created or overwritten.

The rasa_nlu.recognizer and rhasspy_train.trainer are at least succesfully created.

By accident I saw the following error message when requesting the status of home assistant using the service home-assistant status:

[E050] Can't find model 'nl'. It doesn't seem to be a shortcut link, a Python package or a valid path to a data directory.

Do you know what we can do to enforce the training to start?

Very intresting! I hope someone will create a good AddOn for Hassio :slight_smile:

2 Likes

Any chance to run in in a docker container?

I currently run my HA setup in my synology NAS

I got passed this error by using the full path to the language model in spacy_config.yaml as the following snippet shows:

language: "/usr/local/lib/python3.6/site-packages/spacy/data/nl/nl_core_news_sm-2.0.0"

Now I see some more info that there are still other issues, but I am no longer stuck and will keep you posted on the progress.

I think this may be related to how spaCy looks up language models. See the section on shortcut links in their documentation for more information.You should be able to run:

python3 -m spacy link "/usr/local/lib/python3.6/site-packages/spacy/data/nl/nl_core_news_sm-2.0.0" "nl"

in your virtual environment and have it work.

How would this work? Is there a standard docker container for Home Assistant that I could build on?

I came across that page also and hence saw that adding the full path to the model works as well without the link command.

Now I’m running into the following errors when trying to train the mode

hass[11248]: /data/rhasspy/rhasspy-tools/srilm/bin/armv7l/ngram-count: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /data/rhasspy/rhasspy-tools/sri...rmv7l/ngram-count)
hass[11248]: /data/rhasspy/rhasspy-tools/srilm/bin/armv7l/ngram-count: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /data/rhasspy/rhasspy-tools/s...rmv7l/ngram-count)

Which appears to have something to do with the version of gcc. I did some checks and only have GLIBCXX_3.4.20.

Should we recompile something?

Yep, looks like you’ll need to recompile the SRILM toolkit for your version of Linux (which distro/version are you on again?). I just put up a short guide on how to do this. It shouldn’t be too difficult, but I’m happy to help if you run into problems.

If 3.4.20 is common enough, I may ask you for the ngram and ngram-count binaries so I can add them to the rhasspy-tools repository for others.

This is the official docker image for home assistant
https://hub.docker.com/r/homeassistant/home-assistant/

In my setting I’m running multiple docker for the services I need (mosquitto, graphana, etc). It’s more flexible than hassio because you don’t have to wait for someone who build an add-on. It just simply works.