synesthesiam / hassio-addons

My Hass.IO add-ons
43 stars 18 forks source link

No entities from home assistant #40

Open groetg opened 1 year ago

groetg commented 1 year ago

Tried several times from scratch, but got stock at the same moments where the entities wont be read from home assistant. Followed the steps from youtube video everything home.

Log when i train now, and got the meessage of missing slots: [ERROR:2023-02-10 07:39:40,845] rhasspyserver_hermes: Missing slot $hass/entities,licht Traceback (most recent call last): File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py", line 1821, in full_dispatch_request result = await self.dispatch_request(request_context) File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py", line 1869, in dispatchrequest return await handler(**request.view_args) File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/main.py", line 1313, in api_train result = await core.train() File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py", line 365, in train word_transform=word_transform, File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/train.py", line 106, in sentences_to_graph sentences, replacements=replacements, add_intent_weights=add_intent_weights File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 426, in sentences_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 124, in expression_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 124, in expression_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 194, in expression_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 124, in expression_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 124, in expression_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 100, in expression_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 194, in expression_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 124, in expression_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 124, in expression_to_graph expand_slots=expand_slots, File "/usr/lib/rhasspy/rhasspy-nlu/rhasspynlu/jsgf_graph.py", line 206, in expression_to_graph assert slot_values, f"Missing slot {slot_name}" AssertionError: Missing slot $hass/entities,licht [WARNING:2023-02-10 07:39:40,819] rhasspynlu.slots: Failed to load file/program for slot hass/entities,cover (tried: [PosixPath('/profiles/nl/slots'), PosixPath('/usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/nl/slots')], [PosixPath('/profiles/nl/slot_programs'), PosixPath('/usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/nl/slot_programs')]) [DEBUG:2023-02-10 07:39:40,811] rhasspynlu.slots: Loading slot hass/colors from /profiles/nl/slots/hass/colors [WARNING:2023-02-10 07:39:40,811] rhasspynlu.slots: Failed to load file/program for slot hass/entities,licht (tried: [PosixPath('/profiles/nl/slots'), PosixPath('/usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/nl/slots')], [PosixPath('/profiles/nl/slot_programs'), PosixPath('/usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/nl/slot_programs')]) [WARNING:2023-02-10 07:39:40,810] rhasspynlu.slots: Failed to load file/program for slot hass/entities,switch (tried: [PosixPath('/profiles/nl/slots'), PosixPath('/usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/nl/slots')], [PosixPath('/profiles/nl/slot_programs'), PosixPath('/usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/nl/slot_programs')]) [DEBUG:2023-02-10 07:39:40,588] rhasspynlu.slots: Running program for slot rhasspy/number,0,100,1: ['/usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/nl/slot_programs/rhasspy/number', '0', '100', '1'] [DEBUG:2023-02-10 07:39:40,572] rhasspynlu.ini_jsgf: Loaded ini file [DEBUG:2023-02-10 07:39:40,568] rhasspyserver_hermes: Generating intent graph [DEBUG:2023-02-10 07:39:40,566] rhasspyserver_hermes: Loading sentences from [PosixPath('/profiles/nl/sentences.ini'), PosixPath('/profiles/nl/intents/home_assistant.ini')] [INFO:2023-02-10 07:39:40,563] rhasspyserver_hermes: Starting training

Can someone more experienced help me out?

groetg commented 1 year ago

I run in SSH on the rpi4 with Rhasspy this script:

mkdir -p /share/rhasspy/profiles/en/slot_programs/hass/ cd /share/rhasspy/profiles/en/slot_programs/hass wget https://raw.githubusercontent.com/rhasspy/rhasspy/master/examples/homeassistant/profile/slot_programs/hass/entities chmod +x entities ls -lah entities

From https://gist.github.com/EverythingSmartHome/a4cd27c28981cc2dbfe2dbb12f683638

I noticed that it put the slot_programs directory in /share/rhasspy/profiles/en/slot_programs/hass, while my profile in /home/groetg/.config/rhasspy/profiles/nl/.

So I changed the script to my personal situation: mkdir -p /home/groetg/.config/rhasspy/profiles/nl/slot_programs/hass/ cd /home/groetg/.config/rhasspy/profiles/nl/slot_programs/hass/ wget https://raw.githubusercontent.com/rhasspy/rhasspy/master/examples/homeassistant/profile/slot_programs/hass/entities chmod +x entities ls -lah entities

After that it is noticable, it sees my devices. It sees ALL my devices, also not the lights and switches, so I need to train 276 new words. I still got error:

_TrainingFailedException: Command '['fstcompile', '--isymbols=/profiles/nl/kaldi/model/data/lang/words.txt', '--osymbols=/profiles/nl/kaldi/model/data/lang/words.txt', '--keep_isymbols=false', '--keep_osymbols=false', '/profiles/nl/kaldi/languagemodel.txt', '/profiles/nl/kaldi/model/data/lang/G.fst.unsorted']' returned non-zero exit status 1.

