B5r1oJ0A9G / teufel_raumfeld

Integration for Teufel smart speaker (aka Raumfeld Multiroom) into https://www.home-assistant.io/.
GNU General Public License v3.0
33 stars 7 forks source link

No media entity is created #44

Closed JimboJones3101 closed 1 year ago

JimboJones3101 commented 1 year ago

Hi there, it seems that its only me only struggeling with this component :(

I was using this component frequently the last weeks, when all of a sudden it stopped working. I checked HA didnt find nothing, redownloaded the component and reconfigured and figured out that my host is recognised. 2 Devices are recognised (seems correct as I have an Teufel S and Teufel M) but only 6 entities are created. Per device this is :

No media entity is created, no zone no nothing. I enabled logging and this is the error I'm getting when reloading the integration:

Logger: homeassistant.components.media_player
Source: loader.py:1045
Integration: Media player ([documentation](https://www.home-assistant.io/integrations/media_player), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+media_player%22))
First occurred: 19:59:56 (2 occurrences)
Last logged: 20:04:16

Error while setting up teufel_raumfeld platform for media_player
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/teufel_raumfeld/media_player.py", line 133, in async_setup_entry
    entity_registry = await hass.helpers.entity_registry.async_get_registry()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1045, in __getattr__
    value = getattr(self._module, attr)
AttributeError: module 'homeassistant.helpers.entity_registry' has no attribute 'async_get_registry'

Anything I can try to get this fixed?

btittelbach commented 1 year ago

looks like a duplicate of https://github.com/B5r1oJ0A9G/teufel_raumfeld/issues/36

I also currently have troubles with this integration.

alexludwigklein commented 1 year ago

I experimented a bit and changing line 133 in /config/custom_components/teufel_raumfeld/media_player.py to the following works for me, i.e. media_player entities are created:

entity_registry = hass.helpers.entity_registry.async_get(hass)

JimboJones3101 commented 1 year ago

Hey there, it was alexludwigklein's comment that fixed the issue for me. For documentation purposes or if anybody else is suffering from the same issue:

For me it was line 134 which was: entity_registry = await hass.helpers.entity_registry.async_get_registry()

I changed it to: entity_registry = hass.helpers.entity_registry.async_get(hass)

Thanks again to everyone!

DonaldGermany commented 1 year ago

I also did this modification as had the same fault. Now entities are back but doesn't show the actual status (e.g. play, pause, title) when done by the Raumfeld app. If music is started by the HA mediaplayer then it does show the status. I still get a fault message, but a different one than before.

Logger: homeassistant.components.sensor Source: custom_components/teufel_raumfeld/sensor.py:50 Integration: Sensor (documentation, issues) First occurred: 23:06:54 (1 occurrences) Last logged: 23:06:54

Error while setting up teufel_raumfeld platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/teufel_raumfeld/sensor.py", line 50, in async_setup_entry device_name = raumfeld.device_udn_to_name(renderer_udn) File "/usr/local/lib/python3.10/site-packages/hassfeld/init.py", line 362, in device_udn_to_name device_name = self.resolve["devudn_to_name"][device_udn] KeyError: ''

Does anyone have an idea how to make this work again?