Is there a way to expose a Harmony Hub to homebridge?

I’m using HA to expose some components to homekit (which seems to be working well out of the box, very cool) but I want to expose my Harmony activities. Is this even possible?

To be honest, I can’t even get my Harmony activities to show in HA so perhaps that’s half of my issue? Everything was detected automatically with the discovery component.

You can refer to this thread to setup your harmony activities if you haven’t already.

I think once your harmony activities are there in HA they’ll showup in Homebridge.

Best!

Harmony activities don’t appear like scripts. They are there, you just can’t see them. They act like an option for the remote. You just need to know the options. I suggest reading the documentation on Harmony. First thing you should look for is your config file that is created in the root directory. That will tell you every command that home assistant has.

Relevant info inside link:


Configuration file:

Upon startup one file will be written to your Home Assistant configuration directory per device in the following format: harmony_REMOTENAME.conf . The file will contain:

  • List of all programmed activity names and ID numbers
  • List of all programmed device names and ID numbers
  • List of all available commands per programmed device

Yeah, I followed the docs and it’s not working. I tried adding this:

  - platform: harmony
    name: Living Room 
    activity: Watch TV

But I’m not sure which section it needs to go in (keeping in mind my hub is automatically discovered). Does it go under:

remote:

I changed “activity” to the id of the activity I want to start but when I toggle the switch in the interface I get this error:

2018-09-17 23:45:11 ERROR (SyncWorker_1) [homeassistant.components.remote.harmony] No activity specified with turn_on service

Yes, it goes under the remote domain. See the first example in the doc’s:

# Example configuration.yaml entry
remote:
  - platform: harmony
    name: Bedroom
    host: 10.168.1.13

You don’t need that. You need to just add the host ip and you should be good to go. Handling the activities is done with automations.

Ok, understood. My ambiguity comes from the second example in the docs:

# Example configuration.yaml entry with discovery
  - platform: harmony
    name: Living Room 
    activity: Watch TV

Notice that this example doesn’t have the - remote designation.

Forgive me but I’m not sure that’s accurate. The information in the docs indicates that you can set a default activity and the default toggle will control it. That’s all I’m trying to do at the moment. From the docs:

  • activity ( Optional ): Activity to use when turn_on service is called without any data. Overrides the activity setting for this discovered hub.

My statement is 100% accurate. Assigning an activity at startup just allows you to use an action without specifying the activity name or id when turnon is used.

Here is an example switch that I use that properly sets the activity. Notice how the activity is specified in the turn_on action?


Here is my harmony configuration (Notice the lack of activity in the setup):

remote: 
  - platform: harmony
    name: living_room
    host: !secret remote_host

Here are my switches that I use to turn on each harmony activity:

  - platform: template
    switches:
        # XBOX HARMONY ACTIVITY
        xbox_one:
          value_template: "{{ is_state_attr('remote.living_room', 'current_activity', 'Xbox One') }}"
          turn_on:
            service: remote.turn_on
            data:
              entity_id: remote.living_room
              activity: 'Xbox One'
          turn_off:
            service: remote.turn_on
            data:
              entity_id: remote.living_room
              activity: 'PowerOff'
        
        # 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'
        
        # PC HARMONY ACTIVITY
        pc:
          value_template: "{{ is_state_attr('remote.living_room', 'current_activity', 'PC') }}"
          turn_on:
            service: remote.turn_on
            data:
              entity_id: remote.living_room
              activity: 'PC'
          turn_off:
            service: remote.turn_on
            data:
              entity_id: remote.living_room
              activity: 'PowerOff'
        
        # SWITCH HARMONY ACTIVITY
        switch:
          value_template: "{{ is_state_attr('remote.living_room', 'current_activity', 'Switch') }}"
          turn_on:
            service: remote.turn_on
            data:
              entity_id: remote.living_room
              activity: 'Switch'
          turn_off:
            service: remote.turn_on
            data:
              entity_id: remote.living_room
              activity: 'PowerOff'
        
        # TV HARMONY ACTIVITY
        tv:
          value_template: "{{ is_state_attr('remote.living_room', 'current_activity', 'TV') }}"
          turn_on:
            service: remote.turn_on
            data:
              entity_id: remote.living_room
              activity: 'TV'
          turn_off:
            service: remote.turn_on
            data:
              entity_id: remote.living_room
              activity: 'PowerOff'

If you specify an activity inside your setup, like so:

remote: 
  - platform: harmony
    name: living_room
    host: !secret remote_host
    activity: 'TV'

Inside automations you can use this service:

            service: remote.turn_on
            entity_id: remote.living_room

To turn on the TV instead of this:

            service: remote.turn_on
            data:
              entity_id: remote.living_room
              activity: 'TV'

Ok, I’ll give this a shot. Thank you very much.