Turning off an Activity powers off the Harmony Hub Remote within Home Assistant

First time posting so please excuse poor formatting.

I’ve just set up Home Assistant to connect to a Harmony Hub.
I have setup scripts for sending various individual harmony commands to harmony connected devices and they all work find. The issue I have is with Activities.

I’ve created a script to trigger a Harmony Activity and, so long as the Harmony remote shows as “On” in Home Assistant, the Activity can be turned on and activate correctly. The script to turn the activity OFF also works but with an issue…

Issue: When I run the script to turn off the activity, it will also turn off the Harmony Hub within Home Assistant.

This means I can’t restart that activity, or start any other activity, without first:
Manually turning/toggling the Harmony Hub remote back on within the Home Assistant ‘Overview’ or ‘Device’ screen.

Here’s an example of two scripts. One to turn on an activity and another to turn it off.

turn_on_cooler_activity:
    alias: Cooler On
    sequence:
    - service: remote.turn_on
      entity_id: remote.harmony_hub
      data:
        activity: “Cooler”

turn_off_cooler_activity:
    alias: Cooler Off
    sequence:
    - service: remote.turn_on
      entity_id: remote.harmony_hub
      data:
        activity: PowerOff

For the sake of completeness this activity, and all other activities programmed into Harmony, still work correctly when triggered on/off directly from the Harmony App all day long.

That’s not how harmony hub works. You can turn on any activity when the remote is ‘off’. That means your scripts to turn on are incorrect. And just looking at the one you posted, it has incorrect quote styles.

image

That’s ‘fancy’ quoting. This means you copied and pasted from an unformatted source and it’s most likely the cause of all your problems. Change those to normal quotes or remove them entirely, just like you have for PowerOff.

As a side note, you can also make switches so you don’t have to call scripts:

switch:
- platform: template
  switches:
    cooler:
      friendly_name: Cooler
      value_template: "{{ is_state_attr('remote.harmony_hub', 'current_activity', 'Cooler') }}"
      turn_on:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: Cooler
      turn_off:
        service: remote.turn_on
        data:
          entity_id: remote.harmony_hub
          activity: PowerOff