Homebridge

I have this (https://github.com/KraigM/homebridge-harmonyhub) installed on my MacBook. I also have a pi with hassio agnd the homebridge plugin. Would I be able to transfer the json to the pi so my harmony activity switches show in the hassio homebridge plugin?

https://home-assistant.io/components/remote.harmony/ to add in home-assistant

Thanks for the quick response. However I have 2 hubs each with 3 activities. The discovery component only adds each hub. I’ve added nest, wînk, hue, darksky, plex, etc but I’m having a real problem understanding harmony. I just want an on off switch for each activity (6 total). Can anyone offer concise directions on how to do that?

Would the configuration.yaml look like this?

  • platform: harmony
    name: Living Room
    activity: Watch TV
  • platform: harmony
    name: Living Room
    activity: Retropie
  • platform: harmony
    name: Living Room
    activity: PS4
  • platform: harmony
    name: Bedroom
    activity: TV
  • platform: harmony
    name: Bedroom
    activity: Movie
  • platform: harmony
    name: Bedroom
    activity: Watch Apple TV

So I would do this via ssh? It was my understanding that hassio didn’t support sudo or wget etc.

if you use hass.io then go

My initial confusion is how do I install https://github.com/iandday/pyharmony/ in the hassio homebridge addon?

To your initial question, No, your activities don’t show up quite as easily in HA as they do in HomeKit without first doing some coding in HA. Like @Sunonline points you to, I configured the input selector in my HA front end. This is completely separate from configuring and using Homebridge, but I do that as well to continue to surface my Hub to HomeKit. If your goal is to get things on your HA front end, focus on that first, then if you still need to get things back to HomeKit, come back and install/configure the Homebridge Add-On as linked above.

You may be going to deep with your reference to GitHub python scripts. You are correct that, with Hass.io, you cannot install other things on your Pi directly (in general). The links shared previously showing how to configure Harmony in your front end mention wget and other installation steps. Maybe that’s just old instruction (started 2016), since Harmony support is built in to HA now? Not sure, but you don’t need to install anything additional now, just configure.

Unlike you I have only one hub. Here is my configuration to add the Hubs to Home Automation, and create the Input Selector on my front end:

configuration.yaml: In addition to my entries here you may need to specify the IP addresses of your hubs

remote:
  - platform: harmony
    name: Living Room TV
    activity: Apple TV

automations.yaml: (Assumes you’ve split your configuration)

#Harmony Hub related

- alias: "Power off via Harmony Hub"
  trigger:
    platform: state
    entity_id: remote.harmony_hub
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}'
  action:
    service: input_select.select_option
    entity_id: input_select.harmony_hub
    data:
      option: "Power Off"

- alias: "Apple TV via Harmony Hub"
  trigger:
    platform: state
    entity_id: remote.harmony_hub
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "Apple TV" }}'
  action:
    service: input_select.select_option
    entity_id: input_select.harmony_hub
    data:
      option: "Apple TV"

- alias: "AirPlay Music via Harmony Hub"
  trigger:
    platform: state
    entity_id: remote.harmony_hub
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "AirPlay Music" }}'
  action:
    service: input_select.select_option
    entity_id: input_select.harmony_hub
    data:
      option: "AirPlay Music"

- alias: "TV via Harmony Hub"
  trigger:
    platform: state
    entity_id: remote.harmony_hub
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "TV" }}'
  action:
    service: input_select.select_option
    entity_id: input_select.harmony_hub
    data:
      option: "TV"

- alias: "Fire TV via Harmony Hub"
  trigger:
    platform: state
    entity_id: remote.harmony_hub
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "Fire TV" }}'
  action:
    service: input_select.select_option
    entity_id: input_select.harmony_hub
    data:
      option: "Fire TV"

- alias: "Blu-ray via Harmony Hub"
  trigger:
    platform: state
    entity_id: remote.harmony_hub
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "Blu-ray" }}'
  action:
    service: input_select.select_option
    entity_id: input_select.harmony_hub
    data:
      option: "Blu-ray"



- alias: "Apple TV via HASS UI"
  trigger:
    platform: state
    entity_id: input_select.harmony_hub
    to: 'Apple TV'
  action:
    service: script.turn_on
    entity_id: script.apple_tv

- alias: "AirPlay Music via HASS UI"
  trigger:
    platform: state
    entity_id: input_select.harmony_hub
    to: 'AirPlay Music'
  action:
    service: script.turn_on
    entity_id: script.airplay_music

- alias: "TV via HASS UI"
  trigger:
    platform: state
    entity_id: input_select.harmony_hub
    to: 'TV'
  action:
    service: script.turn_on
    entity_id: script.tv

- alias: "Fire TV via HASS UI"
  trigger:
    platform: state
    entity_id: input_select.harmony_hub
    to: 'Fire TV'
  action:
    service: script.turn_on
    entity_id: script.fire_tv

- alias: "Blu-ray via HASS UI"
  trigger:
    platform: state
    entity_id: input_select.harmony_hub
    to: 'Blu-ray'
  action:
    service: script.turn_on
    entity_id: script.bluray

- alias: "Power Off via HASS UI"
  trigger:
    platform: state
    entity_id: input_select.harmony_hub
    to: 'Power Off'
  action:
    service: script.turn_on
    entity_id: script.tvoff

groups.yaml: The relevant entry for you is the - input_select.harmony_hub. This is code creates a “Living Room” group for me, which I include as a panel on one of the tabs of my front end, by referencing this group in another group, which I display (view: yes).

Living Room:
  view: no
  entities:
    - input_select.harmony_hub
    - group.fans
    - light.general_lights
    - light.chair_table_lamp
    - light.couch_table_lamp
    - group.living_room_floor_lamp

[edit]
I think I left off this input_selects.yaml file which I haven’t touched since I set it up:

# Input selectors for UI

harmony_hub:
  name: Harmony Hub
  options:
    - Power Off
    - Apple TV
    - AirPlay Music
    - TV
    - Fire TV
    - Blu-ray
  initial: Power Off
  icon: mdi:monitor

[edit 2]
Oh, and yet another yaml file I completely forgot about until I re-read my code is the scripts.yaml. Use this to associate your Hub’s activity names to their internal number so HA can call the switch no matter what you might change the actual name to.

#Harmony Hub

apple_tv:
  sequence:
  - service: remote.turn_on
    entity_id: remote.harmony_hub
    data:
      activity: "21339125"
airplay_music:
  sequence:
  - service: remote.turn_on
    entity_id: remote.harmony_hub
    data:
      activity: "21339393"
tv:
  sequence:
  - service: remote.turn_on
    entity_id: remote.harmony_hub
    data:
      activity: "21339273"
fire_tv:
  sequence:
  - service: remote.turn_on
    entity_id: remote.harmony_hub
    data:
      activity: "21339465"
bluray:
  sequence:
  - service: remote.turn_on
    entity_id: remote.harmony_hub
    data:
      activity: "21339358"
tvoff:
  sequence:
  - service: remote.turn_off
    entity_id: remote.harmony_hub

Hope some of this is helpful.

2 Likes