Google Assistant Webserver in a Docker container

googleassistant
docker
Tags: #<Tag:0x00007fd08d360e88> #<Tag:0x00007fd08d360a28>

#7

Double check your PROJECT_ID is set correctly

google.assistant.library.device_helpers.RegistrationError: Failed to register device INVALID_ARGUMENT (400): Could not get the device instance. Project_id from side channel and project_id from url do not match.


#8

USB sound cards are pretty cheap (~7$ on amazon or maybe even less on aliexpress), I don’t know about the compatibility but it might worth a try.
The SYBA model seems to work fine on the Raspberry Pi for @robwolff3 (is it this one ? https://www.amazon.com/external-Adapter-Windows-Microphone-SD-CM-UAUD/dp/B001MSS6CS)

I do agree that a way to run it without audio input/output would be great though as we don’t specifically use it.

On a side note, the Google assistant Library version 1.0.1 has now limited support for ARMv6 architecture (Raspberry Pi Zero). Which means a new cheap platform to try this on !


#9

Replying to myself :sweat_smile:, with deeper thoughts (well not that deep) I think it should be possible to create a dummy sound card device on linux…


#10

If anyone knows how to do this, could be very beneficial to the project.


#11

Sometimes I’ve got thir error :
UnicodeEncodeError: ‘ascii’ codec can’t encode character ‘\xe9’ in position 42: ordinal not in range(128) stderr
On a Synology nas. Any idea?

How to say to play music with a timer? Thanks !

commands work, but broadcasting no. It was working fine with andbobsyouruncle-amd64-google-assistant-webserver. Is it playing only on soundcard?


#12

\xe9 is a small letter E with an acute accent mark. Try replacing it with a regular e.


#13

Yes I know, I’m french and this characters are regularly employed. I don’t undersand why it does’nt work, while it work with andbobsyouruncle on the same platform.

Thanks for your help.


#14

You’re definitely right.
Sorry for the noob question: I’m very new to home assistant and am using Hass.io. I only installed new things using the hassio plugins.

Can I install this in hassio? If yes: will it discover the USB soundcard?


#15

@capstan1 This project is not made to work with Hass.io. Personally I use Docker so this was easy to just share with others to use. The only solution for Hass.io right now is AndBobsYourUncle’s however it cannot cast remote media (spotify). Anyone is welcome to take what I / we’ve done and make it an add-in for Hass.io.


#16

I don’t need streaming necessarily (would be a great addition to have though). My problem with the hassio plugin is only that broadcasting isn’t working for me, so I wanted to try your solution.


#17

For me it works without real soundcard enabled, using:
sudo modprobe snd-dummy

I’m able to use it and play music on selected device. Many thanks for great work.


#18

Does this solution also suffer from the issue with the google home saying “incoming broadcast from x” or have you somehow been able to get around it?


#19

It has the same issue, we cannot disable that as long as Google doesn’t provide an option.

My Google Home is setup in french and didn’t have this issue at first, but Google recently rolled out an update in France that’s also changed the behavior of broadcasted messages. (For once I was glad updates were late :sweat_smile:)


HA to trigger Alexa routine
#20

Using sudo modprobe snd-dummy what devices do you pass into the Docker container. Same that I do? /dev/snd:/dev/snd:rwm


#21

Yes, I’ve passed the same.


#22

This looks very interesting, as I assume this Webserver can run my Google Home Routines? (Which the Hassio version of Google Assistant Webserver does not when I tested).

A few dummy questions though…

Currently Im running HA on Raspberry Pi 3 B+ with Hassio only. Besides this Raspberry Pi and a Windows 10 PC, I dont have any other Linux setup or server. Im not familiar with Docker containers either (sorry for being a newbie), and I wonder if (and how) I can make this to work on my current Raspberry with Hassio, or my Windows 10 PC which is on 24/7 here at home?

Can I install a Docker container on any of these, or should I buy another Raspberry Pi for this purpose?

All I really need this for, is to call my Google Home Routines through buttons/cards in Home Assistant. Or at least be able to call functions like “play spotify on living room speaker” with HA/Lovelace card, which doesnt work with the Hassio version of Google Assistant Webserver.

Thank you


#23

From what I’ve herd Docker on Windows doesn’t work the best yet and is not compatible with Linux based containers. If you don’t have a Docker environment (I have a Docker getting started tutorial here) then your best bet is to run though the Embed the Google Assistant tutorial from Google and run the python script they provide on your Raspberry Pi or another computer.


#24

If you’re running Hass.io then you’re technically already running a Docker environment. Using the Portainer addon you can add any Docker containers you want.


#26

I was able to hack together a working local addon, but noticed it dies after using it to start a cast on another device. I went back and deployed on docker to confirm, and it does the same thing, the difference is the docker setting to restart on failures.

  • is this expected behavior - container dies and has to be restarted after requests?

To get it to work as a local addon I ended up hard coding the variable in the scripts and repointing the folder to the \share map in hassio. I’m sure someone with a little more knowledge with addons could convert this over pretty quickly. I may keep working on it but it’s only second time I’ve done anything with addons and the first was pretty simple.


#27

I don’t have any experience with hassio addons personally. If someone would like to convert this project to an hassio addon or suggest changes to the container to make it more compatible, I welcome it.