Help with media player and HomeKit control

Tags: #<Tag:0x00007fa746dae1d0>

Hello everyone!

Just discovered how to configure HomeKit and Google assistant to show my media player TV as a real TV entity so I can change input and so on.

I’ve successfully configure all of mine TVs but the old LG running Netcast OS. The problem is that since there is no turn on action, I cannot send a valid turn on command to the TV. I was using a template switch to send a broadlink ir code to turn it on.

I was trying to figure out a workaround and discovered that a HomeKit command is logged on the events database, like this:

image

My question is: is it possible to trigger an automation with this event so I can call the old turn on script and my problems would be solved :slight_smile:

Thanks!

Hi, can I ask how you managed to get your media player from HA to work with HomeKit, I’ve been trying that for a while now???

Hello @barns102!

You need to set this on customize.yaml:

media_player.your_media_player:
  device_class: tv

And then on homekit config:

entity_config:
  media_player.your_media_player:
    name: "TV"
    feature_list:
      - feature: on_off
      - feature: play_pause
      - feature: play_stop
      - feature: toggle_mute

You will get something like this:

Including source select, very neat!

Hurrah, you’re a Star!!!

Thank you so much, that certainly worked, in that I can now see a media player tool in my HomeKit App. But there are still some problems.

1 - I can’t turn the TV on, I toggle the switch on, and nothing happen although the App says its on. Then if I toggle it off the TV comes on. I guess it’s sending the off command (which is the same as on??)

2 - I can’t control the volume

3 - I have an input select feature, but no inputs show up so I can’t select any.

Do you have any more suggestions.

Thank You - Thank You - Thanks You!!! :slight_smile:

Hello sir! I am glad I could help.

What media player TV component do you use? Since I use LG WebOS, there is a separate turn on command that I can send using a Broadlink RM Mini. To turn off it is simple internal command to the WebOS.

I’m also unable to set the volume of my TV from the Home App, not sure why but it seems tricky.

I’ve found that this solves the problem, you might need to remove this media_player entity that you have set on HomeKit, restart HA, add this to your customize.yaml, add back again the device to HomeKit and restart HA:

media_player.your_media_player:
  device_class: tv
  source_list: [DTV,HDMI 1,HDMI 2,HDMI 3,HDMI 4]

You need to check on your dev_state the available sources and add them as the code above. You don’t need to enable all of them, I’ve only exposed the sources I want to show on the Home App (there were dozens of them, they were all apps installed on my TV). Here is my entity properties as for now (using the smart_ir media player custom component since that’s a “dumb” TV):

Good luck!