A new Snips hass.io add-on

The core snips add-on seems to exist only for assistants that route everything through Home Assistant, which isn’t very useful, IMO. There are some things Home Assistant can’t do (yet), other things that just don’t makes sense (to me) to route through Home Assistant, and still others which are very difficult to route through Home Assistant.

I’ve created a new add-on which makes it possible to run skills which are local to snips, including skills that are hosted on github. This will let you include many of the apps from the snips app store in your assistant. It will even let you provide a configuration file for those apps which need one (which will be many of them).

This add-on isn’t ready for everyone yet, so feedback is essential, and the installation process isn’t as nice as it could be. This add-on provides an AppArmor profile, and you may find that it won’t start at all, or that one or more skills fail. If so, please report issues on github.

Known Limitations:
This add-on requires the use of one or more snips satellites, and is only available for amd64. If enough people are willing to help me test, I can make it work on other architectures, and support local audio, too, so that satellites are not required.

Dependencies:
You must install and configure the official Mosquitto Broker add-on (or the community MQTT Server & Web client?).
You have to be able to access the /addons and /share directories. The Samba share and SSH server addons are good ways to do this.

To install:
1. Clone the repository at https://github.com/franc6/snips-hassio-addon.git into your /addons directory.
2. Go to the hass.io page and click the “Add-on Store” link.
3. Click the refresh symbol in the top right corner.
4. You should now see “Snips.AI Base (no local audio)” in the “Local add-ons” section.

  1. Add a new add-on repository, https://github.com/franc6/snips-hassio-addon
  2. You should see a new section, Snips.AI (TOM).
  3. Install the “Snips.AI Base (no local audio)” add-on from that section as you would any other add-on.
  4. Read the configuration information completely, and configure the add-on before you start it.
  5. Configure your satellite(s) (as documented in the add-on).
  6. Report any problems by opening a new issue at https://github.com/franc6/snips-hassio-addon/.
3 Likes

Why clone your repository? Why not use “Add repository by URL”?

Oh, I see, it does not work.

May I suggest you look at this Add-on https://github.com/korylprince/hassio-caddy
And make your repository look like this one with the Add-on files in a dedicated directory and a repository.json file.

That’s a great question, and thanks for asking! The reason is for now, I really expect there will be problems. It’s much faster when someone encounters a problem for me to make a fix in the dev branch, and ask the person to run “git checkout dev” followed by a repeat of steps 2 & 3 to get my attempted fix, rather than make a release, wait for docker hub to build it, and let everyone see something new. Especially if I’m in a rush, make a stupid typo break something basic that I forgot to check. :slight_smile:

After I’m more confident in its stability, I’ll make it so you can add a repository. It’s intentional that you can’t do it yet. :slight_smile:

I’m running Hassio, I don’t see an addon folder?

The /addons folder is available through the “Samba share”, “SSH server” (both in the “Official add-ons”), or the “SSH & Web Terminal” addons (in the “Community Hass.io Add-ons”). They provide slightly different methods of access, which are probably best discussed elsewhere. :slight_smile:

I personally find it simplest to use the “Samba share”, because it’s easy to mount each directory on Windows, Linux, and Mac. Once it’s installed and running, use your system documentation for help in mounting the share named “addons” to your computer. That is the folder I’m referencing.

If you prefer ssh, I don’t recall if git is available there, so you’d have to use something like “sshfs” on your computer to make it work. There’s lots of documentation on that on the 'net in general.

I hope that helps without being too verbose or telling you too many things you already know.

That’s a great idea as the official snips addon in hassio was unusable based on my past experience with it ! Does it allow to edit the snips main configuration file ? (it’s or was impossible with the hassio existing addon !).
If I understand well your addon, SNIPS is running on hassio computer but only server (no audio detection on hassio host itself) and all audio zones are done through satellite ? which is great if it is like that and will test it then once you confirm :smiley:

I use ssh. Ok, I found the addon folder, it is at the top level.
All clear from my side, thanks.

1 Like

You can supply your own snips.toml file, but you can’t edit the one it generates – you have to supply the whole thing. And if you supply the whole snips.toml file, all configuration items related to the snips.toml file (only custom_tts and snips_google_asr for now) will be ignored. It assumes if you want to supply your own snips.toml, that you know what you’re doing. Just place it in /share/snips as snips.toml, and it’ll find and use that. This is listed in the readme.md file, but not very prominently. I’m more than happy to take suggestions on how to make this more clear, or any suggestions on handling edits to the file it generates.

