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

Could not Connect to Host #13

Closed blackmore190 closed 1 year ago

blackmore190 commented 3 years ago

Hello!

I tried to use this integration to control my Raumfeld speakers via HomeAssistant. Unfortunately, I am stuck at this point: image

I have also tried running the code from here: https://github.com/B5r1oJ0A9G/teufel_raumfeld/issues/2#issuecomment-784570863

the script hung with the following output:

Long-polling failed with error: <class 'TypeError'>list indices must be integers or slices, not str

Thank you very much for the help!

I'm running Teufel Streaming 2.13.4 on my Speakers

B5r1oJ0A9G commented 3 years ago

Hi @blackmore190!

Can you please elaborate in more detail about your setup (devices)? It would also be helpful, if you could provide some logs with debug level enabled for the integration. See https://github.com/B5r1oJ0A9G/teufel_raumfeld/issues/2#issuecomment-780948127.

Best, Marc

blackmore190 commented 3 years ago

Hi,

the HA Log is here:

2021-05-25 07:15:00 WARNING (MainThread) [custom_components.teufel_raumfeld] You are using teufel_raumfeld, which is still in alpha phase and therefore subject to change. This includes, among other things, the addition, redesign or removal of functionality. 2021-05-25 07:15:00 DEBUG (MainThread) [custom_components.teufel_raumfeld] init.py->async_setup: OrderedDict([('default_config', {}), ('tts', [OrderedDict([('platform', 'google_translate')])]), ('group', {}), ('automation', {}), ('script', {}), ('scene', {}), ('logger', OrderedDict([('default', 'warn'), ('logs', OrderedDict([('custom_components.teufel_raumfeld', 'debug')]))])), ('sensor', [OrderedDict([('platform', 'mqtt'), ('name', 'Temperatur Bad'), ('device_class', 'temperature'), ('state_topic', '/home/ESP-Bad/BME280/Temperature'), ('unit_of_measurement', '°C')]), OrderedDict([('platform', 'mqtt'), ('name', 'Luftfeuchte Bad'), ('device_class', 'humidity'), ('state_topic', '/home/ESP-Bad/BME280/Humidity'), ('unit_of_measurement', '%')]), OrderedDict([('platform', 'mqtt'), ('name', 'Luftdruck Bad'), ('device_class', 'pressure'), ('state_topic', '/home/ESP-Bad/BME280/Pressure'), ('unit_of_measurement', 'hPa')]), OrderedDict([('platform', 'mqtt'), ('name', 'Temperatur Büro'), ('device_class', 'temperature'), ('state_topic', '/home/ESP-Buero/BME280/Temperature'), ('unit_of_measurement', '°C')]), OrderedDict([('platform', 'mqtt'), ('name', 'Luftfeuchte Büro'), ('device_class', 'humidity'), ('state_topic', '/home/ESP-Buero/BME280/Humidity'), ('unit_of_measurement', '%')]), OrderedDict([('platform', 'mqtt'), ('name', 'Luftdruck Büro'), ('device_class', 'pressure'), ('state_topic', '/home/ESP-Buero/BME280/Pressure'), ('unit_of_measurement', 'hPa')])])]) 2021-05-25 07:15:00 DEBUG (MainThread) [custom_components.teufel_raumfeld] Setting logging level of hassfeld to: DEBUG 2021-05-25 07:15:00 DEBUG (MainThread) [custom_components.teufel_raumfeld] Starting web service update coroutine 2021-05-25 07:15:00 DEBUG (MainThread) [hassfeld] init.py->async_update_all: Session for webservice requests was passed. 2021-05-25 07:15:00 DEBUG (MainThread) [custom_components.teufel_raumfeld] Update event triggered for type: host_info 2021-05-25 07:15:00 DEBUG (MainThread) [custom_components.teufel_raumfeld] Update event triggered for type: devices 2021-05-25 07:15:00 DEBUG (MainThread) [custom_components.teufel_raumfeld] Update event triggered for type: system_state 2021-05-25 07:15:00 CRITICAL (MainThread) [hassfeld] Long-polling failed with error: <class 'TypeError'>list indices must be integers or slices, not str

My HA Setup is inside a Docker Container running on Synology NAS, i have installed Teufel Raumfeld extension via HACS.

My Speaker Setup is: 5 Rooms Host = Cinebar Lux 1 Room with Teufel One S + Stereo Cubes all other Rooms with just 1 Speaker

My Teufel Raumfeld Products running in my Setup: "Teufel Cinebar Lux", "Teufel One S", "Raumfeld One S", "Raumfeld Connector 2", "Raumfeld Stereo Cubes"

B5r1oJ0A9G commented 3 years ago

Thanks!

May I ask you to also provide me the XML responses, when opening the web service URLs as mentioned in https://github.com/B5r1oJ0A9G/teufel_raumfeld/issues/1#issuecomment-782599880?

blackmore190 commented 3 years ago

shure. Here they are:

GetHostInfo:

