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

No device entities created #2

Closed
didericko opened this issue Feb 17, 2021 · 7 comments
Closed

No device entities created #2

didericko opened this issue Feb 17, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@didericko
Copy link

image

Only the media-player entities are there.

@B5r1oJ0A9G B5r1oJ0A9G self-assigned this Feb 18, 2021
@B5r1oJ0A9G
Copy link
Owner

I suspect the device name prefixes differ. With d4f7759 some logging is introduced. I'd be intersted in the log value for raumfeld.wsd. In particular in the #text values of items in the device list:

[...]__init__.py->async_setup_entry: raumfeld.wsd={'devices': [...]('#text', 'Raumfeld ConfigDevice')[...]

Loglevel for teufel_raumfeld must be set to debug in configuration.yaml:

logger:
  default: warn
  logs:
    custom_components.teufel_raumfeld: debug

@didericko
Copy link
Author

OK, i'll send it soon. I use a Raumfeld Expand as host, this may give different device name prefix,

@didericko
Copy link
Author

didericko commented Feb 22, 2021

2021-02-22 07:32:05 DEBUG (MainThread) [custom_components.teufel_raumfeld] Starting web service update thread
2021-02-22 07:32:05 DEBUG (Thread-8) [custom_components.teufel_raumfeld] Update event triggered for type: host_info
2021-02-22 07:32:05 DEBUG (Thread-8) [custom_components.teufel_raumfeld] Update event triggered for type: devices
2021-02-22 07:32:05 DEBUG (Thread-8) [custom_components.teufel_raumfeld] Update event triggered for type: system_state
2021-02-22 07:32:05 DEBUG (Thread-8) [custom_components.teufel_raumfeld] Update event triggered for type: zone_config
2021-02-22 07:32:06 DEBUG (MainThread) [custom_components.teufel_raumfeld] Web service update thread started
2021-02-22 07:32:06 DEBUG (MainThread) [custom_components.teufel_raumfeld] __init__.py->async_setup_entry: raumfeld.wsd={'devices': [OrderedDict([('@udn', 'uuid:099b1ee6-c5c0-4ae8-9b5d-f26aad02ff6f'), ('@type', 'urn:schemas-upnp-org:device:MediaServer:1'), ('@location', 'http://192.168.1.106:59186/099b1ee6-c5c0-4ae8-9b5d-f26aad02ff6f.xml'), ('#text', 'Raumfeld MediaServer')]), OrderedDict([('@udn', 'uuid:3ca4549a-1499-4b66-8c3c-7dce0912aaf9'), ('@type', 'urn:schemas-upnp-org:device:MediaRenderer:1'), ('@location', 'http://192.168.1.106:56447/3ca4549a-1499-4b66-8c3c-7dce0912aaf9.xml'), ('#text', 'woonkamer')]), OrderedDict([('@udn', 'uuid:4cbaa38b-3707-4237-8a47-318b2194d3f5'), ('@type', 'urn:schemas-raumfeld-com:device:RaumfeldDevice:1'), ('@location', 'http://192.168.1.106:55051/4cbaa38b-3707-4237-8a47-318b2194d3f5.xml'), ('#text', 'Teufel Raumfeld Device')]), OrderedDict([('@udn', 'uuid:9b7d7aa0-380e-4f16-ab1e-35b1ad74233e'), ('@type', 'urn:schemas-raumfeld-com:device:RaumfeldDevice:1'), ('@location', 'http://192.168.1.153:59791/9b7d7aa0-380e-4f16-ab1e-35b1ad74233e.xml'), ('#text', 'Teufel Raumfeld Device')]), OrderedDict([('@udn', 'uuid:aa1ec11d-fa45-4177-be80-3dbc3bdace5d'), ('@type', 'urn:schemas-raumfeld-com:device:RaumfeldDevice:1'), ('@location', 'http://192.168.1.144:50004/aa1ec11d-fa45-4177-be80-3dbc3bdace5d.xml'), ('#text', 'Teufel Raumfeld Device')]), OrderedDict([('@udn', 'uuid:c196c0b8-a7f1-49d9-a66e-ecbfba86b1ab'), ('@type', 'urn:schemas-upnp-org:device:MediaRenderer:1'), ('@location', 'http://192.168.1.144:51916/c196c0b8-a7f1-49d9-a66e-ecbfba86b1ab.xml'), ('#text', 'Speaker Keuken')]), OrderedDict([('@udn', 'uuid:d8c27d77-c7d1-4879-a1b1-7b57154ceca2'), ('@type', 'urn:schemas-raumfeld-com:device:ConfigDevice:1'), ('@location', 'http://192.168.1.106:55069/d8c27d77-c7d1-4879-a1b1-7b57154ceca2.xml'), ('#text', 'Raumfeld ConfigDevice')]), OrderedDict([('@udn', 'uuid:f5bab2fc-078d-4a37-ab85-ce5d06c59ab9'), ('@type', 'urn:schemas-upnp-org:device:MediaRenderer:1'), ('@location', 'http://192.168.1.153:55965/f5bab2fc-078d-4a37-ab85-ce5d06c59ab9.xml'), ('#text', 'Speaker woonkamer #2')])], 'host_info': OrderedDict([('hostName', 'Raumfeld Expand'), ('roomName', None)]), 'system_state': OrderedDict([('updateAvailable', OrderedDict([('@value', '0')])), ('listDevicesUpdateID', OrderedDict([('@value', '2981184217')]))]), 'zone_config': OrderedDict([('@numRooms', '2'), ('@spotifyMode', 'multiRoom'), ('zones', OrderedDict([('zone', [OrderedDict([('@udn', 'uuid:3ca4549a-1499-4b66-8c3c-7dce0912aaf9'), ('@spotifyConnect', 'active'), ('room', [OrderedDict([('@name', 'woonkamer'), ('@udn', 'uuid:97c63265-80f6-4b63-b144-bef3fcd56662'), ('@powerState', 'AUTOMATIC_STANDBY'), ('renderer', OrderedDict([('@udn', 'uuid:f5bab2fc-078d-4a37-ab85-ce5d06c59ab9'), ('@name', 'Speaker woonkamer #2')]))]), OrderedDict([('@name', 'Keuken'), ('@udn', 'uuid:fe878c92-5dd5-4fb4-b9d8-d4f101f26d63'), ('@powerState', 'AUTOMATIC_STANDBY'), ('renderer', OrderedDict([('@udn', 'uuid:c196c0b8-a7f1-49d9-a66e-ecbfba86b1ab'), ('@name', 'Speaker Keuken')]))])])])])]))])}
2021-02-22 07:32:06 DEBUG (MainThread) [custom_components.teufel_raumfeld] Media player entity 'media_player.room_woonkamer' is not recognized as speaker group
2021-02-22 07:32:06 DEBUG (MainThread) [custom_components.teufel_raumfeld] Media player entity 'media_player.room_keuken' is not recognized as speaker group
2021-02-22 07:32:06 DEBUG (MainThread) [custom_components.teufel_raumfeld] sensor.py->async_setup_entry: device_udns=['uuid:4cbaa38b-3707-4237-8a47-318b2194d3f5', 'uuid:9b7d7aa0-380e-4f16-ab1e-35b1ad74233e', 'uuid:aa1ec11d-fa45-4177-be80-3dbc3bdace5d']
2021-02-22 07:32:06 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up teufel_raumfeld platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 198, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/teufel_raumfeld/sensor.py", line 58, in async_setup_entry
device_name = raumfeld.device_udn_to_name(renderer_udn)
File "/usr/local/lib/python3.8/site-packages/hassfeld/__init__.py", line 277, in device_udn_to_name
device_name = self.resolve["devudn_to_name"][device_udn]
KeyError: None

@B5r1oJ0A9G
Copy link
Owner

Thanks for the log information!

Can you please run the following code and report back the output? (Remember to replace teufel-host.example.com beforehand)

python3 << EOF
import hassfeld
import traceback

raumfeld_host = "teufel-host.example.com"
raumfeld = hassfeld.RaumfeldHost(raumfeld_host)
raumfeld.start_update_thread()

device_udns = raumfeld.get_raumfeld_device_udns()

for udn in device_udns:
    try:
        print("udn: %s" % udn)
        device_location = raumfeld.device_udn_to_location(udn)
        print("device_location: %s" % device_location)
        renderer_udn = hassfeld.upnp.get_device(device_location, "renderer")
        print("renderer_udn: %s" % renderer_udn)
        device_name = raumfeld.device_udn_to_name(renderer_udn)
        print("device_name: %s" % device_name)
    except:
        traceback.print_exc()
EOF

@B5r1oJ0A9G B5r1oJ0A9G added the bug Something isn't working label Feb 26, 2021
@Competizione
Copy link

Competizione commented Mar 23, 2021

Hi all,
looks like I have a similar issue but don´t recognized with wich update it came in.
So maybe I can help with my log to see what going on.
(running HA Core in a Docker Container on a NAS and may be limited to run codes)

2021-03-23 20:43:31 DEBUG (MainThread) [custom_components.teufel_raumfeld] Setting logging level of hassfeld to: DEBUG
2021-03-23 20:43:31 DEBUG (MainThread) [custom_components.teufel_raumfeld] Starting web service update thread
2021-03-23 20:43:31 DEBUG (Thread-105) [custom_components.teufel_raumfeld] Update event triggered for type: devices
2021-03-23 20:43:31 DEBUG (Thread-105) [custom_components.teufel_raumfeld] Update event triggered for type: system_state
2021-03-23 20:43:31 DEBUG (Thread-105) [custom_components.teufel_raumfeld] Update event triggered for type: host_info
2021-03-23 20:43:31 WARNING (Thread-105) [hassfeld] No 'powerState' attribute provided for room: Bad
2021-03-23 20:43:31 DEBUG (Thread-105) [custom_components.teufel_raumfeld] Update event triggered for type: zone_config
2021-03-23 20:43:31 DEBUG (MainThread) [custom_components.teufel_raumfeld] Web service update thread started
2021-03-23 20:43:31 DEBUG (MainThread) [custom_components.teufel_raumfeld] __init__.py->async_setup_entry: raumfeld.wsd={'devices': [OrderedDict([('@udn', 'uuid:0ae92a93-6c37-4444-9b98-2cd862472f01'), ('@type', 'urn:schemas-upnp-org:device:MediaRenderer:1'), ('@location', 'http://192.168.178.33:53535/0ae92a93-6c37-4444-9b98-2cd862472f01.xml'), ('#text', 'Speaker Bad')]), OrderedDict([('@udn', 'uuid:2da81f91-db61-4c7a-bfb6-2803ee625693'), ('@type', 'urn:schemas-upnp-org:device:MediaServer:1'), ('@location', 'http://192.168.178.33:51927/2da81f91-db61-4c7a-bfb6-2803ee625693.xml'), ('#text', 'Raumfeld MediaServer')]), OrderedDict([('@udn', 'uuid:3f65e163-42c3-4fa1-ab33-a49367313ce2'), ('@type', 'urn:schemas-upnp-org:device:MediaRenderer:1'), ('@location', 'http://192.168.178.33:54251/3f65e163-42c3-4fa1-ab33-a49367313ce2.xml'), ('#text', 'Bad')]), OrderedDict([('@udn', 'uuid:9396a21a-18e0-400e-84c7-f6b218f46a4a'), ('@type', 'urn:schemas-raumfeld-com:device:ConfigDevice:1'), ('@location', 'http://192.168.178.33:52573/9396a21a-18e0-400e-84c7-f6b218f46a4a.xml'), ('#text', 'Raumfeld ConfigDevice')]), OrderedDict([('@udn', 'uuid:d4a7a493-877d-485c-bb63-0d591d3ad2ed'), ('@type', 'urn:schemas-raumfeld-com:device:RaumfeldDevice:1'), ('@location', 'http://192.168.178.33:51497/d4a7a493-877d-485c-bb63-0d591d3ad2ed.xml'), ('#text', 'Teufel Raumfeld Device')])], 'host_info': OrderedDict([('hostName', 'Raumfeld One M'), ('roomName', 'Bad')]), 'system_state': OrderedDict([('updateAvailable', OrderedDict([('@value', '0')])), ('listDevicesUpdateID', OrderedDict([('@value', '2363889898')]))]), 'zone_config': OrderedDict([('@numRooms', '1'), ('@spotifyMode', 'singleRoom'), ('zones', OrderedDict([('zone', [OrderedDict([('@udn', 'uuid:3f65e163-42c3-4fa1-ab33-a49367313ce2'), ('room', [OrderedDict([('@name', 'Bad'), ('@udn', 'uuid:eeca35ce-fd93-4df0-b0dc-ec5f522ef257'), ('renderer', OrderedDict([('@udn', 'uuid:0ae92a93-6c37-4444-9b98-2cd862472f01'), ('@name', 'Speaker Bad')]))])])])])]))])}
2021-03-23 20:43:31 DEBUG (MainThread) [custom_components.teufel_raumfeld] sensor.py->async_setup_entry: device_udns=['uuid:d4a7a493-877d-485c-bb63-0d591d3ad2ed']
2021-03-23 20:43:31 ERROR (MainThread) [hassfeld] Unexpected error with async_get_device: <class 'TypeError'>__init__() got an unexpected keyword argument 'http_headers'
2021-03-23 20:43:31 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up teufel_raumfeld platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/teufel_raumfeld/sensor.py", line 51, in async_setup_entry
    device_name = raumfeld.device_udn_to_name(renderer_udn)
  File "/usr/local/lib/python3.8/site-packages/hassfeld/__init__.py", line 337, in device_udn_to_name
    device_name = self.resolve["devudn_to_name"][device_udn]
KeyError: None
2021-03-23 20:43:41 ERROR (MainThread) [hassfeld] Unexpected error with async_get_transport_info: <class 'TypeError'>__init__() got an unexpected keyword argument 'http_headers'
2021-03-23 20:43:41 DEBUG (MainThread) [custom_components.teufel_raumfeld] media_player.py->async_update_transport_state: Method was called although speaker group '['Bad']' is invalid
2021-03-23 20:43:41 ERROR (MainThread) [hassfeld] Unexpected error with async_get_volume: <class 'TypeError'>__init__() got an unexpected keyword argument 'http_headers'
2021-03-23 20:43:41 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.room_bad fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 277, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 473, in async_device_update
    raise exc
  File "/config/custom_components/teufel_raumfeld/media_player.py", line 731, in async_update
    await super().async_update_all()
  File "/config/custom_components/teufel_raumfeld/media_player.py", line 651, in async_update_all
    await self.async_update_volume_level()
  File "/config/custom_components/teufel_raumfeld/media_player.py", line 606, in async_update_volume_level
    await self._raumfeld.async_get_group_volume(self._rooms) / 100
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

@B5r1oJ0A9G
Copy link
Owner

Thanks for the feedback @Competizione!

A lot of errors are not properly treated or catched yet. This meesage here though:

2021-03-23 20:43:31 ERROR (MainThread) [hassfeld] Unexpected error with async_get_device: <class 'TypeError'>__init__() got an unexpected keyword argument 'http_headers'

Let's me assume the issue you currently face is about a too old version of a dependency to async-upnp-client. See: #7

Recent versions of teufel_raumfeld require async-upnp-client>=0.15.0. Home Assistent is pinning versions of dependencies. You could easily test by manually increasing the pinned version. See: https://github.com/home-assistant/core/pull/47885/files

@B5r1oJ0A9G
Copy link
Owner

Closing as it could not be reproduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants