|
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: "Harmony Hub Remote" |
| 4 | +description: "Instructions how to integrate Harmony Hub remotes into Home Assistant." |
| 5 | +date: 2016-11-05 17:00 |
| 6 | +sidebar: true |
| 7 | +comments: false |
| 8 | +sharing: true |
| 9 | +footer: true |
| 10 | +logo: harmony.png |
| 11 | +ha_category: Remote |
| 12 | +ha_iot_class: "Local Polling" |
| 13 | +ha_release: "0.33" |
| 14 | +--- |
| 15 | + |
| 16 | + |
| 17 | +The `harmony` remote platform allows you to control the state of your [Harmony Hub Device](http://www.logitech.com/en-us/product/harmony-hub). |
| 18 | + |
| 19 | +Supported units: |
| 20 | + |
| 21 | +- Harmony Hub |
| 22 | +- Harmony Companion |
| 23 | +- Harmony Pro |
| 24 | +- Harmony Elite |
| 25 | + |
| 26 | + |
| 27 | +To use your Harmony remote in your installation, add the following to your `configuration.yaml` file: |
| 28 | + |
| 29 | +```yaml |
| 30 | +# Example configuration.yaml entry |
| 31 | +remote: |
| 32 | + - platform: harmony |
| 33 | + name: Bedroom |
| 34 | + username: !secret username |
| 35 | + password: !secret password |
| 36 | + host: 10.168.1.13 |
| 37 | + port: 5222 |
| 38 | + activity: BedroomTV |
| 39 | + - platform: harmony |
| 40 | + name: Family Room |
| 41 | + username: !secret username |
| 42 | + password: !secret password |
| 43 | + host: 10.168.1.16 |
| 44 | + port: 5222 |
| 45 | + activity: Kodi |
| 46 | +``` |
| 47 | +
|
| 48 | +**Configuration variables**: |
| 49 | +
|
| 50 | +- **name** (*Required*): The hub's name to display in the front end. |
| 51 | +- **username** (*Required*): The email address used to login to the Harmony website. |
| 52 | +- **password** (*Required*): The password used to login to the Harmony website. |
| 53 | +- **host** (*Required*): The Harmony device's IP address. |
| 54 | +- **port** (*Required*): The Harmony device's port, 5222 is default. |
| 55 | +- **activity** (*Optional*): Activity to use when turnon service is called without any data. |
| 56 | +
|
| 57 | +**Configuration File**: |
| 58 | +Upon startup one file will be written to your HASS configuration directory per device in the following format: harmony_REMOTENAME.conf. The file will contain: |
| 59 | +
|
| 60 | +- List of all programmed activity names and ID numbers |
| 61 | +- List of all programmed device names and ID numbers |
| 62 | +- List of all available commands per programmed device |
| 63 | +
|
| 64 | +
|
| 65 | +
|
| 66 | +**Supported services**: |
| 67 | +
|
| 68 | +- **Turn Off**: Turn off all devices that were switched on from the start of the current activity |
| 69 | +
|
| 70 | +- **Turn On**:Start an activity, will start the default activity from configuration.yaml if no activity is specified. The specified activity can either be the activity name or the activity ID from the configuration file written to your HASS config directory. The service will respond faster if the activity ID is passed instead of the name |
| 71 | +
|
| 72 | +- **Send Command**: Send a command to one device, device ID and available commands are written to the configuration file at startup |
| 73 | +
|
| 74 | +- **Sync**: Synchronizes the Harmony device with the Harmony web service if any changes are made from the web portal or app |
| 75 | +
|
| 76 | +
|
| 77 | +**Examples** |
| 78 | +
|
| 79 | +- *Template sensors can be utilized to display current activity in the frontend.* |
| 80 | +```yaml |
| 81 | +sensor: |
| 82 | + - platform: template |
| 83 | + sensors: |
| 84 | + family_room: |
| 85 | + value_template: '{{ states.remote.family_room.attributes.current_activity }}' |
| 86 | + friendly_name: 'Family Room' |
| 87 | + bedroom: |
| 88 | + value_template: '{{ states.remote.bedroom.attributes.current_activity }}' |
| 89 | + friendly_name: 'bedroom' |
| 90 | +``` |
| 91 | +
|
| 92 | +
|
| 93 | +- *The example below shows how to control an `input_boolean` switch using the Harmony remote's current activity. The switch will turn on when the remote's state changes and the Kodi activity is started and off when the remote's state changes and the current activity is PowerOff.* |
| 94 | + |
| 95 | +```yaml |
| 96 | +Automation: |
| 97 | +- alias: "Watch TV started from harmony hub" |
| 98 | + trigger: |
| 99 | + platform: state |
| 100 | + entity_id: remote.family_room |
| 101 | + condition: |
| 102 | + condition: template |
| 103 | + {% raw %} |
| 104 | + value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}' |
| 105 | + {% endraw %} |
| 106 | + action: |
| 107 | + service: input_boolean.turn_on |
| 108 | + entity_id: input_boolean.notify |
| 109 | +- alias: "PowerOff started from harmony hub" |
| 110 | + trigger: |
| 111 | + platform: state |
| 112 | + entity_id: remote.family_room |
| 113 | + condition: |
| 114 | + condition: template |
| 115 | + {% raw %} |
| 116 | + value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}' |
| 117 | + {% endraw %} |
| 118 | + action: |
| 119 | + service: input_boolean.turn_off |
| 120 | + entity_id: input_boolean.notify |
| 121 | +```` |
0 commit comments