Harmony Hub - Can't power off

Hey everyone, been having a little issue with the harmony component, so I’ve followed @BTallack’s method at the top of this post, and everything seems to be working, except the PowerOff option. I can start/switch activities from HASS as well as from the physical remote, and everything updates just fine in HA. But when i select ‘Powered Off’ from the HA UI, nothing happens.

Here’s the tvoff section from my script.yaml

  tvoff:
    sequence:
    - service: remote.turn_off
      entity_id: remote.livingroom 

The interesting thing is, if i go into the HA UI → Developer Tools → States. Set the…
Entity ID: remote.livingroom
State: off
Then click “Set State”, nothing happens… I would think this should activate the poweroff sequence, and turn all the devices off. But it doesn’t. Nor does it log anything.

Any ideas?

This is my harmony code, I have it sitting inside a separate file called harmony_select which gets included via !include_dir_merge_list includes/automation/ in the config yaml.

- alias: Harmony
  hide_entity: True
  trigger:
    platform: state
    entity_id: input_select.harmony_control
    from: 'Select Input'
  action:
    - service: remote.turn_on
      entity_id: remote.lounge_room
      data_template:
        activity: >
          {% if is_state("input_select.harmony_control", "Watch TV") %}
            22729670
          {% elif is_state("input_select.harmony_control", "Youtube") %}
            22731017
          {% elif is_state("input_select.harmony_control", "Play Xbox One") %}
            22729806
          {% elif is_state("input_select.harmony_control", "Play Wii U") %}
            22941693
          {% elif is_state("input_select.harmony_control", "Listen to Music") %}
            22729864
          {% elif is_state("input_select.harmony_control", "PowerOff") %}
            -1
          {% else %}
          {% endif %}
    - service: input_select.select_option
      entity_id: input_select.harmony_control
      data:
        option: "Select Input"
        
- alias: Harmony Off
  hide_entity: True
  trigger:
    platform: state
    entity_id: input_select.harmony_control
    to: 'PowerOff'
  action:
    - service: remote.turn_off
      entity_id: remote.lounge_room
    - service: input_select.select_option
      entity_id: input_select.harmony_control
      data_template:
        option: "Select Input"

So this entire yaml is loaded as an automation? Do you have any other relevant config files, and what are they loaded as (scripts, input_boolean, etc)?

in configuration.yaml:

remote:
  - platform: harmony
    name: HARMONY DEVICE NAME
    host: HARMONY IP ADDRESS

Once the component is enabled, a file called harmony_HARMONY_DEVICE_NAME.conf will be created. I also have an input_select that gets included similar to automation with the following:

  harmony_control:
    name: Harmony Control
    options:
      - Select Input
      - Watch TV
      - Play Xbox One
      - Play Wii U
      - Listen to Music
      - Youtube
      - PowerOff      
    icon: mdi:monitor

And then a sensor file called harmony.yaml which gets included with my sensors similar to above with below:

- platform: template
  sensors:
    current_activity:
      friendly_name: 'Current Activity'
      value_template: '{% if states.remote.lounge_room.state %}{{ states.remote.lounge_room.attributes.current_activity }}{% endif %}'

Then you add the two entities sensor.current_activity and input_select.harmony_control where you want them to be viewed.

Thanks man, I’ll convert my configs tonight, hopefully that fixes it.

I fixed my issue by setting it up like this: Logitech Harmony Integration with @iandday's component