Universal media player volume is broken

Ah that makes sense. The step up’s and the step downs are for volume devices that “don’t know their state”.

What does the SOAP command?

Just one question: where to save the .ini files?

Wherever you wish, you only need to provide the path of it relative to the root folder of your configuration.

For the SOAP : it’s a protocol based on HTTP POST requests with an XML payload that can command some parts of most “smart” media appliances. It can set and get the volume level and the mute state if used correctly.

Dear @grea09
I am using broadlink RM mini 3 and Vasilis broadlink.py as suggested by you.
I want my media devices

  1. mini m8sii (android TV box)
  2. onkyo receiver tx-sr508
  3. Samsung TV.

I would like to get volume slider to work with this devices connected to HA via broadlink RM mini 3.
Can you please guide me.
Thanks in adv.

Well that isn’t that easy. First you’ll need to make your own ini file by following the example. You get the codes by learning them using the service switch.broadlink_learn_command_ip_of_rm_mini and pushing each button on the remote (quite tedious and long to do). Normally the Samsung ini file should work.
If your devices are compatible, I would suggest using HDMI-CEC (plug the onkyo with an HDMI cable to your TV and search the menus for Anynet+). This will allow commands issued on the TV to be replicated on your reciever (and have sound level consistant).

For the android TV box you’ll need either an app on it that can interface with a protocol supported by HA or you can try your luck meddling with UPnP and SOAP like I did by using this app.

All of that will require a ton of work to make everything seamless but I always find it worth it. Good luck !

I am having problems with turning on and off the samsung tv. I already had two switches created with broadlink mini rm3 to turning on and off the tv and i am noticing the codes are different from the ones into the samsung.ini file. Which one to use?

I have my codes with me, i have already created ini file,
but what should be done for volume,
do i need to get codes like
Volume 0 = ?
Volume 1 = ?
Volume 2 = ?
like vice
which will never be same.

i will try this today

dont know how to use this,

use codes, received by broadlink learning codes,
they are codes for your tv, so that will work better than common codes.

No, as far as I know the broadlink component doesn’t work this way. I use a Universal media player that is like a template media player. You’ll need a sensor for the volume or a way to retrieve it. That is the very hard part.

The thing is that you’ll need to do some retro engineering. If your TV is connected either try with this component (and hope everything works out of the box) or with the android App to scan the network. Once you found your TV (it’s better to set it’s IP static in the DHCP settings of your router to avoid future problems), look for the controls in it. It should be like “GetVolume”. Then invoke the service and go into the logs. There you will need to find the line of the action you just did (clear and try again if necessary). That will give you all the informations to tweak the command line sensor I posted earlier.

The last resort is to try to either guess the volume and use a variable in HA to keep track (which will stop working if anything changes the volume externally) or if you have a display of the volume to find a way to capture it and use OCR on it (using a camera and the 7 segment component of HA).

That is quite advanced endeavour but you’ll probably learn a lot doing it.

Ok, is there a way to use the sources options (HDMI, HDMI1 etc…) in a script so tu run automatically in an automation?

I get the following error:

" File “/home/homeassistant/.homeassistant/custom_components/media_player/samsungtv.py”, line 76, in setup_platform
add_devices([SamsungTVDevice(host, port, name, timeout, mac)])
File “/home/homeassistant/.homeassistant/custom_components/media_player/samsungtv.py”, line 87, in init
from wakeonlan import wol
ImportError: cannot import name ‘wol’"

How to solve?

I have started controlling onlyo rec with samsunt tvs remote, but cat get it to work with HA
How to set Samsung tv to control volume with volume slider.
Please guide.

Yes you can :

media_laptop:
  sequence:
  - service: media_player.select_source
    data_template:
      entity_id: media_player.tv
      source: 'HDMI 1'

You should ask the creator of the custom component for that. Sounds like the dependencies are wrong.

1 Like

Unfortunately, I will be unable to guide you all the way through. The solution depends heavily on your setup and models and will require hours of tests and failures.

That’s a good oportunity to learn ! Try exploring some of the ways I explained here, learn Python and UPnP/SOAP, it is some very useful skills to have. Remember it’s not about the destination, it’s about the journey. :wink:

I hope you’ll make it through !

hi! i would like to know if you were able to implement the slider volume using this set-up. if so, can you redirect me to the link that you’ve follow to execute this?

I am using a broadlink and a dumb tv. i have already get the codes and these were running but unable to fine tune the front end. TIA!

You can’t get a slider if the TV doesn’t report a volume level (to broadlink).

i see. thank you!

I only see there a list of ir codes (and no explanation), i have my codes for controlling a ‘dunb’ Samsung TV but i can only control it via switches. Tried Universal Media Player but it needs at least one real Media Player.
How exactly did you create a Media Player from scratch?

1 Like

Indeed you need an existing one. Your best bet would be to either recode the universal media player to not require a underlying media_player or to create a “dummy” one like a samsung TV with 0.0.0.0 IP address or something along those lines.