Turn on TV when Plug gets Power

hey guys i have a question for an automation.

so i have an hue smart plug and a grundig smart tv. my problem is that the tv does not turn on when it gets voltage. the tv will only go into standby and you need to turn it on via remote.

now i want to automate it. behind the hue plug is the grundig tv and a fire tv stick which is plugged into the tv. i tried to do it with wake on lan but wol only works when the tv was turned on at least one time.

my other thought is to turn on the fire tv stick because when i press the power key on the fire tv remote the tv will power on,too. i think this works via HDMI CEC.
so maybe there are two possibilities. on is the fire tv stick and the other is direct CEC?

anyone can help me?

PS: there is no option to turn on automatically for my tv

Is the fire stick reachable when you turn on the plug?

If not, maybe get a IR device with Tasmota. Then you can just send the remote on command.

yes it is reachable. i am currently trying to get the fire tv stick into my home assistant build but i cant find the ADB addon like mentioned in here Android TV - Home Assistant (home-assistant.io)

I haven’t seen a television that turns on when you plug it in in a long time.
You can either modify the TV power supply (risky and not recommended) or use something like the Broadlink RM Mini to control everything.

Mine does :smiley: , it restores state. Although the boot isn’t very fast…

Don’t have a Fire stick so can’t really help you with integrating that, sorry.

Ah, yes. It also took me a while to figure out how to get the ADB working - and I didn’t document it at the time, so now I can’t remember exactly :frowning:

From memory there wasn’t anything to install, just the platform: androidtv entry in configuration.yaml … and when I found out how to enable ADB on my nVidia Shield device, the androidtv.adb_command service automagically showed up in HA’s list of services. I really wish I had documented this, because it is not intuitive to new users.

I have also been annoyed at the trade-off … appliances with digital controls are supposedly better - except that they power-on to Standby and we are required to use their remote control.

Hi, I red that ADB is now built in and does not need an extra plugin so it should work with the configuration.yaml

I did this to add the stick as an Android tv but nothing showed up on HA or on the fire tv stick.
Also it was a Little Late yesterday I will try today and post my updates.

So now it works but not perfect.

I did the config.yaml again and changed the name from fire tv to supertv. There was a fire tv in HA before, but i don’t know if that was the issue.

media_player:
  - platform: androidtv
    name: supertv
    device_class: firetv
    host: 192.168.x.x

Also the fire tv stick is auto turned on so i have to turn it off after boot and turn it on after it again so my tv will turn on too. A little bit complicated for just turning on the tv but it works.
Here is the automation if anybody wants to use it.

- id: 'TV Bedroom'
  alias: TV Bedroom
  description: ''
  trigger:
  - platform: device
    type: turned_on
    entity_id: light.plug_bedroom
    domain: light
  condition: []
  action:
  - delay:
      hours: 0
      minutes: 0
      seconds: 50
      milliseconds: 0
  - service: media_player.turn_off
    target:
      entity_id: media_player.supertv
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: media_player.turn_on
    target:
      entity_id: media_player.supertv
  mode: single

Anyway is there a way to change the automation from the state of the plug to the state of the fire tv with adb? I did not found the correct way to do.
I could think that sometimes the fire tv needs a little bit longer to boot and 50 sec will not last to show up in HA.

Thank you for all tips and help :slight_smile:

Ok found it and now its even a bit faster.

I changed the automation to:

  - platform: state
    entity_id: media_player.supertv
    to: idle
  condition: []
  action:
  - service: media_player.turn_off
    target:
      entity_id: media_player.supertv
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: media_player.turn_on
    target:
      entity_id: media_player.supertv
  mode: single