core: Incorrect google assistant type mapping for media_player
Home Assistant release with the issue: 0.88.1
Last working Home Assistant release (if known):
Operating environment (Hass.io/Docker/Windows/etc.): Hass.io
Component/platform: Google Assistant (https://www.home-assistant.io/components/google_assistant/)
Description of problem:
According to google assistant component doc, media_player
should support volume control
media_player (on/off/set volume (via set brightness)/source (via set input source))
However, it is actually mapped to a switch, which can only support on/off: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/google_assistant/smart_home.py#L50 It appears as a switch in Google Home app as well.
Problem-relevant configuration.yaml
entries and (fill out even if it seems unimportant):
google_assistant:
project_id: !secret google_project_id
api_key: !secret google_project_api_key
expose_by_default: false
exposed_domains:
- media_player
entity_config:
media_player.living_room_tv:
expose: true
room: living room
name: My TV
Traceback (if applicable):
Additional information: I think it should mapped to a light instead of switch.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 15 (6 by maintainers)
The brightness trait unfortunately only seems to support absolute values (see https://developers.google.com/actions/smarthome/traits/brightness) like “set to 50%” and no steps like “reduce the brightness” thus components have to SUPPORT_VOLUME_SET.
In the case of the WebOS component I actually assume that it is a bug that SUPPORT_VOLUME_SET is missing, since the component implements set_volume_level and volume_level. @pauloallex24 as a workaround you can try to add the flag manually. After restarting hass and syncing with google it should work as expected.