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.
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):
You mentioned being able to set up this media player HomeKit button to send commands using your broadlink RM. Could you possibly paste that element of your configuration? Thank you
Edit: @barns102 were you able to get that tv icon in HomeKit to send broadlink commandsv
If you have a meda player compatible TV, as one of mines LG WebOS, you can add it as a native media_player component and follow the instructions above.
Thank you for replying, I wish that I has this sorted out in my head as well as you do!
I tried patching together what you posted but my HA collapsed and my config file hates me :( I was wondering if you could take a look at what I have, and tell me how far from working code? I’m trying to control a ‘dumb as a rock tv’ with the broadlink IR device sending commands but looking like a HomeKit tv.
here’s the nightmare franked-code for your amusement!
I am sorry to hear that you are still having problems with that
As I can see on your configs, you don’t actually have a media_player entity configured, just the broadlink switch (tv). This will not do the trick, you need a media_player in order to work.
I also have a dumb TV, you just need to use the custom component SmartIR first. Have you managed to make it work?
I am having the same issue with a smartir media_player being controlled from Google Assistant (via Nabu Casa). Volume control doesn’t work from Google. My Google Home Hub shows volume buttons for the device but they do nothing. Voice commands have no effect.
I’m confused by what you said above… you said you’re unable to set the volume, but follow up saying that removing the media_player, editing customize.yaml, and then adding the media_player back works. I tried that (syncing devices to Google in between each step) but still no luck.
Volume control still does not work using SmartIR or even the WebOS media player components.
In the previous message I was trying to help Douganator to simply show the media player as a TV on HomeKit, not controlling the volume. He was having trouble with that.
I found a related issue about this on GitHub and it sounds like the problem is that Google Assistant (and I guess HomeKit) volume control only works for entities that have absolute volume and not relative volume. Although there’s a slim chance that a semi-recent change in HA could change that. And if not, I had an idea that might work to allow relative volume control while reporting absolute volumes to Google/HomeKit, so I suggested it to the smartir author.
Hi, I am very new to home assistant. I am trying to integrate my Android TV with Apple Home.
I tried the following:
configuration.yaml
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
homeassistant:
customize: !include customize.yaml
homekit: !include homekit.yaml
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
media_player:
# Use the Python ADB implementation with a user-provided key to setup an
# Android TV device. Provide some app names and don't display other apps
# in the sources menu. Override the default turn on/off commands, and
# provide custom state detection rules.
- platform: androidtv
name: Android TV
device_class: androidtv
host: 10.0.0.26
adbkey: "/config/android/androidtv_adbkey"
turn_on_command: "input keyevent 3"
turn_off_command: "input keyevent 223"
Yet when I try to reboot I get this error:
[139780283081920] The system cannot restart because the configuration is not valid: extra keys not allowed @ data[‘homekit’]
I’ve had a similar issue with android tv and Apple TV connected to it. I wanted one tv in HomeKit that can control both of them through one HomeKit remote turn on and off both of them and as well have apps from both of them in one source list.
But now to get to a possible solution.
First install media_player_template integration through hacs and configure it so it can control your chromecast ( following the template modify to what you’d like to accomplish with it). Then using universal media player integration create a new media player whose child entity is the media player template one and android tv one ( or if you’ve configured the app list in the media player template leave out android tv from children list). Turn on and off goes for both entities and volume up and down can be either of them or both of them. Once you’ve configured the universal media player, add the device_class: tv at the end. In home assistant HomeKit add this universal media player as an accessory. Once that is done, you should be able to control them both. Just remember, to get them both to work together in HomeKit you should also get the states for on and off and make an automation that can turn on and off either depending on which one is on or off.
Just pointing you to a direction I took, might help