From A to Snips - HA on Hass.io + external Snips guide

I know and this is ok because there isn’t an action associated to the skill. My problem is the time it takes snips until he understand there isn’t any action. In this time i can’t talk to sbips and ask him to do more stuff.

Yes, yes and yes

Are you sure MQTT commuication between Snips and HA is working? You could check the log of the MQTT addon (on the mqtt addons site, bottom) and Home Assistant log (Dev Tools - Logs - Load complete log) to see if the client connected fine. I sometimes had some socket errors and disconnects there, yesterday I had to completely reinstall a satellite until it wanted to connect again, before always socket error. Didn’t manage to figure it out until I reinstalled.

However you should see messages of your device connecting and maybe disconnecting but no errors.

Is the intent script not working at all or only no speech?

And do you hear that dingdong when saying Hey Snips?

Edit: Also remember to restart Home Assistant after creating an intent script!

I will explain:
MQTT works - snips send the intent and slot to hass.io, which in turn triggers the action - say something (speech) and then starts to play a song.

[14:39:47] [Hotword] was asked to toggle itself 'on' on site default
[14:40:23] [Hotword] detected on site default, for model hey_snips
[14:40:23] [Asr] was asked to stop listening on site default
[14:40:23] [Hotword] was asked to toggle itself 'off' on site default
[14:40:23] [Dialogue] session with id '72dcd45d-e798-474c-b239-b6e6453c9e3b' was started on site default
[14:40:23] [Asr] was asked to listen on site default
[14:40:26] [Asr] captured text "play song" in 2.0s
[14:40:26] [Asr] was asked to stop listening on site default
[14:40:26] [Nlu] was asked to parse input "play song"
[14:40:26] [Nlu] detected intent dror-israel:PlaySong with confidence score 0.857 for input "play song"
[14:40:26] [Dialogue] New intent detected dror-israel:PlaySong with confidence 0.857
[14:40:26] [Dialogue] was ask to end session with id 72dcd45d-e798-474c-b239-b6e6453c9e3b by saying 'OK, Playing song in'
[14:40:26] [Tts] was asked to say "OK, Playing song in"
[14:40:26] [AudioServer] was asked to play a wav of 64.9 kB with id '751692da-31bd-4792-a11d-8ba39b17384d' on site default
[14:40:42] [Dialogue] session with id '72dcd45d-e798-474c-b239-b6e6453c9e3b' was ended on site default. The session was ended because one of the component didn't respond in a timely manner
[14:40:42] [Asr] was asked to stop listening on site default
[14:40:42] [Hotword] was asked to toggle itself 'on' on site default

My problems:

  1. HASS.IO doesn’t do the speech part - it immediately starts to play the song
  2. It take snips a few seconds until snipsis ready for my next command, because it is waiting for an action to accure, which doesn’t exist since all logic happens in HASS.IO and not in snips

Okay. Your log looks great, you are right.

Did you plug an active speaker (passive speaker will not be loud enough) or headphones to the 3,5" jack?

Did you try

sam test speaker

to check if the right audio output is used?

The sound should come out from hass.io, doesn’t it?

No from the Snips :wink:

I ruinedit all :frowning:

I reinstalled snips and now it doesn’t get my commands.

This is what it show in sam status

I say: hey snips, what is the time (assistant with datetime skill from the app store)

[13:17:17] Watching on 192.168.1.105:1883 (MQTT)
[13:17:20] [Hotword] detected on site default, for model hey_snips
[13:17:20] [Asr] was asked to stop listening on site default
[13:17:20] [Hotword] was asked to toggle itself 'off' on site default
[13:17:20] [Dialogue] session with id '7ad8d97f-3f9b-4f98-b1bb-b929350e6b27' was started on site default
[13:17:20] [AudioServer] was asked to play a wav of 41.1 kB with id 'cc86e300-790a-444f-bcbe-5c15e88dacbd' on site default
[13:17:35] [Dialogue] session with id '7ad8d97f-3f9b-4f98-b1bb-b929350e6b27' was ended on site default. The session was ended because one of the component didn't respond in a timely manner
[13:17:35] [Asr] was asked to stop listening on site default
[13:17:35] [Hotword] was asked to toggle itself 'on' on site default

All services are running

OS version ................... Raspbian GNU/Linux 9 (stretch)
Installed assistant .......... test
Language ..................... en
Hotword ...................... hey_snips
ASR engine ................... snips
Status ....................... Live

Service status:

snips-analytics .............. (not running)
snips-asr .................... 0.63.3 (running)
snips-audio-server ........... 0.63.3 (running)
snips-dialogue ............... 0.63.3 (running)
snips-hotword ................ 0.63.3 (running)
snips-nlu .................... 0.63.3 (running)
snips-skill-server ........... 0.63.3 (running)
snips-tts .................... 0.63.3 (running)

HASS.IO MQTT Log

