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.56k stars 30.74k forks source link

MusicCast sets wrong volume #21218

Closed vigonotion closed 3 years ago

vigonotion commented 5 years ago

Home Assistant release with the issue: 0.88.0b2 (but probably most versions before too)

Last working Home Assistant release (if known): -

Operating environment (Hass.io/Docker/Windows/etc.): Docker

Component/platform: media_player.yamaha_musiccast

Description of problem: When setting the volume of the media player, the actual volume is not the volume I set it to. This happens, because the volume is divided by the max_volume of the device:

line in yamaha_musiccast.py

I checked the logs, and it seems that the max volume is 80. 2019-02-19 17:38:37 DEBUG (WorkerThread) [pymusiccast.zone] Volume: 32 / Max: 80

The max volume is gathered via pymusiccast, and this does a request to the device:

http://192.168.178.40/YamahaExtendedControl/v1/main/getStatus

which results in:

{
  "response_code": 0,
  "power": "on",
  "sleep": 0,
  "volume": 19,
  "mute": false,
  "max_volume": 80,
  "input": "line1",
  "distribution_enable": true,
  "tone_control": {
    "mode": "manual",
    "bass": 0,
    "treble": -1
  },
  "balance": 0,
  "link_control": "standard",
  "link_audio_quality": "compressed",
  "disable_flags": 0
}

so the problem isn't Home Assistant nor pymusiccast, but the device. I can confirm that the max volume is set to MAX, I also tried other values but that doesn't change anything.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

media_player:
  - name: Tom Receiver
    platform: yamaha_musiccast
    host: 192.168.178.40
    port: 5005

Traceback (if applicable):

2019-02-19 17:38:37 DEBUG (WorkerThread) [pymusiccast.zone] Volume: 32 / Max: 80

Additional information: This problem occurs on my Yamaha R-N402D.

vigonotion commented 5 years ago

My proposal would be to add a configuration flag max_volume: 100 to override the reported max volume. This field would be optional and if omitted, the max volume is set to the reported one.

I'm a programmer so I can implement that, but I'd like to hear opinions of this step. Is this the way to go? Is anyone else experiencing this issue? Is the max_volume even relevant or always 100?

vigonotion commented 5 years ago

Update: It seems like the api http://192.168.178.40/YamahaExtendedControl/v1/main/setVolume?volume=<volume> doesn't allow volumes above max_volume, but for the calculation, 100 has to be used.

So, instead of max_volume, maybe this configuration option should be called volume_multiplier, volume_factor or something like that?

awarecan commented 5 years ago

Should HA just do

self._zone.set_volume(volume)
vigonotion commented 5 years ago

yeah that would solve the issue for me, but couldn't it break for others?

vigonotion commented 5 years ago

actually, the volume * 100 is indeed neccecary, as the value that comes in is a decimal (0..1) but pymusiccast wants an integer.

Log output for the lines: 2019-02-20 07:29:20 DEBUG (SyncWorker_6) [homeassistant.components.media_player.yamaha_musiccast] Volume level: 0.59 / 47

Snipercaine commented 5 years ago

have you updated to 0.90? if not try that. If you have updated, is this still a problem? Thanks

vigonotion commented 5 years ago

updating to 0.90.1 didn't solve this issue for me, issue is the same as described earlier

stale[bot] commented 5 years 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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

vigonotion commented 5 years ago

not working in newest HAAm 07.07.2019 14:25 schrieb "stale[bot]" notifications@github.com: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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

stale[bot] commented 5 years 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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

tiplutom commented 5 years ago

This is still an issue.

stale[bot] commented 4 years 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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

vigonotion commented 4 years ago

In the current stable version, this is still an issue. #30283 looks promising, yet I still have to check it after my vacations.

stale[bot] commented 4 years 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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

vigonotion commented 4 years ago

still an issue

vigonotion commented 4 years ago

@jalmeroth Mind taking a look at this issue? This might also need a change in the underlying library

stale[bot] commented 4 years 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 now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

vigonotion commented 4 years ago

This is still an issue

github-actions[bot] commented 3 years 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.