HDMI CEC select device problem

I have HDMI CEC running without a problem, I just don’t know, how to correctly use select_device service (I’m running 0.38.4).

I cannot use hdmi_cec.select_device if I go to services menu in HA (following docs instructions). Even when I select:

Domain:
hdmi_cec

Service:
select_device

Data:
{"device": "raspberrypi"}

But strangely enough it works through my script:

  alias: Select KODI HDMI source
  sequence:
    - alias: Select KODI HDMI source
      service: hdmi_cec.select_device
      data:
        device: "raspberrypi"

I would also like to be able to switch back to TV, but if I input TV instead od raspberry in my script, it doesn’t work. My HDMI CEC config:

hdmi_cec:
  devices:
    0: TV
    2: raspberrypi

Any help would be greatly appreciated.

My one just switch them on and off, but my Samsung TV does not change the Source ? Did you manage to sort it out?

Petr

Unfortunately I haven’t figured it out. I can change source through a script on my Samsung Smart TV, but I am still unable to select TV as a source (all other inputs work)…