[15:19:50] INFO: Setup mosquitto configuration
[15:19:50] WARNING: SSL not enabled - No valid certs found!
[15:19:50] INFO: No local user available
[15:19:50] INFO: Initialize Hass.io Add-on services
[15:19:50] INFO: Initialize Home Assistant discovery
[15:19:50] INFO: Start Mosquitto daemon
1569845990: mosquitto version 1.6.3 starting
1569845990: Config loaded from /etc/mosquitto.conf.
1569845990: Loading plugin: /usr/share/mosquitto/auth-plug.so
1569845990: |-- *** auth-plug: startup
1569845990:  ├── Username/password checking enabled.
1569845990:  ├── TLS-PSK checking enabled.
1569845990:  └── Extended authentication not enabled.
1569845990: Opening ipv4 listen socket on port 1883.
1569845990: Opening ipv6 listen socket on port 1883.
1569845990: Opening websockets listen socket on port 1884.
1569845991: Warning: Mosquitto should not be run as root/administrator.
1569845991: New connection from 192.168.1.112 on port 1883.
1569845991: New connection from 192.168.1.112 on port 1883.
[INFO] found mqtt_login on Home Assistant
1569845993: New client connected from 192.168.1.112 as snips-dialogue|3113-raspberrypi-1 (p2, c0, k10, u'mqtt_login').
1569845993: New connection from 192.168.1.112 on port 1883.
1569845993: New connection from 192.168.1.112 on port 1883.
1569845993: New connection from 192.168.1.112 on port 1883.
1569845993: New connection from 192.168.1.112 on port 1883.
1569845993: New connection from 192.168.1.112 on port 1883.
1569845993: New connection from 192.168.1.112 on port 1883.
1569845993: Socket error on client <unknown>, disconnecting.
1569845993: New client connected from 192.168.1.112 as snips-watch|3644-raspberrypi-1 (p2, c0, k10, u'mqtt_login').
1569845993: New client connected from 192.168.1.112 as snips-hotword|3105-raspberrypi-1 (p2, c0, k10, u'mqtt_login').
1569845993: New client connected from 192.168.1.112 as snips-nlu|3106-raspberrypi-1 (p2, c0, k10, u'mqtt_login').
1569845993: New client connected from 192.168.1.112 as snips-tts|3114-raspberrypi-1 (p2, c0, k10, u'mqtt_login').
1569845993: New client connected from 192.168.1.112 as snips-asr|3112-raspberrypi-1 (p2, c0, k10, u'mqtt_login').
1569845993: New client connected from 192.168.1.112 as snips-injection|3116-raspberrypi-1 (p2, c0, k10, u'mqtt_login').
1569845996: New connection from 172.30.32.1 on port 1883.
1569845996: New client connected from 172.30.32.1 as auto-A9085AD8-9D7E-4B2F-C12E-F5298CF0EED9 (p2, c1, k60, u'mqtt_login').
1569845997: New connection from 192.168.1.112 on port 1883.
1569845997: New client connected from 192.168.1.112 as snips-audio-server|3866-raspberrypi-1 (p2, c0, k10, u'mqtt_login').

sam test speaker / microphone works great

Snips is on RPI 3B+
mic is respeaker 4-mic array

I don’t think you ruined it, MQTT looks fine and speech is also recognized, yet the Home Assistant is not answering.

I don’t use apps from the store as mentioned before (maybe I will later when I got more used to it and can troubleshoot them) as I mostly had problems with them, there aren’t many in the german store and most have bad or no documentation.

I also noticed that most addons use some HASS integration that seems to be there to make Snips work with Home Assistant right away. However I never had success with using one of those apps.I don’t use this as MQTT seems sufficient to me.

In the end that always was the showstopper on my own tries (as stated in the initial post) and thats the reason why I went this way for a first time setup and published it :wink:

What I want to say: I can’t help you with these predefined apps and would recommend you to create an assistant with just a small app created by you and a simple intent and corresponding intent_script to test your setup.

the problem is that on snips watch it don’t see it recognize my speech: what’s the time?
Hotword is detected but the speech doesn’t

Yeah…I just don’t know what the assistant / app you installed is supposed to do, how to do it and what it should even recognize.

Really, to be sure if your setup is ok or not you should create one very cheap intent and script to test.

I did it: PlaySong which starts to play an mp3 file in HASS.IO.
Snips doesn’t seem to get my speech, except for the hotword

That’s crazy, have no idea what that could be. I mean it hears your hotword…

Maybe just try another fresh installation if there’s not much on it yet. Sometimes that saves a lot of time :wink:

I eventually manages to get SNIPS to work again.
I had to change some settings that were deleted when I did a fresh installation.
It took me hours to find the solution.
Bach on the horse :slight_smile:

Ok, back in business.

I can’t figure out how to enter the entity dynamically.

I have a location slot in snips which should refer to the media player i want to start and play a song.

In hsss i have all my media players defined with a name.

When I put {{ Location }} in the entity_id it gives an error and doesn’t work.

intent_sctipt:
PlaySong:
    speech:
        type: plain
        text: 'OK, Playing song in {{ Location }}'
    action:
      - service_template: media_player.play_media
        data_template:
            entity_id: media_player.{{ Location }}
            media_content_id: local:track:song.mp3
            media_content_type: music

media_player:
  - platform: mpd
    host: 192.168.XXX.XXX
    name: master_bedroom_player

Is Snips passing {{ Location }} in lower case with underscores?

If it is passing for example “Master bedroom player” instead, you have two options:

  1. Use the replace and lower filters to transform the Location string.

OR

  1. In Snips create a custom slot for your media players (for “Location”). In there add a value “master_bedroom_player” and give “master bedroom player” as a synonym.

Thanks.
Eventually i used the site_id parameter in snips pref file

site_id is also very cool when using satellites. I use it when the group / room is not defined. So when I am in the bedroom and just say “Lights off” it will switch them off in the bedroom.

Hey @HorizonKane,
short info to give you a feedback.
I have set up another Pi with HassIO (additionally to my Snips-PI) and got it running. I needed to modify some of your recommendation based on my requirements but more or less the “system” is running well.
Next step will be the Template-Design within Hass to get a “nice” connectivity with snips :slight_smile:
Ciao
DJ
PS: und wiederholt Grüße aus dem Pott