How to turn on tv from HA?


I tink I’ve searched the internet from end to end but coudn’t find the answer or I’m getting to old/dumm for this.

My goal is simple as that, to turn on my tv while I boot up my desktop or simplier, to just turn it on from HA.

I did automate my pc (i.e.when I get home). Since first start of HA, I have tv integration on my dashboard. But it’s preconfigured, works only when tv is on and I cant do anything about it.

I tried to integrate “philips tv” but it cannot connect. The joint space tv firmware was last updated on 2014 so as my tv is a bit younger, I didn’t even bother.

I searched for turning on by the video source (like my old tv and ps3) but again with no luck. Sometimes simplicity is the king so it would be the best option.

How much complicated can be turning on your tv in 2024?

An ESP-Home IR sender is probably the easiest.
You can get “pre-built” ESP8285 from AliExpress, you just need to flash then and you are pretty much done

As I understand, it’s esp based(programmable) tv remote?

I appreciate your answer but the idea just doesn’t fit in my head. Connecting another device for just one simple job is nuts for me.

The thing is, if back in 2009 one device could turn on another via hdmi, then why the hack, I can’t make it 15 years later?! It doesn’t have to be via HA. Even better if I could make it in windows.

I’m looking for a software solution:)

EDIT: I tried WOL in the same manner as I turn on my pc

show_name: true
show_icon: true
type: button
  action: call-service
  service: wake_on_lan.send_magic_packet
  target: {}
    broadcast_port: 9
    mac: xx:98:xx:5e:xx:9c
entity: media_player.50pus6703_12

My tv is working only as another pc display so it’s “fixed” for one signal source. When tv is off, pc output is set to tv, I hit the button on smartphone HA app. TV turns on only backlight for ~30s and then goes off.

Welcome to the forum. If you can control the PS3 from HA, that might be your answer. If its connected to the TV by HDMI, you might be able to set it up with HDMI Control. I dont have a PS3 but most devices have this feature where turning on the device will also power up the TV.

Now that I think about it, it might be a feature in the TV setup, so you might have to check both the PS3 and the TV setup. Let us know what you find!

It’s to do with the HDMI CEC signal (if I remember correctly?)…there was an automation for a Samsung TV’s years ago…anyway is your TV on your network with it’s own IP address?..possible ping or port scanning is a start (a way in to the software of the TV)…?

As I understand you already integrated your tv in home assistant but you can’t turn it on.
This is very often a common problem. This problem arise, as from my observation, that many tvs after short period of time go in deep sleep. You can check this by turning on your tv and turning it off from ha. It will probably turn off. You can then turn it on, but if you left it off for a few miniutes it will became unresponsive.
Every tv has some quirk you could use to prevent tv from going into this mode.
I was able to install on android tv android remote and I believe it solve problem with one tv.
But every tv is a bit different so it might require a lot of digging on how to do it.

I had ps3 with my old tv long time ago.

I made this tv have static ip. Can ping only while it’s on. Philips named CEC as easylink and I turned it on.

okay…it looks like it can’t be done…because you need network connection when in standby…!.. the only thing I could suggest is either the remote …or fitting an Esp to back of the TV set… to turn on the tv(cloning the ‘on’ command of remote)…I think TV manufactures do things like this for non-hacking purposes?

Well I don’t think manufactures have anything to do with it. It’s tv design. They always are cheap on something and that something might be the thing you need the most.
From my experience the easiest tv to set up is android tv with a built in chromecast.
I didn’t try all but the one I have works flawlessly. Its MiTV-MSSP2

Not so much as you think. My tv got “integrated” with very first start of HA. But it is basic, limited integration.

Ther’s no on/off functions. And it’s saphi(philips os) not android tv. Back than I wanted it to be saphi, now I do regret it.

I understand you, that is how I bought samsung tv and regret it.
You can try, if you didn’t already, some hacs integration for this. Maybe it will work but don’t be surprise if it doesn’t.

Hold on, hold on. It doesn’t work that way. I do get respond from the tv as mentioned here How to turn on tv from HA? - #3 by kojot So besides it can’t answer to ping, it’s somewhat working.

Ok mates, I’m half way there.

I need your help to get this working smooth, but it works manually.

