Skip to content
Marc edited this page Aug 25, 2023 · 25 revisions

Welcome to the teufel_raumfeld wiki!

Some background about Raumfeld Multi-room

  • One or more physical speaker are statically grouped to a "room".
  • Rooms can be dynamically grouped to a "zone" aka speaker group. Each speaker group provides a media renderer to play audio.
  • A room can only be member of one speaker group at the same time.
  • While rooms technically have a media renderer, it is not foreseen to use them directly. Instead a speaker group with only one room is created.
  • Device and speaker group management is implemented via a web service.
  • Media playing is implemented via DLNA.

Some background about teufel_raumfeld

  • sensor entities are created for each physical speaker. Speaker entities do only expose related information and are not involved in media playing. E.g. "Speaker: Dining area".
  • media_player entities are created for all rooms and the at the time of configuration (or configuration reload) existing speaker groups. E.g. "Room: ['Living room']" and "Group: ['Living room', 'Kitchen']". Entities of unwanted speaker groups can be disabled and will then be ignored by teufel_raumfeld.
  • The media_palyer entities support Home Assistant's announcement feature. See: Media Player integration.
  • Select entities are created as well for all rooms.
  • No longer existing speaker group entities remain valid and turn to the state "off". Turning them on will lead to their recreation for use and if a snapshot exists it will be restored and played.
  • Turning off a speaker group will cause removal of all rooms from the group. If done during playback it will first create a snapshot of that group for later restore.
  • The volume step-up and step-down procedures apply different step sizes. See CHANGE_STEP_VOLUME_UP and CHANGE_STEP_VOLUME_DOWN in const.py.
  • A single update thread is Long polling the various web service interfaces.
  • Whenever an update is triggered by the web service, e.g. after crating or updating a speaker group, an internal data structure shared with all media_player instances is updated accordingly.
  • Events are fired for each by the web service triggered update.

Usage

the recommended installation method is via HACS.

The integration connects to the host server of a Raumfeld Multiroom system. This host has to be entered once when the integration is added, respectively configured:

After the configuration is completed, device entities are created for all speakers and media_player entities are created for all rooms and currently existing speaker groups.

Configuration options like change step volume up/down or an an optionally fixed volume for announcements, can be globally configured in the frontend.

image

The general usage of a media_player entity is described in the documentation of the Media Player integration. It can also be used with compatible frontend cards like the Media Control Card.

Debugging information

The integration writes several helpful pieces of information with the debug log level. This loglevel can be set for teufel_raumfeld in the file configuration.yml as follows:

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

Activating the debug log level for teufel_raumfeld causes the same level is set for hassfeld.

Services

  • teufel_raumfeld.snapshot, to remember media, position, volume and mute status for later restore.
  • teufel_raumfeld.restore, restore the state of the last snapshot.
  • teufel_raumfeld.group, to create a new speaker group.
  • teufel_raumfeld.abs_volume_set, to the volume of all rooms in a speaker group to the same level.
  • teufel_raumfeld.set_power_state, to put speakers of a room into automatic/manual stand-by or to awaken them from stand-by. This service call has been removed and replaced by a corresponding Selectors entity.
  • teufel_raumfeld.play_sound, to play the system sound "Success" or "Failure", resp. mixing it into the currently played media.
  • teufel_raumfeld.add_room, to add a room to an existing speaker group.
  • teufel_raumfeld.drop_room, to remove a room from a speaker group. Either from any or from a specific one only.
  • teufel_raumfeld.set_room_volume, to set the volume of a room without knowing its speaker group.

See also: https://github.com/B5r1oJ0A9G/teufel_raumfeld/blob/master/custom_components/teufel_raumfeld/services.yaml

Examples

Script to play a Radio station

