How to turn on tv from HA?

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
tap_action:
  action: call-service
  service: wake_on_lan.send_magic_packet
  target: {}
  data:
    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

tap_action:
  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.
philips

@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: []
trigger:
  - platform: device
    device_id: REPLACE with the ID of the TV entity
    domain: philips_js
    type: turn_on
condition: []
action:
  - service: wake_on_lan.send_magic_packet
    data:
      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: ""
trigger:
  - platform: state
    entity_id:
      - input_button.pc_on
condition: []
action:
  - service: wake_on_lan.send_magic_packet
    data:
      broadcast_port: 9
      mac: yyy
  - service: wake_on_lan.send_magic_packet
    data:
      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

switch:
  - 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
    turn_off:
     service: hassio.addon_stdin
     data:
      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.

I always find other things to run on the devices I deploy for these simple functions.and would agree a pi is over kill for just turning on the TV. However, the ESP devices are cheap and as mentioned above it would be a great option for building a small cheap IR blaster. If you haven’t looked at the ESP route it would be worth the effort.

You realize that you can use the same ESP to read the remotes codes.
Most remotes have a few buttons that only work in certain situations, so these buttons can work as scene selections or whatever you want.
Or you could use it to read the on/off state of the TV or any other equipment, or drive a LED(s).