Sony Bravia XH9505 Switching on with power OFF only via remote control

Please excuse my English

Since the standby consumption of the Sony XH is about 30 watts, I would like to switch it off and on via a smart socket.

I use an Apple TV4K and the Denon AVR, everything is connected to Denon via HDMI.

The power consumption in HomeAssist shows the Apple TV in standby as 0 watts and when switching on the ATV4K goes up to 4-5 watts and then back to zero, so I can’t rely on that. The Denon AVR shows 4.5 watts in standby and after switching it on it goes to 30 watts and stays there depending on the volume.

All devices are connected to Smart sockets.

As soon as I switch on the Apple TV, the Denon also switches on and goes to 30 watts, then the smart socket should switch on and the TV.

Until I switch on the TV, everything in the automation works, but the TV doesn’t switch on - I first have to switch it on with the remote control.

What am I doing wrong? Why won’t the Sony switch on?


alias: 'Sony TV ON '
description: 'Sony TV ON '
trigger:
  - type: power
    platform: device
    device_id: 8776eb1f6fc43efe275a461d288a22cf
    entity_id: sensor.denon_avr_watt
    domain: sensor
    above: 10
condition: []
action:
  - type: turn_on
    device_id: b2553517f761f1f2bbe04ea795fc6a93
    entity_id: switch.tv_lufter
    domain: switch
  - wait_for_trigger:
      - platform: numeric_state
        entity_id: sensor.tv_lufter_watt
        above: '20'
        for:
          hours: 0
          minutes: 1
          seconds: 0
  - type: turn_on
    device_id: cab6bb9887e8d4f869f4c66cbbbd44ef
    entity_id: remote.sony_bravia_tv
    domain: remote
mode: single

I’m not sure, if Id choose the way you are to run this. :slight_smile: Why are you using the remote integration instead of the TV integration? Or does the AndroidTV integration not work?

Anyway, what doesn’t work are these lines, aren’t they?

- type: turn_on
    device_id: cab6bb9887e8d4f869f4c66cbbbd44ef
    entity_id: remote.sony_bravia_tv
    domain: remote

I’d suspect your wait_for_trigger doesn’t trigger. My guess would be on the one minute time frame to be above “20”. Maybe the power consumption drops for a second or two under 20, and then the one minute starts again. Or it doesn’t trigger at all, so either way the automation stays in that state and is still waiting. :slight_smile:

You could try a few things, like setting a timeout for the wait_for_trigger and check the automation page in your settings, to trace, what really happens while your automation runs. :slight_smile:

Ups, deleted accidentally a few lines at the end, so here they are again.

But maybe it is the remote integration you use. I don’t use it, but following the docs, you’re talking to your remote, not your TV itself. That could mean, that your remote is getting into “sleep mode”. I know this from some remote controls, especially BT ones, but normally the Sony remotes aren’t BT, they usually are infrared.

Thank you for the answer.

I also tried waiting 1 minute at a time, but unfortunately that wasn’t the solution either.

The problem is that I have to press the remote control power button once after power off and power on.

I have also tried this with remote.send_command but unfortunately no reaction, only when I press the remote control does it work.

Do I have to add something to config.yaml?

You first have to find out, what exactly isn’t working. :wink:

Try looking at the automation history. Settings > Automations & Scenes and take a look, what happened when the automation was last run. The clock at the right after your automation name.

This is the first step. After that, you can add a timeout value (what I’d suggest for every wait_template), to see, if the automation goes further after the timeout.

Right now you’re doing “try & error”, this will not lead to a fast solution. First of all, check what the automation does. And then we’ll see, where we need to step in and change things. :slight_smile:

I’ll start from the beginning, up to this automation it works, the socket switches on, with the Sony I also hear a short sign like a light click.


alias: 'Sony TV ON '
description: 'Sony TV ON '
trigger:
  - type: power
    platform: device
    device_id: 8776eb1f6fc43efe275a461d288a22cf
    entity_id: sensor.denon_avr_watt
    domain: sensor
    above: 10
condition: []
action:
  - type: turn_on
    device_id: b2553517f761f1f2bbe04ea795fc6a93
    entity_id: switch.tv_lufter
    domain: switch
mode: single

Then I have to press the green power button on the remote control so that the Sony also switches on and then I see that Android starts.

With remote send command I have also after the click manually
Wakeup sent no reaction
TvPower sent no reaction
Turn On no reaction

I have to take the remote control and the hand and press the power button after clicking. After that, everything works.

I have the impression that the screen of the Sony remains in standby after power ON until the green power button is pressed, either this is a setting in the Sony or it is a bug.

I don’t have an entry for the Sony in config.yaml, I have to add something to the config, I’m sorry, I’m only just getting to grips with the subject of Homeassist and Bravia.

:slight_smile: I do get, what you’re doing or trying to do. Thats why I was asking for the automation history.

What you need to do right now is plain and stupid debugging. :wink:

As we don’t know what really is happening in the background, you need to take a look into the right places, where you can at least get some insight into the background processes. For now, we don’t know, if the automation isn’t working, or if your different devices aren’t reacting.

Maybe, as you said, the TV stays in screen saving mode, maybe the remote is in sleep mode, we don’t know.

So, the order to get to grip with this, is as follows:

  • You want an automation to do something, that isn’t done, but with another device (that right now has nothing to do with HA) it works.
  • So we do check first, what the automation is doing. Where is it getting out of hand, or turns into a state we don’t want to. That’s what the automation history is for.
  • Next step, after checking the history, should lead us to one of the following:
    • the automation is working as expected, the command get’s sent, the TV (or whatever device) isn’t reacting. That would lead us to look what could be wrong there.
    • the automation isnt working as expected, as it breaks somewhere in the middle. No we know, that we have to look for something in the automation
  • Depending on what we find on our way, we would now start looking at the log files
  • and so on

You see, where I’m getting with this? Right now, you don’t know where your automation turns sideways. And before you know that, I can give you a hundred reasons, but none of these maybe the real reason.

So for you to do now:
Got to Settings > Automations & Scenes, look for this automation and click the history “clock”. There you will find all information, what happened the last time(s), this automation was run.

Return back here with the informations, and we’ll see where we need to adjust something. I’m not saying, I know the solution, but right now, we don’t even know the exact problem. :smiley:

So I have now found the reason why the Sony consumes about 30 watts in standby, it is the wifi, as soon as I deactivate the wifi on the Sony it also consumes 0 watts.

As soon as wifi is active or I use LAN it consumes 30 watts in standby, there is also an apk called Tasker but I don’t have an Android phone or devices at home so I can’t buy it.

Is there a command for the remote send command where I can switch the wifi off and on again.