Harmony hub turn on

Hi.

Can anyone tell me way the turn_off works and not the turn_on

- alias: turn_off_media
  trigger:
    - platform: state
      entity_id: input_boolean.media_off_on
      to: "off"
  action:
    service: remote.turn_off
    data:
       entity_id: remote.harmony_hub
       activity: 31327319


- alias: turn_on_media
  trigger:
    - platform: state
      entity_id: input_boolean.media_off_on
      to: "on"
  action:
     service: remote.turn_on
     data:
        entity_id: remote.harmony_hub
        activity: 31327319

the way this is coded, i would expect the turn off to not work. Here is a template switch that I use (which is essentially the same as your input boolean and automations:

switch:
  - platform: template
    switches:
      # PLAYSTATION HARMONY ACTIVITY
      ps4:
        value_template: "{{ is_state_attr('remote.living_room', 'current_activity', 'PS4') }}"
        turn_on:
          service: remote.turn_on
          data:
            entity_id: remote.living_room
            activity: 'PS4'
        turn_off:
          service: remote.turn_on
          data:
            entity_id: remote.living_room
            activity: 'PowerOff'

The harmony remote has an activity for everything. Power is considered an activity. It will have a different # than the activity you are using.

Also, notice that remote.turn_on is being used for all activities. That’s because you are turning on the power off activity, not turning off the activity you have.

Thanks :slight_smile: now it works :slight_smile: