Closed Ralcidonis closed 2 years ago
The media_player
entity does not expose volume as a state attribute. It is only accepted in the media_player.play_media
service call as shown here. It is a "write-only" parameter and will not affect the volume level of the speaker itself.
The 0.1.1 release adds volume control to the integration. This may help your setup.
I appreciate you working on this integration.
The volume is still not working for me, even after this last HA Core update. I keep receiving a 400 bad request in the log. I am calling this with an Appdeamon function as follows:
self.call_service("media_player/play_media", entity_id = "media_player.master_bedroom", media_content_id = "media-source://tts/cloud?message=This is a TTS test", media_content_type = "music", volume = 20)
Error: "WARNING HASS: Code: 400, error: 400: Bad Request"
if I take the volume parameter, it works just fine.
The param must be provided in the extra
dict as shown in the examples. I don't use AppDaemon myself, but I'd assume you'd change the volume param from:
volume = 20
to:
extra = {"volume": 20}
So the full request would look like:
self.call_service("media_player/play_media", entity_id = "media_player.master_bedroom", media_content_id = "media-source://tts/cloud?message=This is a TTS test", media_content_type = "music", extra = {"volume": 20})
This works beautifully. I appreciate the assistance all over the place!
I know you added volume control option not too long ago but when a get_state call is performed using Appdeamon, the volume control is not listed in the list of attributes. Adding volume = a certain number as an additional parameter in a method call does nothing. I just do not see how to access the "extra" info since it is not showing as available attributes.