Roku Integration - Volume not working

I added my Roku TV successfully via the UI and am able to select source/power on off, but not set the volume. Here is a complete log and the error I get when I try. Any ideas what to do?

2020-05-03 16:13:00 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140652328702352]
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1232, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1255, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 412, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 600, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 443, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 542, in async_set_volume_level
    await self.hass.async_add_job(self.set_volume_level, volume)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 538, in set_volume_level
    raise NotImplementedError()
NotImplementedError

Error in UI:

Failed to call service media_player/volume_set

Nobody?? Seems pretty basic for HA to be able to control a Roku TV :frowning:

Hi.

Ive been working on the Roku integration as of late.

I would encourage posting an issue on the core repo as itll notify code maintainers of the integration and likely result in prompt resolution.

Ok so Roku TVs only support volume_up and volume_down rather than volume_set as the Roku ECP API doesn’t provide the current volume level or ability to set specific levels.

That said there was a bug that predated my involvement where volume_set support was flagged as available when it really wasnt which is likely a cause for the error.

The good news is HA 110 will include a fix which also helps the way the media card offers control and if you want to control volume by alexa or such since itll know to provide the +/- volume controls rather than slider

Hey @dinobyte217 makes sense, I did know there was no way via the API and +/- does make more sense, but I thought I saw somewhere (perhaps an unofficial integration) that they had hacked it so basically when you adjust volume, it always goes to 0 then up a certain number of steps. It’s a hack, but it would be nice if this was “coded” and invisible to the user. I have my TV start when I get home and i’d like to preset the Volume.

I’ll post on the repo, but I wasn’t sure which was the “official” repo, can you share a link?

I can say the slider bar is now gone, but I preferred it in a way. I think it should be hackable to set volume by going to 0 then up to desired set-point.Volume

I have an issue with my Roku TV (TLC) where volume down and volume mute just fine, but volume up does not. If I use the native media card, the volume up works. Any idea why volume down and mute work here, but not volume up?

  - platform: universal
    name: Patio TV (Roku)
    children:
      - media_player.roku_yn003l945942
    commands:
      turn_on:
        service: remote.send_command
        data:
          entity_id: remote.roku_yn003l945942
          command: power
      turn_off:
        service: remote.send_command
        data:
          entity_id: remote.roku_yn003l945942
          command: power
      volume_up:
        service: media_player.volume_up
        data:
          entity_id: media_player.roku_yn003l945942
      volume_down:
        service: media_player.volume_down
        data:
          entity_id: media_player.roku_yn003l945942
      volume_mute:
        service: media_player.volume_mute
        data:
          entity_id: media_player.roku_yn003l945942
    attributes:
      is_volume_muted: media_player.roku_yn003l945942|volume_level
      state: media_player.roku_yn003l945942
      volume_level: media_player.roku_yn003l945942|volume_level
      source: media_player.roku_yn003l945942|source
      source_list: media_player.roku_yn003l945942|source_list

@jjwBullfrog why use remote. vs media.. IMO using remote is like using SENDKEYS in VBA, it’s hacky and should be avoided. Using the “native media card” talks w/ the API (I’m fairly certain). Was hoping @dinobyte217 posted a link to the Github URL here, but perhaps it should be reported there as he advised.