Samsung TV and Virgin auto on automation

Hey, I have the below automation working but it seems a bit messy. Does anyone have any suggestions on improving it without having to buy an IR blaster to solve the main issue of turning the TV on?

Goal: An automation triggers to turn on the Virgin media box, set the channel, turn the TV on and swap to the correct HDMI input.

TV: UE55MU6400UXXU

My TV loses network connectivity (even over LAN) when turned off so I can’t turn the TV on directly remotely. So in order to do that I can turn the attached Chromecast on, then cancel out of the forced media player before eventually changing HDMI input.

It feels like there are some un-necessary steps in here and the steps themselves work fine if I trigger them each individually from the dev console (e.g. the switch source works immediately as expected) but they just don’t work properly if I put them in an automation unless I litter with delays and a couple of repeated commands, I assume this is because the steps need time to complete and the automation is triggering them too quickly…

Any thoughts appreciated!

action:
  - data: {}
    entity_id: media_player.virgin_v6
    service: media_player.turn_on
  - delay: 00:00:01
  - data:
      entity_id: media_player.virgin_v6
      source: ITV
    entity_id: media_player.virgin_v6
    service: media_player.select_source
  - data: {}
    entity_id: media_player.living_room_chromecast
    service: media_player.turn_on
  - delay: 00:00:02
  - data: {}
    entity_id: media_player.living_room_chromecast
    service: media_player.turn_off
  - delay: 00:00:05
  - data:
      entity_id: media_player.living_room_samsung_tv
      source: HDMI3
    entity_id: media_player.living_room_samsung_tv
    service: media_player.select_source
  - data:
      entity_id: media_player.living_room_samsung_tv
      source: HDMI3
    entity_id: media_player.living_room_samsung_tv
    service: media_player.select_source

I’m not going to be much help here unfortunately but could I ask how you added the V6 box as a media player (I’ve not come across this before)?

No worries haha, I’m not expecting a much better solution without the IR blaster to be honest. It’s the custom component bertbert72/HomeAssistant_VirginTivo . Been working perfectly for a couple months now!

1 Like