TTS on Bluetooth speaker via Raspberry Pi

Perhaps this can help?

Thank Yuran, but i am not able to use “Sudo” command on ssh

Any other alternative tried apt-get and apt. These commands are not supporting hassio environment.

Hi friend,
very interesting guide. You are awesome!
I followed the guide and was able to configure my low-cost bluetooth speakers, visible on home assistant (media_player.tts_bluetooth_speaker).
This a month ago. Now after updating home assistant (my version was very old 52.0) at the current 81.6 improvisation I no longer see the add-on and I have the following error: Error doing job: Task exception was never retrieved
File “/home/homeassistant/.homeassistant/custom_components/media_player/tts_bluetooth_speaker.py”, line 183, in <module>
self._is_standby = True
NameError: name ‘self’ is not defined
I enclose the complete log.

Error doing job: Task exception was never retrieved

Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
result = coro.throw(exc)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 56, in async_setup_component
return await task  # type: ignore
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self  # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/config_entries.py",  line 444, in async_forward_entry_setup
self.hass, component, self._hass_config)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 45, in async_setup_component
return await setup_tasks[domain]  # type: ignore
File "/usr/lib/python3.5/asyncio/futures.py", line 382, in __iter__
return self.result()  # May raise too.
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 118, in _async_setup_component
conf_util.async_process_component_config(hass, config, domain)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/config.py", line 760, in async_process_component_config
platform = get_platform(hass, domain, p_name)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 60, in get_platform
return get_component(hass, PLATFORM_FORMAT.format(domain, platform))
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 92, in get_component
module = importlib.import_module(path)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 673, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/home/homeassistant/.homeassistant/custom_components/media_player/tts_bluetooth_speaker.py", line 183, in <module>
self._is_standby = True
NameError: name 'self' is not defined

Until a month ago everything worked now no more and I just updated homeassistant.
Please help

i think so, updating ha to last version (later 0.76) the component not work. do you have find solution?

I have the same issue. Did you ever find a solution?

I didn’t use bluetooth speaker anymore. I use 3.5 mm jack through rp3.
My problem is it cannot connect bluetooth automatically when I restart ha or rp3.

Hi all.

On 93.1 I get the following error:

[homeassistant.helpers.config_validation] Your configuration contains extra keys that the platform does not support.
Please remove [address].  (See /home/homeassistant/.homeassistant/configuration.yaml, line 325). 
Offending data: {"platform": "tts_bluetooth_speaker", "address": "07:52:41:A5:72:73"}

Thanks for any clue…

From HA 0.95 this component doesn’t work anymore.
Same error, but this time blocks the component from loading at sturtup.
Got this persistent notification:

title: Invalid config
message: The following components and platforms could not be set up:

 - [media-player.tts-bluetooth-speaker](https://home-assistant.io/components/media_player.tts_bluetooth_speaker/)

From your previous post it indicates that you had invalid items that needed removing, From 0.95 it no longer gives warning but errors. You need to fix that.

https://www.home-assistant.io/blog/2019/06/26/release-95/#noteworthy-breaking-changes

Hi and thanks for reply.
To adapt the source code in order to be compatible with HA0.95 is not in my possibility.
I guess that for someone proficient in custom components design this task could be quite easy.
Anyone??
Thanks anyway!!

ps I contacted the author, this component will not be anymore updated.

Are there any alternatives to this?!
This was a great component

Maybe @pkozul will have a chance to adopt the code?

I would love this. I resent having to buy a smart speaker just for announcements…
(my Pi is not easily accessible for a 3.5mm)

It was a simple fix, if anybody needs this I fixed on my fork, I will try to ask to be merged back

I tried on ha 0.100.3 and it looks fine. I didn’t play with the tracker fyi

2 Likes

Perfect. Many thanks!!!

Hi. This still working?
I has do the all things in github, but the media_player in home assistant say nothing…

After install, I got the error: “mediaplayer device is deprecated, modify bluetoothspeakerdivice”.

Is this still able to get back to be working?

For me it not works at all.

Platform error media_player.tts_bluetooth_speaker - Integration 'tts_bluetooth_speaker' not found.
I have that custom module - but no luck there.

same problem