google-home-notifier-python icon indicating copy to clipboard operation
google-home-notifier-python copied to clipboard

StopIteration Error - docker-compose up

Open AmirNaghibi opened this issue 4 years ago • 2 comments

I get the following error after running docker-compose up :

Attaching to home-notifier
home-notifier  | INFO:root:Starting up chromecasts
home-notifier  | INFO:root:Searching for None
home-notifier  | Traceback (most recent call last):
home-notifier  |   File "main.py", line 19, in <module>
home-notifier  |     cast = next(cc for cc in chromecasts if cc.device.friendly_name == chromecast_name)
home-notifier  | StopIteration
home-notifier exited with code 1

I changed GRP_NAME in Dockerfile to the device name. I have only one Google Device.

AmirNaghibi avatar Oct 26 '21 19:10 AmirNaghibi

I believe there is something wrong with my GRP_NAME. I found GRP_NAME by:

  • going into the Google Home app
  • Clicking on Google Home Mini
  • Clicking on the cog ⚙️ icon on the top right
  • Selecting Device Information
  • Getting Device Name

AmirNaghibi avatar Oct 26 '21 19:10 AmirNaghibi

The comment on that line states:

#set envar to match your speaker or group name

This is saying that you should set the GRP_NAME environment variable to the name of your speaker/group. Instructions of how to do this in Windows can be found at https://phoenixnap.com/kb/windows-set-environment-variable#ftoc-heading-4 After setting the environment variable, you will have to restart main.py

Alternatively, you can change the line to set the speaker name directly. If you are unfamilar with python, the end result would look something like this:

cast_name = Living Room Speaker

I hope this helps!

Codisimus avatar Jun 04 '22 13:06 Codisimus