TCL TV automation template

I’ve read a little about templating in automations, but still haven’t made it work yet. Actually haven’t even been able to get one to add to my automations using the editor. I’ll make the edit and then it refuses to save my changes and I can’t determine what’s wrong. So hoping to get some specifics so I can get one working and learn from there

Just got a TCL TV and have it added to Home Assistant. I’m able to turn it off, on etc.

Currently I have an automation that when I walk into the office, it turns on the TV and switches the source to computer. Works perfectly and is amazing. How-ever I also have an Xbox that I use in the evenings. Which means sometimes I want it to change to the Xbox source. So the template would be this

If there is motion in the office
then check to see if the Xbox is on.
if true then turn on TV and switch to Xbox source
elseif turn on TV and switch to Computer source

The TV entity is media_player.43_tcl_roku-tv
The Xbox device_tracker.xboxonex
The office motion is binary_sensor.office_motion

I’m assuming I should be able to add/edit this in the automations in the web ui correct? Just switch to yaml editing?

Thanks!

To do this with one automation, yes, I believe you’d need to use data_template in the service call when switching the source. Unfortunately, AFAIK, the automation editor doesn’t support data_template. But then again, I don’t use the automation editor, so I’m not sure on that.

However, you could do it with two automations. They’d both use the same trigger, but each would have a different condition. I.e., one is triggered by the motion sensor, and then has a condition that the Xbox is on, and if so, then turn on the TV and switch to Xbox. The other would have the same trigger, but the condition would be the Xbox is off, and if so, then turn on the TV and switch to computer.

That’s how I do all my automations now. But it seems to get quickly out of hand! So I was hoping to cut the amount of automations in half. Maybe I can look at editing by hand then to resolve it. Thanks

Could you give more detail how exactly integrate TCL TV to HASS? using smart plug or something else? I saw “roku” there is there a roku device in the picture as well?
Thanks

Home Assistant automatically detected it and just asked me if I wanted to add it. It shows up now under Integrations -> Roku.

There’s a roku board inside the TV I’m guessing? I really don’t care about the Roku part as I don’t know if I will ever use it. I just use the TV for the computer or for playing on Xbox

Thanks. I guess it’s a smart tv that’s already connected to WiFi.

I have an old dumb TCL TV, I can only put smart plug to control on/off.

The main reason I got this model was for automation. It has ethernet, which means you can do ‘wake on LAN’ with it. Bascially ethernet giving more options that just a model with wifi only.

I recently got a TCL 720K and it I can’t get it added to HA via the android tv integration let alone switch sources.

Any idea what could be wrong. I type the correct ip address in the host. But not to be.

Any help would be greatly appreciated!!

Have you turned ON “USB debugging” with the TV unit?

For Android 11:
To turn on the USB debugging, you can use the following steps.

  1. Go to “Settings” → “System”-> “About phone” → “Build number”.
  2. Touch the Build number no less than 7 times.
  3. Touch “OK” on the pop up window to allow development setting, you will see a warning that mentions that developer mode is already turned on.
  4. Go back to “System” again, you will now find the “Developer options”.
  5. Activate “Developer options”.
  6. Activate “USB debugging”, touch “OK” on the pop up window to allow USB debugging.

For Android 10:
To turn on the USB debugging, you can use the following steps.

  1. Go to “Settings” → “System”-> “About phone” → “Build number”.
  2. Touch the Build number no less than 7 times.
  3. You will see a warning that mentions that developer mode is already turned on.
  4. Go back to “System” again, you will now find the “Developer options”.
  5. Activate “Developer options”.
  6. Activate “USB debugging”.

Source: https://www.tcl.com/au/en/service-support-mobile/tcl20-5g/How-can-I-turn-on-USB-debugging.html

1 Like

Hey Tamsy,

Finally, it worked!
There are options for turning off and volume up/down.
Do you know how I can get it to turn on, and change source.

Nice to hear that you got it working :slightly_smiling_face: :+1:t4:

Regarding the controls for not only our TCL TV we are using Mini Media Player. Works pretty well with TCL TVs.

Nevertheless, when it comes to turning a TCL TV (TCL 55P725 here) to ON through HA the outcome is rather disapointing: If the TV is switched OFF/Standby mode the Android TV integration gets disconnected thus the TV becomes “unavailable” for controling it. This is different compared to i.e. the Sony Bravia Series were you can still control the Bravia although it is in Standby mode.

If you need to switch your TCL to ON through HA best is to search the forum. There are threads where people are successful by using WOL (Wake on LAN) to turn their TCL’s to ON.

Yep I have the same T.V
And once the tv is off, it becomes unavailable. Thats pretty useless.
Can you give me any links for using WOL to turn it on.

As far as i know, there is a paid WOL app in the play store. Does home assistant use that to turn it on?

No, no! It has nothing to do with some Android apps (maybe except you plan to control the TCL through Android).

Take a look i.e. here or here about HA and WOL (and TCL). There are some more threads about the topic. Just use the search facility of the forum.

1 Like

Just stumbled across this. The instructions should be valid for TCL TVs too.

Thank you, ill look into it.

Appreciate the help.