<hostInfo>
    <hostName>Teufel Cinebar Lux</hostName>
    <roomName>TV</roomName>
</hostInfo>

getZones:

<zoneConfig numRooms="5" spotifyMode="singleRoom">
    <zones>
        <zone udn="uuid:2aeaf738-fd02-4293-be10-f4cf4e7aecd0">
            <room name="Büro" udn="uuid:b2864d9b-61d2-452e-84aa-6a1d7e3e67af" powerState="AUTOMATIC_STANDBY">
                <renderer udn="uuid:0fef1797-c1d3-45f5-9ba9-1a578ffc6ff5" name="Speaker Büro #2"/>
            </room>
        </zone>
        <zone udn="uuid:7fda471e-324c-4a22-9621-ea9f380caece">
            <room name="Bad" udn="uuid:53a1ffb1-1bb0-4232-9fe4-1d44f7e389e9" powerState="AUTOMATIC_STANDBY">
                <renderer udn="uuid:54284577-e19d-4132-a95b-8972084e77ec" name="Speaker Bad #2"/>
            </room>
        </zone>
        <zone udn="uuid:ffffffff-ef46-88e5-ffff-ffffef4688e5">
            <room name="TV" udn="uuid:4bef4e97-b706-4717-b603-6db7e5620e96" powerState="AUTOMATIC_STANDBY">
                <renderer udn="uuid:59bb2a83-1356-4c93-b9aa-a60643efebc4" name="Speaker TV"/>
            </room>
            <room name="Küche" udn="uuid:68b41d52-a2fb-4d17-8c16-895c78de3f3a" powerState="AUTOMATIC_STANDBY">
                <renderer udn="uuid:cbf4ee89-5935-434c-bf87-016cf4fa8cce" name="Speaker Küche #2"/>
                <renderer udn="uuid:e7ee4e9a-b8cd-4831-8d7c-9ab38cbb32bb" name="Speaker Küche #3"/>
            </room>
        </zone>
    </zones>
    <unassignedRooms>
        <room name="Werkstatt" udn="uuid:a63691ce-bc77-4e40-9d83-ed90618e3f2f" powerState="AUTOMATIC_STANDBY">
            <renderer udn="uuid:9d858531-2dd7-4803-abfa-7663ad4fdefd" name="Connector Werkstatt"/>
        </room>
    </unassignedRooms>
</zoneConfig>

list devices:

