Smart TV ads throwing off your Harmony Hub Sequence?

Thought I would share this for those of you that may be interested.

I recently bought a new Samsung TV and configured it with my Harmony Hub to launch different sequences based on what I wanted. For example, my sequence to watch Netflix on my TV was:

alias: "Watch Netflix"
sequence:
  - service: homeassistant.turn_on
    data_template:
      entity_id: > 
        {% if is_state('media_player.samsung_q7_series_65_qn65q7fam', 'on') %}
        script.change_netflix
        {% elif is_state('media_player.samsung_q7_series_65_qn65q7fam', 'off') %}
        script.turnon_netflix
        {% endif %}

change_netflix

sequence:
  - service: remote.send_command
    data_template:
      entity_id: remote.living_room
      command:
        - InputHdmi1
        - SmartHub
        - DirectionRight
        - DirectionRight
        - DirectionRight
        - Select
      device: '52908960'
      delay_secs: 2.0  

turnon_netflix

sequence:
  - service: remote.send_command
    data_template:
      entity_id: remote.living_room
      command:
        - PowerToggle
        - InputHdmi1
        - SmartHub
        - DirectionRight
        - DirectionRight
        - DirectionRight
        - Select
      device: '52908960'
      delay_secs: 1.0  
  - service: remote.send_command
    data_template:
      entity_id: remote.living_room
      command:
        - PowerToggle
        - InputOptical
      device: '50675509'
      delay_secs: 1.0

There may have been an easier way to set this up but I wanted to determine if the TV was off, turn on all relative devices that I need. Likewise, if the TV was on, I knew all the devices I needed turned on were already on so at that point I just needed to change the Input only.

Here is where my issue came in. When I would launch the Watch Netflix script, there would be an ad after my settings and before my Netflix app. So, instead of my directional rights being 3, it is now 4. This would then launch the ad instead of Netflix. Same for my Prime Video sequence I have set up. VERY frustrating!

I did a little research and came across this site:

I have an ASUS router with the ability to blacklist URLs and set it up just now. I figured this may be able to help others that have come across this or point those of you with different TV models in the right direction.

I will report back once I have had a chance to allow this to run for a little while.

Good Luck!

Why aren’t you doing this as an activity in harmony…that’s how it’s supposed to be used and the main reason for having one.

The harmony will then track ‘in it’s head’ whether the TV is on as you change from activity to activity.

The reason I had it set up like this is because in the beginning I had the Harmony skill set up with the Echo. When I launched the activity (via Alexa) I would get weird things happening like when I would launch the activity to turn off my TV, my DVD player would turn on even though my DVD player was not even in the activity at all. In the meantime I have disabled the skill via the Alexa app until I could get back in there and refine my settings to get them to launch via HA.

The way I have it set up above was the first thing that came to mind.

Why would you have an activity specifically to turn off your TV, think you may have misunderstood how they are meant to work.

Things turning on/off by themselves is usually down to HDMICEC issues.