home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.97k stars 31.02k forks source link

Universal Media Player - Error rendering data template #127358

Open afnieves opened 1 month ago

afnieves commented 1 month ago

The problem

When trying to use Universal media player with a Google TV device getting this error when trying to use commands. 2024-10-01 13:33:58.768 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: Error rendering data template: Result is not a Dictionary

What version of Home Assistant Core has the issue?

2024.10

What was the last working version of Home Assistant Core?

Not sure

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Platform: universal

Link to integration documentation on our website

https://www.home-assistant.io/integrations/universal/

Diagnostics information

action: media_player.media_next_track data: {} target: entity_id: media_player.bedrm_gtv_uni

Example YAML snippet

#media_player:
- platform: universal
  name: Bedrm GTV UNI
  children:
    - media_player.bedrm_gtv # Android TV Remote Intergration
    - media_player.bedrm_gtv_cc # Google Cast Intergration
  active_child_template: >
    {% if is_state('media_player.bedrm_gtv_cc', 'off') %}
       media_player.bedrm_gtv
    {% else %}
       media_player.bedrm_gtv_cc
    {% endif %}
  state_template: >
    {% if is_state('media_player.bedrm_gtv_cc', 'off')  %}
      {{ states('media_player.bedrm_gtv') }}
    {% else %}
      {{ states('media_player.bedrm_gtv_cc') }}
    {% endif %}
  attributes:
    is_volume_muted: media_player.bedrm_gtv_cc|is_volume_muted
    state: media_player.bedrm_gtv_cc|state
    browse_media_entity: media_player.bedrm_gtv_cc
  device_class: tv
  unique_id: bedrm_gtv_uni
  commands:
    turn_on:
      action: media_player.turn_on
      data: media_player.bedrm_gtv
    turn_off:
      action: media_player.turn_on
      data: media_player.bedrm_gtv
    volume_up:
      action: media_player.volume_up
      data: media_player.bedrm_gtv
    volume_down:
      action: media_player.volume_down
      data: media_player.bedrm_gtv
    volume_mute:
      action: media_player.volume_mute
      data: media_player.bedrm_gtv
    media_play:
      action: media_player.media_play
      data: media_player.bedrm_gtv
    media_pause:
      action: media_player.play_media_pause
      data: media_player.bedrm_gtv
    media_previous_track:
      action: media_player.media_previous_track
      data: media_player.bedrm_gtv
    media_next_track:
      action: media_player.media_next_track
      data: media_player.bedrm_gtv

Anything in the logs that might be useful for us?

2024-10-01 13:33:58.768 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: Error rendering data template: Result is not a Dictionary

Additional information

No response

home-assistant[bot] commented 1 month ago

universal documentation universal source

joostlek commented 1 month ago

Please try to boil down the configuration to a reproducible example, also add the states of the source entities

afnieves commented 1 month ago

I updated the above config. Here are the states.

Screenshot 2024-10-05 at 11 26 58 AM Screenshot 2024-10-05 at 11 27 15 AM
afnieves commented 1 month ago

Let me know what else I can give you

afnieves commented 1 month ago

Please try to boil down the configuration to a reproducible example, also add the states of the source entities

Any updates on this issue ?

@joostlek

issue-triage-workflows[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

afnieves commented 4 weeks ago

I am using the latest version of HAOS and now this is the current log.

2024-10-27 13:08:56.352 WARNING (MainThread) [homeassistant.helpers.service] Referenced devices media_player.bedrm_gtv_uni are missing or not currently available

entity state:

is_volume_muted: false app_id: tv.startupshow.android app_name: tv.startupshow.android active_child: media_player.bedrm_gtv assumed_state: true device_class: tv friendly_name: Bedrm GTV UNI supported_features: 153529

I am running 2024.10.4

issue-triage-workflows[bot] commented 2 weeks ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

afnieves commented 2 weeks ago

Core 2024.11.1 Supervisor 2024.11.2 Operating System 13.2 Frontend 20241106.2

Same problem:

2024-11-10 18:24:23.708 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140453631611168] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1007, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1079, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/universal/media_player.py", line 575, in async_media_pause await self._async_call_service(SERVICE_MEDIA_PAUSE, allow_override=True) File "/usr/src/homeassistant/homeassistant/components/universal/media_player.py", line 279, in _async_call_service await async_call_from_config( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 334, in async_call_from_config params = async_prepare_call_from_config( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 416, in async_prepare_call_from_config raise HomeAssistantError( homeassistant.exceptions.HomeAssistantError: Error rendering data template: Result is not a Dictionary

issue-triage-workflows[bot] commented 1 day ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.