B5r1oJ0A9G / teufel_raumfeld

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

Error while setting up teufel_raumfeld platform for media_player #63

Closed greentux closed 3 weeks ago

greentux commented 1 month ago

HASS 2024.6 2024-06-08 15:47:33.241 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'teufel_raumfeld' accesses hass.helpers.entity_registry. This is deprecated and will stop working in Hom e Assistant 2024.11, it should be updated to import functions used from entity_registry directly at custom_components/teufel_raumfeld/media_player.py, line 148: entity_registry = hass.helpers.entity_registry.asyn c_get(hass), please create a bug report at https://github.com/B5r1oJ0A9G/teufel_raumfeld/issues 2024-06-08 15:47:33.241 ERROR (MainThread) [homeassistant.components.media_player] 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 366, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/teufel_raumfeld/media_player.py", line 148, in async_setup_entry entity_registry = hass.helpers.entity_registry.async_get(hass) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: async_get() takes 1 positional argument but 2 were given

and services will be not longer available

Error executing script. Service not found for call_service at pos 5: Service teufel_raumfeld.abs_volume_set not found

zwerg1395 commented 1 month ago

This has Probably to do with the issue. Detected that custom integration 'teufel_raumfeld' accesses hass.helpers.entity_registry. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from entity_registry directly at custom_components/teufel_raumfeld/media_player.py, line 148: entity_registry = hass.helpers.entity_registry.async_get(hass), please create a bug report at https://github.com/B5r1oJ0A9G/teufel_raumfeld/issues

blackmore190 commented 1 month ago

Since the warning tells that it will stop work in Home Assistant 2024.11 it should work now. I got some equal errors in my log: ''' 2024-06-17 21:31:05.232 ERROR (MainThread) [homeassistant.components.media_player] 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 366, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/teufel_raumfeld/media_player.py", line 148, in async_setup_entry entity_registry = hass.helpers.entity_registry.async_get(hass) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: async_get() takes 1 positional argument but 2 were given '''

Is there anybody with this component working on latest Homeassistant? Is it maybe a problem of coding the Umlaut in media_player Names? I have one that is called "Büro" maybe that is the reason to run in some trouble...

schumi4 commented 1 month ago

My media_player entity has also vanished from my setup, probably after a HA update. Simply states: Diese Entität wird nicht mehr von der Integration teufel_raumfeld bereitgestellt.

zwerg1395 commented 1 month ago

Since the warning tells that it will stop work in Home Assistant 2024.11 it should work now. I got some equal errors in my log: ''' 2024-06-17 21:31:05.232 ERROR (MainThread) [homeassistant.components.media_player] 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 366, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/teufel_raumfeld/media_player.py", line 148, in async_setup_entry entity_registry = hass.helpers.entity_registry.async_get(hass) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: async_get() takes 1 positional argument but 2 were given '''

Is there anybody with this component working on latest Homeassistant? Is it maybe a problem of coding the Umlaut in media_player Names? I have one that is called "Büro" maybe that is the reason to run in some trouble...

From what i saw from other integrations that had the same issue , as soon as they implemented the new way it worked again , which makes me suspect that they already started with the phase out of the function.

It has nothing to do with the ü because i have the same issue without a Umlaut.

klausw01 commented 1 month ago

Hi,

I've no idea if this is a "valid" fix (or workaround) - but here are my changes to /homeassistant/custom_components/teufel_raumfeld/media_player.py: (0.1.15-alpha3)

  1. added new line after line:60 from homeassistant.helpers.entity_registry import async_get

  2. replaced entity_registry = hass.helpers.entity_registry.async_get(hass) at line:148 (or after adding the code of 1) now line:149) with entity_registry = async_get(hass)

At least my speakers go "blue" again at the Overview page and the status is playing/paused media is updated ... unfortunately, none of the commands (play/pause/on/off/vol+/vol-/...) are working - but probably it is worth a start :)

After code changes using File Editor Add On a restart of HA is needed.

Update1: Vol+/Vol- is working fine with the slider - but not with the buttons. Update2: Vol+/Vol- are not working in SingleRoom - in Multiroom configuration (via Teufel Raumfeld App) the buttons are working as well as the song information incl. picture.

klausw01 commented 1 month ago

Find attached my changes based on origin/master

#63_media_player.zip

cogelito commented 1 month ago

I've no idea if this is a "valid" fix (or workaround) - but here are my changes to /homeassistant/custom_components/teufel_raumfeld/media_player.py: (0.1.15-alpha3)

Thank you, that worked for me. Update1: Vol+/Vol- is working fine with the slider - but not with the buttons. Update2: Vol+/Vol- are not working in SingleRoom - in Multiroom configuration (via Teufel Raumfeld App) the buttons are working as well as the song information incl. picture.

In my case all buttons and sliders seem to work correctly.

greentux commented 1 month ago

woked completely for all functions?

cogelito commented 1 month ago

I haven‘t tested single rooms, because I only use multiroom, but that is working flawless again. All buttons and the volume slider are functional and I can switch on/off the single speakers.

B5r1oJ0A9G commented 3 weeks ago

Thanks for reporting this issue! I am closing it since the fix from @klausw01 has been merged and released. If there is still an issue e.g. with single speakers, then please create a dedicated ticket for that issue.