Using Google Home (assistant) speaker for notifications/alarms?

Thanks for sharing this:grin:, it works perfectly here.
I can now be notified on all my google home at once.
I also changed the voice for en-us.

1 Like

How did you get it to notify on all devices?

Thanks

In the Google Home app, under devices, I created a group of speakers named “Main floor”.
Then I modified line 71 of the python script with this line

castdevice = next(cc for cc in chromecasts if cc.device.friendly_name == “Main floor”)

Thanks I have it working.

I haven’t been able to get it working at all, so don’t ask me.

The error I’m receiving is:

Traceback (most recent call last):
  File "GooglePyNotify.py", line 5, in <module>
    from http.server import HTTPServer, SimpleHTTPRequestHandler
ImportError: No module named http.server

I wish I had the skills to help :expressionless:

Are you using Python 3?

Try changing en-us to fr-ca in the script. line 58

How would I know? which gets used by Raspbian by default (since I see both are installed)? As I said, I’m not a programmer. I asked if anyone could provide a SIMPLE set of instructions. I didn’t expect it to be this difficult.

@GhostBassist

Would you happen to know why I get this error on my browser when I reach 192.168.xx.yy:8000/Notify?Hello+World

Error response

Error code: 404

Message: File not found.

Error code explanation: HTTPStatus.NOT_FOUND - Nothing matches the given URI.

Python script gives me “code 404 message file not found”

Ok, so this took me some research. ‘http.server’ is a python3 command. So basically replace all “python -m pip…” with “python3 -m pip…”. Also add sudo to the beginning of the commands starting now. I had to redo everything because i got a permissions error. I also had to install gtts along the way to get it working. But it now works on a fresh install of raspbian! Of course I may not be doing it correctly, but it works…

I think this is everything I ran and should get you going:

sudo python3 -m pip install pychromecast
sudo pip3 install gtts
sudo python3 GooglePyNotify.py

Also thanks @GhostBassist for making this. This is exactly what I have been looking for.

1 Like

Thank you!! Yes, I can confirm that this does in fact work perfectly. :grin:

Try it without the port number

I got the GooglePyNotify working but there’s about a 10-15 second delay which wont work for my purposes.

I also got Cast-Web installed and working, but its not clear to me how I could use this to do notifications based upon events (door open, etc). Is anyone using Cast-Web to do notifications?

Use the Cast-web with the big talker smartapp

I get about 8-10 seconds delay here.
I wish it was a lil quicker too.

Hi,

just read this post about sending a notification to my google home mini and tried to make it work.

Everything’s works except the last part ; the notification is not heard on my google home.
I hear a sound that confirm that google home received “something”, but after the sound I can’t hear anything.

  1. I call the server http://192.168.XX.XX:8090/Notify?TEST+1234
  2. I get
    Notification Sent!
    TEST+1234
  3. A few seconds later I hear the sound on my google home
  4. The browser from where I called the server is now showing Directory listing for /. From there I can hear the Notification.mp3 generated

Any idea ?
thanks

I don’t have the syntax memorized for calls, does BigTalker or similar app see the Google home as a speaker

Looks like the time to convert the text to an MP3 with the gtts call is what takes the majority of the time. Could be sped up by caching the MP3 the first time so subsequent calls are faster. I need to say the same phrases over and over again, so this would be fine for me. I might take a look tonight and do something like this.

I lied. Reusing the MP3 has negligible effect on the time.