<devices>
    <device udn="uuid:02ced250-99a9-4fd6-8a88-eca646637753" type="urn:schemas-raumfeld-com:device:RaumfeldDevice:1" location="http://192.168.0.72:58639/02ced250-99a9-4fd6-8a88-eca646637753.xml">Teufel Raumfeld Device</device>
    <device udn="uuid:0fef1797-c1d3-45f5-9ba9-1a578ffc6ff5" type="urn:schemas-upnp-org:device:MediaRenderer:1" location="http://192.168.0.71:59688/0fef1797-c1d3-45f5-9ba9-1a578ffc6ff5.xml">Speaker Büro #2</device>
    <device udn="uuid:1e1262ed-3f1a-444e-b494-f2509cedd88a" type="urn:schemas-raumfeld-com:device:RaumfeldDevice:1" location="http://192.168.0.71:57801/1e1262ed-3f1a-444e-b494-f2509cedd88a.xml">Teufel Raumfeld Device</device>
    <device udn="uuid:29cd675c-3864-436d-b648-23416a2c1778" type="urn:schemas-raumfeld-com:device:RaumfeldDevice:1" location="http://192.168.0.182:51501/29cd675c-3864-436d-b648-23416a2c1778.xml">Teufel Raumfeld Device</device>
    <device udn="uuid:2aeaf738-fd02-4293-be10-f4cf4e7aecd0" type="urn:schemas-upnp-org:device:MediaRenderer:1" location="http://192.168.0.177:60978/2aeaf738-fd02-4293-be10-f4cf4e7aecd0.xml">Büro</device>
    <device udn="uuid:54284577-e19d-4132-a95b-8972084e77ec" type="urn:schemas-upnp-org:device:MediaRenderer:1" location="http://192.168.0.186:59754/54284577-e19d-4132-a95b-8972084e77ec.xml">Speaker Bad #2</device>
    <device udn="uuid:59bb2a83-1356-4c93-b9aa-a60643efebc4" type="urn:schemas-upnp-org:device:MediaRenderer:1" location="http://192.168.0.177:52477/59bb2a83-1356-4c93-b9aa-a60643efebc4.xml">Speaker TV</device>
    <device udn="uuid:613808fa-fa79-4885-9346-6ea0d6ced3a4" type="urn:schemas-raumfeld-com:device:RaumfeldDevice:1" location="http://192.168.0.186:50145/613808fa-fa79-4885-9346-6ea0d6ced3a4.xml">Teufel Raumfeld Device</device>
    <device udn="uuid:7fda471e-324c-4a22-9621-ea9f380caece" type="urn:schemas-upnp-org:device:MediaRenderer:1" location="http://192.168.0.177:55425/7fda471e-324c-4a22-9621-ea9f380caece.xml">Bad</device>
    <device udn="uuid:9d858531-2dd7-4803-abfa-7663ad4fdefd" type="urn:schemas-upnp-org:device:MediaRenderer:1" location="http://192.168.0.72:59177/9d858531-2dd7-4803-abfa-7663ad4fdefd.xml">Connector Werkstatt</device>
    <device udn="uuid:ad4403a7-d548-44ae-bbf6-6f2530bf9147" type="urn:schemas-upnp-org:device:MediaServer:1" location="http://192.168.0.177:54373/ad4403a7-d548-44ae-bbf6-6f2530bf9147.xml">Raumfeld MediaServer</device>
    <device udn="uuid:cbf4ee89-5935-434c-bf87-016cf4fa8cce" type="urn:schemas-upnp-org:device:MediaRenderer:1" location="http://192.168.0.182:49803/cbf4ee89-5935-434c-bf87-016cf4fa8cce.xml">Speaker Küche #2</device>
    <device udn="uuid:cc25864d-e93a-4ffd-a40c-5f3fe5e7fa3f" type="urn:schemas-raumfeld-com:device:ConfigDevice:1" location="http://192.168.0.177:49238/cc25864d-e93a-4ffd-a40c-5f3fe5e7fa3f.xml">Raumfeld ConfigDevice</device>
    <device udn="uuid:e41865fa-3d65-4ec8-91b2-68ba182e33cb" type="urn:schemas-raumfeld-com:device:RaumfeldDevice:1" location="http://192.168.0.114:59960/e41865fa-3d65-4ec8-91b2-68ba182e33cb.xml">Teufel Raumfeld Device</device>
    <device udn="uuid:e7ee4e9a-b8cd-4831-8d7c-9ab38cbb32bb" type="urn:schemas-upnp-org:device:MediaRenderer:1" location="http://192.168.0.114:53556/e7ee4e9a-b8cd-4831-8d7c-9ab38cbb32bb.xml">Speaker Küche #3</device>
    <device udn="uuid:e90802ef-e098-47b2-bbf7-dca81b99d2d3" type="urn:schemas-raumfeld-com:device:RaumfeldDevice:1" location="http://192.168.0.177:59390/e90802ef-e098-47b2-bbf7-dca81b99d2d3.xml">Teufel Raumfeld Device</device>
    <device udn="uuid:ffffffff-ef46-88e5-ffff-ffffef4688e5" type="urn:schemas-upnp-org:device:MediaRenderer:1" location="http://192.168.0.177:60491/ffffffff-ef46-88e5-ffff-ffffef4688e5.xml">Küche</device>
</devices>

System State Channel:

<systemState>
    <updateAvailable value="0"/>
    <listDevicesUpdateID value="3776791107"/>
</systemState>

Sorry for the not working line breaks.

B5r1oJ0A9G commented 3 years ago

Thanks for the information!

          <room name="Küche" udn="uuid:68b41d52-a2fb-4d17-8c16-895c78de3f3a" powerState="AUTOMATIC_STANDBY">
              <renderer udn="uuid:cbf4ee89-5935-434c-bf87-016cf4fa8cce" name="Speaker Küche #2"/>
              <renderer udn="uuid:e7ee4e9a-b8cd-4831-8d7c-9ab38cbb32bb" name="Speaker Küche #3"/>
          </room>

I suspect the issue is with the room "Küche" having more than one renderer. In the current implementation this is not expected and will affect how the data structure is returned by the XML parser.

Edit: Could you please test again with these changes / branch to resp. of hassfeld: https://github.com/B5r1oJ0A9G/hassfeld/compare/dev-multiple-renderer?

blackmore190 commented 3 years ago

I have splitted the two renderes into two rooms. With that setup it worked without any problem. I will try it with the changes you mentioned and the "old" setup. Could you tell me where i have to make those changes?

Thanks for your help.

B5r1oJ0A9G commented 3 years ago

Could you tell me where i have to make those changes?

Well, that actually depends on your system environment. You could try to execute the following command to locate the directory of hassfeld and replace there the __init__.py by the one from the development branch. Before you do so, you should create a copy of the original file to revert the changes again after the test.

# find / -type d -name hassfeld
/usr/local/lib/python3.8/site-packages/hassfeld

Please note that doing such modification is at your own risk! While this could be considerd as an easy and non-destructible change, that is also easy to revert, things may break by mistake, if you don't know what you do.

B5r1oJ0A9G commented 3 years ago

I decided to merge the development branch in hassfeld for multiple renderer support without user feedback. The reason was that several users seeming to face this problem and the changes in my setup did not break anything. The new version of hassfeld (0.3.9a) will be pulled beginning of teufel_raumfeld version 0.1.9a.

Due to outstanding user tests/feedback, I cannoot ultimately tell whether the problem(s) will be resolved.

B5r1oJ0A9G commented 1 year ago

Closing as it seems to be resolved.