Whole log Rhasspy: [ERROR:2023-02-10 18:01:36,414] rhasspyserver_hermes: Command '['fstcompile', '--isymbols=/profiles/nl/kaldi/model/data/lang/words.txt', '--osymbols=/profiles/nl/kaldi/model/data/lang/words.txt', '--keep_isymbols=false', '--keep_osymbols=false', '/profiles/nl/kaldi/language_model.txt', '/profiles/nl/kaldi/model/data/lang/G.fst.unsorted']' returned non-zero exit status 1. Traceback (most recent call last): File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py", line 1821, in full_dispatch_request result = await self.dispatch_request(request_context) File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py", line 1869, in dispatchrequest return await handler(**request.view_args) File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/main.py", line 1313, in api_train result = await core.train() File "/usr/lib/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py", line 472, in train raise TrainingFailedException(reason=asr_response.error) rhasspyserver_hermes.TrainingFailedException: Command '['fstcompile', '--isymbols=/profiles/nl/kaldi/model/data/lang/words.txt', '--osymbols=/profiles/nl/kaldi/model/data/lang/words.txt', '--keep_isymbols=false', '--keep_osymbols=false', '/profiles/nl/kaldi/language_model.txt', '/profiles/nl/kaldi/model/data/lang/G.fst.unsorted']' returned non-zero exit status 1. [ERROR:2023-02-10 18:01:36,414] rhasspyserver_hermes: AsrError(error="Command '['fstcompile', '--isymbols=/profiles/nl/kaldi/model/data/lang/words.txt', '--osymbols=/profiles/nl/kaldi/model/data/lang/words.txt', '--keep_isymbols=false', '--keep_osymbols=false', '/profiles/nl/kaldi/language_model.txt', '/profiles/nl/kaldi/model/data/lang/G.fst.unsorted']' returned non-zero exit status 1.", site_id='default', context=None, session_id='a336d451-4bdb-4415-a748-293111e8106d') [DEBUG:2023-02-10 18:01:36,411] rhasspyserver_hermes: Handling AsrError (topic=hermes/error/asr, id=fcc6a69b-4b86-462a-bf18-852682783d32) [DEBUG:2023-02-10 18:01:30,509] rhasspyserver_hermes: Handling NluTrainSuccess (topic=rhasspy/nlu/default/trainSuccess, id=fcc6a69b-4b86-462a-bf18-852682783d32) [DEBUG:2023-02-10 18:01:30,351] rhasspyserver_hermes: Publishing 14173 bytes(s) to rhasspy/nlu/default/train [DEBUG:2023-02-10 18:01:30,351] rhasspyserver_hermes: -> NluTrain [DEBUG:2023-02-10 18:01:30,343] rhasspyserver_hermes: Publishing 14173 bytes(s) to rhasspy/asr/default/train [DEBUG:2023-02-10 18:01:30,342] rhasspyserver_hermes: -> AsrTrain [DEBUG:2023-02-10 18:01:30,334] rhasspyserver_hermes: Finished writing /profiles/nl/intent_graph.pickle.gz [DEBUG:2023-02-10 18:01:29,895] rhasspyserver_hermes: Writing /profiles/nl/intent_graph.pickle.gz [DEBUG:2023-02-10 18:01:28,895] rhasspynlu.slots: Running program for slot hass/entities,switch: ['/profiles/nl/slot_programs/hass/entities', 'switch'] [DEBUG:2023-02-10 18:01:28,725] rhasspynlu.slots: Running program for slot rhasspy/number,0,100,1: ['/usr/lib/rhasspy/rhasspy-profile/rhasspyprofile/profiles/nl/slot_programs/rhasspy/number', '0', '100', '1'] [DEBUG:2023-02-10 18:01:28,716] rhasspynlu.slots: Loading slot hass/colors from /profiles/nl/slots/hass/colors [DEBUG:2023-02-10 18:01:27,914] rhasspynlu.slots: Running program for slot hass/entities,light: ['/profiles/nl/slot_programs/hass/entities', 'light'] [DEBUG:2023-02-10 18:01:27,903] rhasspynlu.ini_jsgf: Loaded ini file [DEBUG:2023-02-10 18:01:27,899] rhasspyserver_hermes: Generating intent graph [DEBUG:2023-02-10 18:01:27,897] rhasspyserver_hermes: Loading sentences from [PosixPath('/profiles/nl/sentences.ini'), PosixPath('/profiles/nl/intents/home_assistant.ini')] [INFO:2023-02-10 18:01:27,894] rhasspyserver_hermes: Starting training [DEBUG:2023-02-10 18:01:26,718] rhasspyserver_hermes: Writing /profiles/nl/sentences.ini [DEBUG:2023-02-10 18:01:26,711] rhasspyserver_hermes: Writing /profiles/nl/intents/home_assistant.ini