My previous integrasion of tv was via dlna, now I somehow menaged to integrate it with “philips tv” api 6. What it changes is, media player box with working on/off button.
Now I can manually turn on the tv. To do so I:

  • hit previously mentioned WoL button, that kinda “boots” the tv
  • refresh dashboard so on the grayed out media player appears again on/off switch
  • hit media player on switch and the tv is ON!

I would be sweet to do that with one click and this is where I need your help.
I tried replicate “media player on button” with my own separate button

  action: call-service
  service: media_player.turn_on
  target: {}
entity: media_player.50pus6703_12_2

also tried toggle

but it doesn’t work.

I need to find, what is code for this button at media player box.

@kojot I have a Philips TV 50PUS7304 and it’s working just fine.

What you have to try is the following:

  1. Install Philips TV integration.…i think is standard in HA, you don’t need custom integration.
    You need the IP address and I choose API version 6, but you can follow instructions to find the API’s of you TV

  2. Make an automation to Wake On Lan the TV

alias: REPLACE with the name of the automation
description: []
  - platform: device
    device_id: REPLACE with the ID of the TV entity
    domain: philips_js
    type: turn_on
condition: []
  - service: wake_on_lan.send_magic_packet
      mac: REPLACE with the MAC of the fixed IP of your TV
mode: single
  1. You make a card, something like this, but can be also something simple if you want only to wake up the TV

type: media-control
entity: media_player.REPLACE with your TV entity
name: REPLACE with a name of your TV

PS: I also have some lines in configuration.yaml, but i think in the latest version of HA you don’t need it anymore. If it dosen’t work let me know.
PS2: The MAC address of you TV must be the one for Wired/WI-Fi depending on your situation

When I press the power button on the card sometimes it take a little longer to respond (10 - 30 sec), but in most of the cases is working just fine.

That work’s like a charm. Thank you very much.

Could you help me some more?
I can’t figure out, how to turn on pc and tv with one button.

Both works fine with separate buttons. I tried making automation with same trigger that turns on my pc and then sends magic packet to two devices:

alias: TVplusPC_test
description: ""
  - platform: state
      - input_button.pc_on
condition: []
  - service: wake_on_lan.send_magic_packet
      broadcast_port: 9
      mac: yyy
  - service: wake_on_lan.send_magic_packet
      broadcast_port: 9
      mac: xxx
mode: single

It still works with pc but not with tv.

Obviously I’m doing something wrong but can’t figure what it is.

You have to make a switch entity for PC…this the short version :stuck_out_tongue_winking_eye:

1. First you have to be sure that you PC is able to be Wake Up Over Lan
Here i can’t help you. You have to search the settings in Bios for Wake-On-Lan option
2. You have also to do some settings in your PC, to be able to send WOL command to the PC. You have to google according with the operating system that you use on your pc to find these settings.
3. Go to configuration.yaml and insert the following lines

  - platform: wake_on_lan
    name: "REPLACE with the name you choose for PC"
    mac: REPLACE with the MAC address of your PC
    host: REPLACE with the IP of your PC
     service: hassio.addon_stdin
      addon: core_rpc_shutdown
      input: REPLACE with the name set above (without quotes

4. Restart HA and you should have a new entity called switch.<>
5. you can use any type of card to start the PC from HA, using that switch entity.

Sorry :pray:…now I read more carfully and i saw that you already managed to WOL the PC
I have to try…i didn’t think to a way to turn the TV and PC at the same time
If I find a solution I get back to you

How is your TV connected to the network, WiFi or a network cable? My experience is WOL doesn’t normally work when using wifi. If you’re doing testing and you turn your TV off and then try WOL, it may work as a lot of TVs wait a while before they really turn off. I actually used a separate device to send the IR command in one location on my network. I saw that’s not what you want to do but it might be your only option if you’re on WiFi. In my case the device was also working as a squeezelight media server to play music through the TV. The esp option recommended previously is a reasonable option if WOL will not work.

@Insane @bkprath Thank you both for your replys.
It turned out, that wol works like crap with my tv so any further work is pointless. I still need to use two separate buttons to fully turn on the tv. Even when it turns on, it has swithed ambilight mode, witch I have to switch again with remote.
Also making ir blaster(especially based on RPi) to just turn on tv is total overkil for me.