Who has got snips working on Hassio?

Hi, this i my configuration:

hassio

{
“mqtt_bridge”: {
“active”: true,
“host”: “xxx.xxx.xxx.xxx”,
“port”: 1883,
“user”: “usr”,
“password”: “pw”
},
“mic”: “1,0”,
“speaker”: “0,0”,
“assistant”: “assistant.zip”
}

yaml

mqtt:
broker: xxx.xxx.xxx.xxx
client_id: home-assistant-1
keepalive: 60
username: usr
password: pw

snips:

intent_script:
user_X8Db1ZKm3Wy__off:
action:
- service: light.turn_off
entity_id: light.light_1

THX, Alex

So … comparing your log output and the configuration file reveals that snips is not connecting to the given IP address and is opening a default connection at 127.0.0.1 . Hence it does not find any intent at this IP .
Please change the IP to 127.0.0.1 for the mqtt broker in the co figuration.yaml file for test and restart the rpi3.

@ako You may have figured it out but you don’t need the user info in the intent name. HA strips that off so you would just use off if that is the intent name.

You can monitor the mqtt broker to see what the intents are

On the HA server, I use mosquitto_sub from mosquitto-clients package, don’t just watch hermes/# or you get a lot of audio noise. Note this is also a good reason to run your mqtt broker on the snips server since snips uses mqtt to pass all the audio data around. You get a ton of network traffic otherwise.

mosquitto_sub -h MQTT_IP -p 1883 -t ‘hermes/intent/#’

On the snips server, snips_watch listens for all the the hermes messages and parses them out for you

snips-watch -vvv -b MQTT_IP:1883

1 Like

You need to include the siteId as well as the text.

Are you watching the snips mqtt with snips_watch -vvv? Will show the messages as they come across

you can test using mosquitto_pub, part of the mosquitto-clients package usually.

mosquitto_pub -h SNIPS_MQTT_IP -p 1883 -t hermes/tts/say -m “{"siteId":"default","text":"hi there"}”

Note, you can also play a wav file directly to the audio server. With this you could get the file cached from the google say or something.

mosquitto_pub -h SNIPS_MQTT_IP -t ‘hermes/audioServer/default/playBytes/0049a91e-8449-4398-9752-07c0e1858234’ -f /usr/share/sounds/alsa/Front_Center.wav

You can see how I set it up here.

I have my snips working, but wanted to do a test with snips on a different pi.
You can test your intent_script by publishing the right json to the right topic.

You can test by publishing to the MQTT broker you use to hermes/nlu/intentParsed
Paste the code in which you can directly copy from the console test in snips.io.
You only have to remove “Alpha” before the intentName or add it to HA.

Json:

{
  "input": "turn on the ligths",
  "intent": {
    "intentName": "ActivateObject",
    "probability": 0.9337521
  },
  "slots": [
    {
      "rawValue": "ligths",
      "value": {
        "kind": "Custom",
        "value": "ligths"
      },
      "range": {
        "start": 12,
        "end": 18
      },
      "entity": "objectType",
      "slotName": "objectType"
    }
  ]
}

Home assistant:

    intent_script:
      ActivateObject:
        action:
          - service: light.turn_on
            entity_id: light.kitchen

From my point of view and based on other comments in this thread snips on hassio with hassio addon doesnt work (HA + Snips on same rasperry).
The problem seems always the same:

  • Hotword detected
  • STT Works
  • Intents won’t be parsed (no intent through mqtt)

On the other hand if sending mqtt “fake intent” (this is what @Romkabouter told above) works fine (HA does what it should).

Does snips installed through hassio addon fully work for somebody (does somebody get intents)?

Yes, it works for me. But the addons is for version 0.5.5 and when you are downloading a new assisant now, that will not work. There were breaking changes, for instance the assistant is now in /usr/share/snips
The result is that your new assistant will not work with the Hassio addon.

Thank you - Your answer explains almost everything and most of the errors in this thread. Now its time to fix :wink:

Looks like the snips addon was updated to 0.6.5 (which means it should now be compatible with new assistants).

However - now I get always message “Couldn’t find any assistant”…

I think this addon is broken now.
When I check the run.sh on https://github.com/home-assistant/hassio-addons/blob/master/snips/run.sh
it says somewhere in the end: unzip -o -u “/share/$ASSISTANT” -d “$SNIPS_CONFIG”
where $SNIPS_CONFIG is a link to /opt/snips/config.

But the new release expects the assistant files in /usr/share/snips, not /opt/snips/config
This can be read here: https://github.com/snipsco/snips-platform-documentation/issues/13

1 Like

My final thoughts about using Snips on same raspberry like HA; Don’t do it.
Using Snips on a separate rasperry pi 3 model b (don’t use model b+ - it won’t work !!) makes everything easier;

Updating and debugging are a lot safer / faster and response time of snips improved.

it looks like the issue @zubay spotted and @Romkabouter linked to is still present. I attempted the hassio plugin install last night and got the same error.
“Couldn’t find any assistant"
hopefully this will be an easy fix - i’m very much looking forward to using snips as a multi room system, amd i’m hoping that with some templating snips can become essentially ‘room aware’ by simply injecting the streaming servers (room) id into the message. exciting times!

1 Like

There is some oddness in the docker image that causes this issue. Someone familiar with docker would need to dig into it.

Just for info if sb needs it. With new assistants the intent in HA has to start with Snips username, so for example:

  zubay:turn_off_light:
      speech:
      text: Turning {{ room }} lights off
    card:
  type: simple
  ....
1 Like

im getting to errors on trying to setup snips
i have put the assistant zip file inside share folder on HASSIO Samba

Couldn’t find any assistant
Warning: Mosquitto should not be run as root/administrator

any ideas?

the warning is just that - a warning, not an error. As i understand it the big problem is the ‘couldn’t find any assistant’ message - i’ve got that error too and there’s currently no fix available to my knowledge. a fix to the hassio snips plugin is required :frowning:

:sleepy:
I hope they come with a fix

Created an issue to keep track of it.

1 Like

I’ve commented on the github issue with a patch which works for me.

1 Like

Next issue seems to be ERROR:snips_tts: Error: Unsupported bus type: localhost:1883, which can be reproduced with: /usr/bin/snips-dialogue --bus localhost:1883

Looks like snips know about the issue (fix is to use --mqtt instead, but the docker image is still broken:
https://github.com/snipsco/snips-platform-documentation/issues/18

1 Like