Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bose Soundtouch Speakers Missing #38133

Closed
kbrohkahn opened this issue Jul 23, 2020 · 12 comments
Closed

Bose Soundtouch Speakers Missing #38133

kbrohkahn opened this issue Jul 23, 2020 · 12 comments

Comments

@kbrohkahn
Copy link

The problem

Bose Soundtouch speakers are not being found after upgrading to 0.113.0. They are no longer showing up as entities, but the speakers themselves did not change, are still connected to the network and can play music from Spotify. The discovery integration was previously finding the speakers so I guess it stopped working.

Environment

arch x86_64
chassis desktop
dev false
docker true
docker_version 19.03.11
hassio true
host_os Debian GNU/Linux 10 (buster)
installation_type Home Assistant Supervised
os_name Linux
os_version 4.19.0-6-amd64
python_version 3.8.3
supervisor 229
timezone America/New_York
version 0.113.0
virtualenv false
  • Home Assistant Core release with the issue: 0.113.0
  • Last working Home Assistant Core release (if known): 0.112.X (previous release)
  • Operating environment (OS/Container/Supervised/Core): Container
  • Integration causing this issue: Bose Soundtouch (discovery integration)
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/discovery/

Problem-relevant configuration.yaml



Traceback/Error logs

None

Additional information

@kbrohkahn
Copy link
Author

kbrohkahn commented Jul 25, 2020

Issue persists with the 0.113.1 update, but I was able to manually add all speakers in my configuration.yaml using

  - platform: soundtouch
    host: 10.0.0.201
    port: 8090
    name: Soundtouch Living Room
  - platform: soundtouch
    host: 10.0.0.209
    port: 8090
    name: Soundtouch Dining
  - platform: soundtouch
    host: 10.0.0.220
    port: 8090
    name: Soundtouch Kitchen

Now the speakers are appearing as entities as they should be and all functions appear to be working normally. The zone/slave services are working as well. I guess the integration is working normally but discovery is not, so there is a workaround.

@hdejongh
Copy link

same problem here!

@BorisHruby
Copy link

BorisHruby commented Aug 14, 2020

Same problem here on 0.114.0. Auto-discovery is not working. I was able to add the speaker manually editing my configuration.yaml file using:

media_player:

  • platform: soundtouch
    host: 10.10.10.214
    port: 8090
    name: SoundTouch 30

If I listen to tracks from my library I am able to pause the playing and also start again. Also the arrows for track shifting are working. But if listening to radio from the Lovelace card I am able just to swith off the speaker, that's all. If I want to switch it back on with the corresponding button it just doesn't work. Also after hours of trying almost everything I can't figure out how to make possible such a basic function like the switching between the six presets should be.

@mguaylam
Copy link

mguaylam commented Nov 6, 2020

Same for me. Auto discovery is not finding the speaker but I can see it on Bonjour as : _soundtouch._tcp.

@ttuffin
Copy link
Contributor

ttuffin commented Dec 1, 2020

I believe this is related to a change made upstream in zeroconf 0.27.0 where they "Removed previously deprecated ServiceInfo address constructor parameter and property", which is used by libsoundtouch. If anyone who has a Bose Soundtouch device please try the following:

  1. Clone the libsoundtouch repo: git clone https://github.com/CharlesBlonde/libsoundtouch.git
  2. Install the necessary requirements from requirements.txt
  3. Open libsoundtouch/utils.py and change line 102
    from: address = socket.inet_ntoa(info.address)
    to: address = info.parsed_addresses()[0]
  4. Open up a python interpreter and do:
>>> from libsoundtouch import discover_devices
>>> devices = discover_devices(timeout=2)
>>> print(devices)

Does it work? Great! We need to patch upstream and then test again with HASS.
Do you get an error? If so, what?
No error but also no devices listed? Are you sure your device has Soundtouch in the name? I made the mistake of purchasing the Smart Soundbar 300, which is different to the Soundtouch 300 and the Smart soundbar does not have the necessary API for integration. Hence why I can't test this patch.

@hellspawny2k
Copy link

Good Morning,
i have done your request, running in the following error:

>>> from libsoundtouch import discover_devices
>>> devices = discover_devices(timeout=2)
Exception in thread zeroconf-ServiceBrowser__soundtouch._tcp.local.:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3/dist-packages/zeroconf/__init__.py", line 1557, in run
    self._service_state_changed.fire(
  File "/usr/lib/python3/dist-packages/zeroconf/__init__.py", line 1333, in fire
    h(**kwargs)
  File "/usr/lib/python3/dist-packages/zeroconf/__init__.py", line 1427, in on_change
    listener.add_service(*args)
  File "/root/libsoundtouch/libsoundtouch/utils.py", line 102, in add_service
    address = socket.info.parsed_addresses()[0]
AttributeError: module 'socket' has no attribute 'info'
>>> print(devices)
[]

@ttuffin
Copy link
Contributor

ttuffin commented Feb 8, 2021

@hellspawny2k, your change to line 102 is incorrect. You changed it to address = socket.info.parsed_addresses()[0], when it should be address = info.parsed_addresses()[0]. Please update it and try again.

@hellspawny2k
Copy link

@ttuffin , next time i read it ;)
now it works. Here is the output:

>>> from libsoundtouch import discover_devices
>>> devices = discover_devices(timeout=2)
>>> print(devices)
[<libsoundtouch.device.SoundTouchDevice object at 0x7f3cebe45cd0>, <libsoundtouch.device.SoundTouchDevice object at 0x7f3cebe459a0>]

@ttuffin
Copy link
Contributor

ttuffin commented Feb 9, 2021

Thanks @hellspawny2k. We need to patch the libsoundtouch library to fix the autodiscovery, but it looks like the repo has been dormant for quite some time. I've tried reaching out to the owner to see if we can get a PR through. If that fails, we may need to look at forking the repo.

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@Gompman
Copy link

Gompman commented Jun 28, 2021

Unfortunately, auto discovery still does not work. Please activate the issue again.

@ttuffin
Copy link
Contributor

ttuffin commented Jun 28, 2021

@Gompman I tried contacting the owner of the libsoundtouch library but unfortunately I never heard anything back. Since that repo is dead in the water I think it's best to fork it, make the necessary changes and release it on PyPi under a different name and update the HA Soundtouch integration to use the new package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants