Home Theater Automation

Hello.

I started my adventure with Home Assistant yesterday. I’m trying to learn it but the huge number of options is overwhelming.

I’m trying to automate my home cinema equipment. The manufacturer of my TV didn’t make buttons for selecting the HDMI source and that’s why I need to automate it.

I’ve already read here on the forum that it was possible to make the appropriate entries in ADB that launch the appropriate HDMI

HDMI1:

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tis%2F.HdmiInputService%2FHW2 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

HDMI2:

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tis%2F.HdmiInputService%2FHW3 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

HDMI3:

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tis%2F.HdmiInputService%2FHW4 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

HDMI4:

adb shell am start -a android.intent.action.VIEW -d content://android.media.tv/passthrough/com.mediatek.tis%2F.HdmiInputService%2FHW5 -n org.droidtv.playtv/.PlayTvActivity -f 0x10000000

I have a Denon 3800 receiver which I have already added to Home Assistant
I have a Philips 77Oled818 TV which I have also added to Home Assistant via api 6
I also unlocked ADB on the TV and added it to Home Assistant

I would like Home Assistant to detect that when Denon is turned on and the “Media Player” source is turned on, then Home Assistant switches the Philips TV to HDMI 2

Denon turned on → Denon Switches to the “Media Player” source → Home Assistant switches the Philips TV to HDMI 2

Can this be set and how?

Look into HDMI CEC.

Most of what you want is built into HDMI via CEC communications. It may need to be enabled and there may be specific requirements for things to work

Turn ON source should turn ON Denon and Turn ON TV but I’m not sure about input

How do you connect devices?
Generally it is expected to be

source >> AV receiver >> TV

Making AV receiver source control and TV a simple monitor. But I’m not sure Reveiver will change input with source. TV generally do

You may also send CEC commands using adb I believe so look into that also

All these devices have HA integrations so you can also create an automation to do this but I would see what’s possible with CEC as is. It is much cleaner and wouldn’t need to be maintained. It may just work.