alias: Play Radio Bob
sequence:
  - service: media_player.play_media
    data:
      media_content_id: >-
        dlna-playsingle://uuid%3A26cf0c06-7bef-4f45-9d1e-6f5e87b37c3a?sid=urn%3Aupnp-org%3AserviceId%3AContentDirectory&iid=0%2FRadioTime%2FLocalRadio%2FAllLocations%2Fl-r101217%2Fl-r100346%2Fl-r101414%2Fs-s96189
      media_content_type: object.item.audioItem.audioBroadcast.radio
    target:
      entity_id: media_player.room_bathroom
mode: single

The information for media_content_id can be grabbed from the log. The log-level of teufel_raumfeld has to be set to debug. Recent versions of teufel_raumfeld expose this information also via attributes of the corresponding media_player entity (See: https://github.com/B5r1oJ0A9G/teufel_raumfeld/discussions/10#discussioncomment-6516630).

2021-05-26 23:56:09 DEBUG (MainThread) [custom_components.teufel_raumfeld] media_player.py->async_play_media: self._rooms=['Bathroom'], play_uri=dlna-playsingle://uuid%3A26cf0c06-7bef-4f45-9d1e-6f5e87b37c3a?sid=urn%3Aupnp-org%3AserviceId%3AContentDirectory&iid=0%2FRadioTime%2FLocalRadio%2FAllLocations%2Fl-r101217%2Fl-r100346%2Fl-r101414%2Fs-s96189

The media_content_type must be one of the supported media types. Which one to chose depends on the uri to play (media_content_id). For example:

MEDIA_TYPE_MUSIC = "music"
UPNP_CLASS_ALBUM = "object.container.album.musicAlbum"
UPNP_CLASS_TRACK = "object.item.audioItem.musicTrack"
UPNP_CLASS_RADIO = "object.item.audioItem.audioBroadcast.radio"
UPNP_CLASS_PLAYLIST_CONTAINER = "object.container.playlistContainer"
UPNP_CLASS_PODCAST_EPISODE = "object.item.audioItem.podcastEpisode"
UPNP_CLASS_LINE_IN = "object.item.audioItem.audioBroadcast.lineIn"

The UPNP_CLASS_* media content types refer to DLNA containers. The MEDIA_TYPE_MUSICcan be used to pass a plain "http://" or "https://" URI to a media file via media_content_id.

Script to level volume

First the volume of all speakers in a speaker group is set to 30% and then the volume of the Kitchen speaker is set to 20%.

alias: Reset volume of Living room, Dining & Kitchen speakers
sequence:
  - service: teufel_raumfeld.abs_volume_set
    data:
      volume_level: 0.3
    entity_id: media_player.group_dining_kitchen_livingroom
  - service: teufel_raumfeld.abs_volume_set
    data:
      volume_level: 0.2
      rooms: Kitchen
    entity_id: media_player.group_dining_kitchen_livingroom
mode: single

Script to set power state

Set the power sate of the room "Kitchen" to "on"

alias: Turn on kitchen
sequence:
  - service: select.select_option
    data:
      option: "on"
    target:
      entity_id: select.room_kitchen_powerstate
mode: single

Selectors

Power state

The Power state select entity can be used to put a room's speakers into automatic/manual standby mode or wake them up from standby mode. The naming scheme of the entity is: select.room_name.

Media Player Card

This card includes a button running a script to set the volume of all rooms to a normal level.

type: vertical-stack
cards:
  - type: media-control
    entity: >-
      media_player.group_bathroom_top_floor_bathroom_first_floor_craftroom_kids_room_kitchen_bedroom_playroom_workshop_living_room
  - type: button
    tap_action:
      action: call-service
      service: script.reset_volume_group_all
      service_data:
        entity_id: >-
          media_player.group_bathroom_top_floor_bathroom_first_floor_craftroom_kids_room_kitchen_bedroom_playroom_workshop_living_room
    entity: ''
    name: Reset volume
    icon: mdi:volume-low
    icon_height: 32px

Screenshots

Configuration

Add integration

Integration added

Integration

Devices

Device

Entities

media_player

Card

Menu

Media Browser