You understand (mostly) correctly. Audio data is still sent from the satellite to the hassio host. The satellites will handle hotword detection, but the speech recognition runs on the base. That’s just how snips works for now. I suspect that some more changes are coming in that area, but that’s just my guess. As I see new stuff, I’ll do my best to adjust this addon to accommodate a range of ways to do it. I suspect, the more processing that can be shoved onto the satellites, the better. And if you find that my understanding of how to best achieve this is incorrect, please let me know!

I do know some people are running hassio on rpis and other smaller computers with speakers and microphones attached, so my TODO list does include adding the ability to do all the processing on the base so satellites are an option, not a requirement. But for me, the computer running hassio is a VM on a server in the basement, no where near where I want to use voice control, so the ability to use satellites and shove as much processing onto them as I can will always be my goal.

An update to this is now available. This update fixes a bug where it would always run snips-watch, ignoring your configuration. It allows for updating the assistant without restarting the whole addon. If your assistant contains Home Assistant snippets, those snippets will now be configured in Home Assistant – you don’t need to set up the intent_script for them. Finally, the apparmor configuration has been updated, to lock it down more.

If you haven’t installed to give it a try yet, follow the directions above. If you have already done that, then you should:

  1. Go to your /addons directory, and cd into snips-hassio-addon.
  2. Run “git pull”
  3. Go to the hassio page and click the “Add-on Store” link.
  4. Click the refresh symbol in the top right corner.
  5. You should now see that “Snips.AI Base (no local audio)” has an available update.
  6. Use the UI to update.

As always, feedback is greatly appreciated.

Another update is now available. This update fixes an problem add access to confidenceScore, sessionId, siteId, and raw slot values for HA snippets. It reduces the amount of disk space potentially used by the log files. It adds colorized log output (some information in the logs contained ANSI ESC sequences for color, those are no longer displayed, and instead you get colors). Issues #3 & #4 (see github repo) are also fixed.
See previous messages for update and installation instructions.

Another update is now available. This one lets you add my github repository add an add-on repository. Note, too, that by using it as an add-on repository, it should be downloading builds from Docker Hub.

Other new features:

  • Use on-line text-to-speech services
  • Improved (or at least increased) the documentation
  • Added the ability to configure snips skills from the Web UI
  • Reworked start-up so it’s more efficient (it comes up much faster now)
  • Added the ability to start and stop snips-watch on the fly, so you can enable it to debug a problem without having to restart the add-on.
  • Added an option to restart Home Assistant if your snips assistant contains Home Assistant snippets and the Home Assistant configuration was updated for them.
  • Screenshots of the Web UI in README.md

Please note the online text-to-speech services need a lot more testing, and the documentation for them could probably use some improvement.

Finally, I edited the installation instructions at the top to reflect that you can now add this as an add-on repository.

Another new version is now available.

  • This one adds the ability to download and install your assistant from the Snips Console, if you configure your Snips Console email address and password (aka login info). This should work even if your account is linked with GitHub (if sam works, this should work).
  • If you start the add-on and don’t have an assistant ZIP file, you’ll receive better notifications, and, if you have configured your Snips Console login info, the add-on will start, instead of stopping. This lets you use the Web UI to install your assistant.
  • Please note this version includes a BREAKING change to the add-on configuration, in order to make it a little more logical (I hope).

The next release will take a few weeks, as I expect to have less time to work on it, and I hope to get it running on ARM before the next release.

I also need help with translations! If you’re willing to help, please send me a private message here.

Version 0.6.1 is available now. It includes the ability to run on armhf (raspberry pi), although it’s still a very hefty image. I’ll be working to reduce the image size, but please note that because some snips actions use python modules that need to be compiled, the image will always be large. Bearing that in mind, I can only suggest using larger rpis. Please also note that since I don’t have an rpi on which to do any testing, the rpi image has not been tested by me.

Other changes:

  • Snips version 0.64.0 (actually available in 0.5.2)
  • Should now work under hassos (thanks, @jarvistek!)
  • Third-party license agreements for software I directly use are now displayed in the WebUI
  • The WebUI should display more reasonably on small screens, e.g. phones

I’m working to reduce the time it takes to build the images, as right now, you’ll see new versions a couple of hours before the images are available on docker hub. I just haven’t decided on the best way to do it yet.

Just wanted to note, that since Snips has been sold to Sonos, and they’ve announced the closure of the Snips Console, this add-on won’t receive any further updates. It doesn’t make sense to continue, since the add-on cannot work without an assistant, which can only be obtained from the Snips Console. Sonos has taken their new ball and gone home.

Further, as of Jan 31, 2020, all licenses for the add-on are revoked. If you want to continue using it, copying it, distributing it, etc., after Jan 31, 2020, please contact me separately. I’ll be happy to grant you a separate license, if you’re a non-commercial entity. If you’re wondering why, I’m just wanting to prevent Sonos from taking MY ball and going home, too.