Help with condition template logic

I’m in the process of automating the Speedtest component, but due to the QoS settings on my router, I don’t want it to run if someone is streaming anything because the results will be inaccurate. So I’m trying to use the state of my Harmony hubs to determine if a streaming activity is active. As near as I can tell from the documentation, and from other questions here on the forum, this should work, but it doesn’t. Am I missing something really obvious here?

(Don’t mind the quick cycle time or the fact that it’s turning on a switch, those are just for testing"

- action:
  - data:
      entity_id: switch.garage_door
    service: switch.turn_on
  alias: Speedtest
  condition:
    condition: or
    conditions:
      - condition: template
        value_template: "{{ states.remote.tv_room.attributes.current_activity != 'Watch Fire TV' }}"
      - condition: template
        value_template: "{{ states.remote.moms_tv.attributes.current_activity != 'Watch Fire TV' }}"
  id: '1520137686510'
  trigger:
    platform: time
    minutes: '/1'
    seconds: '00'

If I just use a single value_template as the condition, it works fine. It’s just when I try to use two devices with ‘or’ logic.

Why would you want an ‘or’ condition? From what I understand you want to ensure the speed test runs if you’re not streaming, so that means you’re not streaming on tv_room AND you’re not streaming on moms_tv?

Yeah that would do it! :blush: Turns out it was working as intended, I was just using the wrong logic. Thank you!

1 Like